From 389e0f672182c52866d5e482d506c6659c47acfd Mon Sep 17 00:00:00 2001 From: minisbett <39670899+minisbett@users.noreply.github.com> Date: Fri, 18 Oct 2024 22:54:34 +0200 Subject: [PATCH] get rid of redundant slider accuracy check --- PerformanceCalculatorGUI/RulesetHelper.cs | 8 ++++---- PerformanceCalculatorGUI/Screens/SimulateScreen.cs | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/PerformanceCalculatorGUI/RulesetHelper.cs b/PerformanceCalculatorGUI/RulesetHelper.cs index 05a9f1a..1529d03 100644 --- a/PerformanceCalculatorGUI/RulesetHelper.cs +++ b/PerformanceCalculatorGUI/RulesetHelper.cs @@ -104,11 +104,11 @@ namespace PerformanceCalculatorGUI return (int)Math.Round(1000000 * scoreMultiplier); } - public static Dictionary GenerateHitResultsForRuleset(RulesetInfo ruleset, bool hasSliderAccuracy, double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood, int countLargeTickMisses, int countSliderTailMisses) + public static Dictionary GenerateHitResultsForRuleset(RulesetInfo ruleset, double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood, int countLargeTickMisses, int countSliderTailMisses) { return ruleset.OnlineID switch { - 0 => generateOsuHitResults(accuracy, hasSliderAccuracy, beatmap, countMiss, countMeh, countGood, countLargeTickMisses, countSliderTailMisses), + 0 => generateOsuHitResults(accuracy, beatmap, countMiss, countMeh, countGood, countLargeTickMisses, countSliderTailMisses), 1 => generateTaikoHitResults(accuracy, beatmap, countMiss, countGood), 2 => generateCatchHitResults(accuracy, beatmap, countMiss, countMeh, countGood), 3 => generateManiaHitResults(accuracy, beatmap, countMiss), @@ -116,7 +116,7 @@ namespace PerformanceCalculatorGUI }; } - private static Dictionary generateOsuHitResults(double accuracy, bool hasSliderAccuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood, int countLargeTickMisses, int countSliderTailMisses) + private static Dictionary generateOsuHitResults(double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood, int countLargeTickMisses, int countSliderTailMisses) { int countGreat; @@ -200,7 +200,7 @@ namespace PerformanceCalculatorGUI { HitResult.Ok, countGood ?? 0 }, { HitResult.Meh, countMeh ?? 0 }, { HitResult.LargeTickMiss, countLargeTickMisses }, - { hasSliderAccuracy ? HitResult.SliderTailHit : HitResult.SmallTickHit, sliderTailHits }, + { HitResult.SliderTailHit, sliderTailHits }, { HitResult.Miss, countMiss } }; } diff --git a/PerformanceCalculatorGUI/Screens/SimulateScreen.cs b/PerformanceCalculatorGUI/Screens/SimulateScreen.cs index 2b29a6f..8431a74 100644 --- a/PerformanceCalculatorGUI/Screens/SimulateScreen.cs +++ b/PerformanceCalculatorGUI/Screens/SimulateScreen.cs @@ -675,8 +675,7 @@ namespace PerformanceCalculatorGUI.Screens if (ruleset.Value.OnlineID != -1) { // official rulesets can generate more precise hits from accuracy - bool hasSliderAccuracy = !appliedMods.Value.OfType().All(m => m.NoSliderHeadAccuracy.Value); - statistics = RulesetHelper.GenerateHitResultsForRuleset(ruleset.Value, hasSliderAccuracy, accuracyTextBox.Value.Value / 100.0, beatmap, missesTextBox.Value.Value, countMeh, countGood, largeTickMissesTextBox.Value.Value, sliderTailMissesTextBox.Value.Value); + statistics = RulesetHelper.GenerateHitResultsForRuleset(ruleset.Value, accuracyTextBox.Value.Value / 100.0, beatmap, missesTextBox.Value.Value, countMeh, countGood, largeTickMissesTextBox.Value.Value, sliderTailMissesTextBox.Value.Value); accuracy = RulesetHelper.GetAccuracyForRuleset(ruleset.Value, statistics); }