mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Extract tuple into class
This commit is contained in:
@ -213,22 +213,22 @@ namespace osu.Game.Scoring
|
||||
set => isLegacyScore = value;
|
||||
}
|
||||
|
||||
public IEnumerable<(HitResult result, int count, int? maxCount)> GetStatisticsForDisplay()
|
||||
public IEnumerable<HitResultDisplayStatistic> GetStatisticsForDisplay()
|
||||
{
|
||||
foreach (var key in OrderAttributeUtils.GetValuesInOrder<HitResult>())
|
||||
foreach (var r in Ruleset.CreateInstance().GetHitResults())
|
||||
{
|
||||
if (key.IsBonus())
|
||||
if (r.result.IsBonus())
|
||||
continue;
|
||||
|
||||
int value = Statistics.GetOrDefault(key);
|
||||
int value = Statistics.GetOrDefault(r.result);
|
||||
|
||||
switch (key)
|
||||
switch (r.result)
|
||||
{
|
||||
case HitResult.SmallTickHit:
|
||||
{
|
||||
int total = value + Statistics.GetOrDefault(HitResult.SmallTickMiss);
|
||||
if (total > 0)
|
||||
yield return (key, value, total);
|
||||
yield return new HitResultDisplayStatistic(r.result, value, total, r.displayName);
|
||||
|
||||
break;
|
||||
}
|
||||
@ -237,7 +237,7 @@ namespace osu.Game.Scoring
|
||||
{
|
||||
int total = value + Statistics.GetOrDefault(HitResult.LargeTickMiss);
|
||||
if (total > 0)
|
||||
yield return (key, value, total);
|
||||
yield return new HitResultDisplayStatistic(r.result, value, total, r.displayName);
|
||||
|
||||
break;
|
||||
}
|
||||
@ -247,8 +247,7 @@ namespace osu.Game.Scoring
|
||||
break;
|
||||
|
||||
default:
|
||||
if (value > 0 || key == HitResult.Miss)
|
||||
yield return (key, value, null);
|
||||
yield return new HitResultDisplayStatistic(r.result, value, null, r.displayName);
|
||||
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user