1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Simplify implementation

This commit is contained in:
Dan Balasescu 2023-12-13 13:43:14 +09:00
parent 8c760e5110
commit 2930b53edd
No known key found for this signature in database
2 changed files with 8 additions and 6 deletions

View File

@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
double roundedOverallDifficulty = Math.Round(difficulty.OverallDifficulty);
int countSliderOrSpinner = difficulty.TotalObjectCount - difficulty.CircleCount;
int countSliderOrSpinner = difficulty.EndTimeObjectCount;
float percentSpecialObjects = (float)countSliderOrSpinner / difficulty.TotalObjectCount;
if (percentSpecialObjects < 0.2)

View File

@ -29,9 +29,12 @@ namespace osu.Game.Rulesets.Scoring.Legacy
public float OverallDifficulty { get; set; }
/// <summary>
/// The count of hitcircles in the beatmap.
/// The number of hitobjects in the beatmap with a distinct end time.
/// </summary>
public int CircleCount { get; set; }
/// <remarks>
/// Canonically, these are hitobjects are either sliders or spinners.
/// </remarks>
public int EndTimeObjectCount { get; set; }
/// <summary>
/// The total count of hitobjects in the beatmap.
@ -42,7 +45,6 @@ namespace osu.Game.Rulesets.Scoring.Legacy
float IBeatmapDifficultyInfo.ApproachRate => 0;
double IBeatmapDifficultyInfo.SliderMultiplier => 0;
double IBeatmapDifficultyInfo.SliderTickRate => 0;
int IBeatmapDifficultyInfo.EndTimeObjectCount => TotalObjectCount - CircleCount;
public static LegacyBeatmapConversionDifficultyInfo FromAPIBeatmap(APIBeatmap apiBeatmap) => FromBeatmapInfo(apiBeatmap);
@ -51,7 +53,7 @@ namespace osu.Game.Rulesets.Scoring.Legacy
SourceRuleset = beatmap.BeatmapInfo.Ruleset,
CircleSize = beatmap.Difficulty.CircleSize,
OverallDifficulty = beatmap.Difficulty.OverallDifficulty,
CircleCount = beatmap.HitObjects.Count - beatmap.HitObjects.Count(h => h is IHasDuration),
EndTimeObjectCount = beatmap.HitObjects.Count(h => h is IHasDuration),
TotalObjectCount = beatmap.HitObjects.Count
};
@ -60,7 +62,7 @@ namespace osu.Game.Rulesets.Scoring.Legacy
SourceRuleset = beatmapInfo.Ruleset,
CircleSize = beatmapInfo.Difficulty.CircleSize,
OverallDifficulty = beatmapInfo.Difficulty.OverallDifficulty,
CircleCount = beatmapInfo.Difficulty.TotalObjectCount - beatmapInfo.Difficulty.EndTimeObjectCount,
EndTimeObjectCount = beatmapInfo.Difficulty.EndTimeObjectCount,
TotalObjectCount = beatmapInfo.Difficulty.TotalObjectCount
};
}