1
0
Fork 0
mirror of https://github.com/ppy/osu-tools.git synced 2025-06-09 09:35:15 +09:00

Refactor GetMaxCombo

This commit is contained in:
MaxOhn 2024-10-23 13:17:31 +02:00
parent 156867cba3
commit 6edaf218ff
5 changed files with 1 additions and 10 deletions

View file

@ -35,9 +35,6 @@ namespace PerformanceCalculator.Simulate
public override Ruleset Ruleset => new CatchRuleset(); public override Ruleset Ruleset => new CatchRuleset();
protected override int GetMaxCombo(IBeatmap beatmap) => beatmap.HitObjects.Count(h => h is Fruit)
+ beatmap.HitObjects.OfType<JuiceStream>().SelectMany(j => j.NestedHitObjects).Count(h => !(h is TinyDroplet));
protected override Dictionary<HitResult, int> GenerateHitResults(double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood) protected override Dictionary<HitResult, int> GenerateHitResults(double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood)
{ {
var maxCombo = GetMaxCombo(beatmap); var maxCombo = GetMaxCombo(beatmap);

View file

@ -35,8 +35,6 @@ namespace PerformanceCalculator.Simulate
public override Ruleset Ruleset => new ManiaRuleset(); public override Ruleset Ruleset => new ManiaRuleset();
protected override int GetMaxCombo(IBeatmap beatmap) => 0;
protected override Dictionary<HitResult, int> GenerateHitResults(double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood) protected override Dictionary<HitResult, int> GenerateHitResults(double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood)
{ {
// One judgement per normal note. Two judgements per hold note (head + tail). // One judgement per normal note. Two judgements per hold note (head + tail).

View file

@ -43,8 +43,6 @@ namespace PerformanceCalculator.Simulate
public override Ruleset Ruleset => new OsuRuleset(); public override Ruleset Ruleset => new OsuRuleset();
protected override int GetMaxCombo(IBeatmap beatmap) => beatmap.GetMaxCombo();
protected override Dictionary<HitResult, int> GenerateHitResults(double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood) protected override Dictionary<HitResult, int> GenerateHitResults(double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood)
{ {
int countGreat; int countGreat;

View file

@ -83,7 +83,7 @@ namespace PerformanceCalculator.Simulate
OutputPerformance(scoreInfo, performanceAttributes, difficultyAttributes); OutputPerformance(scoreInfo, performanceAttributes, difficultyAttributes);
} }
protected abstract int GetMaxCombo(IBeatmap beatmap); protected static int GetMaxCombo(IBeatmap beatmap) => beatmap.GetMaxCombo();
protected abstract Dictionary<HitResult, int> GenerateHitResults(double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood); protected abstract Dictionary<HitResult, int> GenerateHitResults(double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood);

View file

@ -31,8 +31,6 @@ namespace PerformanceCalculator.Simulate
public override Ruleset Ruleset => new TaikoRuleset(); public override Ruleset Ruleset => new TaikoRuleset();
protected override int GetMaxCombo(IBeatmap beatmap) => beatmap.HitObjects.OfType<Hit>().Count();
protected override Dictionary<HitResult, int> GenerateHitResults(double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood) protected override Dictionary<HitResult, int> GenerateHitResults(double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood)
{ {
var totalResultCount = GetMaxCombo(beatmap); var totalResultCount = GetMaxCombo(beatmap);