1
0
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:
Acid Chicken (硫酸鶏) 2022-09-07 02:29:15 +09:00
parent b109e5de6c
commit 3003fc1061
No known key found for this signature in database
GPG Key ID: 3E87B98A3F6BAB99
2 changed files with 7 additions and 10 deletions

View File

@ -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);
});

View File

@ -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;
}
}