Skip to content

Commit

Permalink
Simplify implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Dec 13, 2023
1 parent 8c760e5 commit 2930b53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static int GetColumnCount(LegacyBeatmapConversionDifficultyInfo difficult

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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ public class LegacyBeatmapConversionDifficultyInfo : IBeatmapDifficultyInfo
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.
Expand All @@ -42,7 +45,6 @@ public class LegacyBeatmapConversionDifficultyInfo : IBeatmapDifficultyInfo
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);

Expand All @@ -51,7 +53,7 @@ public class LegacyBeatmapConversionDifficultyInfo : IBeatmapDifficultyInfo
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
};

Expand All @@ -60,7 +62,7 @@ public class LegacyBeatmapConversionDifficultyInfo : IBeatmapDifficultyInfo
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
};
}
Expand Down

0 comments on commit 2930b53

Please sign in to comment.