Skip to content

Commit

Permalink
Refactor GetMaxCombo
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxOhn committed Oct 23, 2024
1 parent 156867c commit 6edaf21
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 10 deletions.
3 changes: 0 additions & 3 deletions PerformanceCalculator/Simulate/CatchSimulateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ public class CatchSimulateCommand : SimulateCommand

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)
{
var maxCombo = GetMaxCombo(beatmap);
Expand Down
2 changes: 0 additions & 2 deletions PerformanceCalculator/Simulate/ManiaSimulateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public class ManiaSimulateCommand : SimulateCommand

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)
{
// One judgement per normal note. Two judgements per hold note (head + tail).
Expand Down
2 changes: 0 additions & 2 deletions PerformanceCalculator/Simulate/OsuSimulateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ public class OsuSimulateCommand : SimulateCommand

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)
{
int countGreat;
Expand Down
2 changes: 1 addition & 1 deletion PerformanceCalculator/Simulate/SimulateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public override void Execute()
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);

Expand Down
2 changes: 0 additions & 2 deletions PerformanceCalculator/Simulate/TaikoSimulateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public class TaikoSimulateCommand : SimulateCommand

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)
{
var totalResultCount = GetMaxCombo(beatmap);
Expand Down

0 comments on commit 6edaf21

Please sign in to comment.