mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 14:17:26 +08:00
refactor(osu.Game): improve code quality
This commit is contained in:
parent
b109e5de6c
commit
3003fc1061
@ -62,7 +62,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
{
|
||||
createTest(CreateDistributedHitEvents(0, 50).Select(h =>
|
||||
{
|
||||
var offset = Math.Abs(h.TimeOffset);
|
||||
double offset = Math.Abs(h.TimeOffset);
|
||||
var result = offset > 36 ? HitResult.Miss : offset > 32 ? HitResult.Meh : offset > 24 ? HitResult.Ok : offset > 16 ? HitResult.Good : offset > 8 ? HitResult.Great : HitResult.Perfect;
|
||||
return new HitEvent(h.TimeOffset, result, placeholder_object, placeholder_object, null);
|
||||
}).ToList());
|
||||
@ -73,13 +73,13 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
{
|
||||
var wide = CreateDistributedHitEvents(0, 50).Select(h =>
|
||||
{
|
||||
var offset = Math.Abs(h.TimeOffset);
|
||||
double offset = Math.Abs(h.TimeOffset);
|
||||
var result = offset > 36 ? HitResult.Miss : offset > 32 ? HitResult.Meh : offset > 24 ? HitResult.Ok : offset > 16 ? HitResult.Good : offset > 8 ? HitResult.Great : HitResult.Perfect;
|
||||
return new HitEvent(h.TimeOffset, result, placeholder_object, placeholder_object, null);
|
||||
});
|
||||
var narrow = CreateDistributedHitEvents(0, 50).Select(h =>
|
||||
{
|
||||
var offset = Math.Abs(h.TimeOffset);
|
||||
double offset = Math.Abs(h.TimeOffset);
|
||||
var result = offset > 25 ? HitResult.Miss : offset > 20 ? HitResult.Meh : offset > 15 ? HitResult.Ok : offset > 10 ? HitResult.Good : offset > 5 ? HitResult.Great : HitResult.Perfect;
|
||||
return new HitEvent(h.TimeOffset, result, placeholder_object, placeholder_object, null);
|
||||
});
|
||||
|
@ -299,14 +299,11 @@ namespace osu.Game.Screens.Ranking.Statistics
|
||||
|
||||
float offsetValue = 0;
|
||||
|
||||
if (values.Any())
|
||||
for (int i = 0; i < values.Count; i++)
|
||||
{
|
||||
for (int i = 0; i < values.Count; i++)
|
||||
{
|
||||
boxOriginals[i].MoveToY(offsetForValue(offsetValue) * BoundingBox.Height, duration, Easing.OutQuint);
|
||||
boxOriginals[i].ResizeHeightTo(heightForValue(values[i].Value), duration, Easing.OutQuint);
|
||||
offsetValue -= values[i].Value;
|
||||
}
|
||||
boxOriginals[i].MoveToY(offsetForValue(offsetValue) * BoundingBox.Height, duration, Easing.OutQuint);
|
||||
boxOriginals[i].ResizeHeightTo(heightForValue(values[i].Value), duration, Easing.OutQuint);
|
||||
offsetValue -= values[i].Value;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user