From 57727ac184443ea6c6336fc78830a969222bc77d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 19 Mar 2019 15:53:27 +0900 Subject: [PATCH] Remove preprocess until a later point in time --- .../Difficulty/CatchDifficultyCalculator.cs | 26 +++++++++---------- .../Difficulty/DifficultyCalculator.cs | 9 ------- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs b/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs index 502aeac84d..a3d5165df5 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs @@ -23,24 +23,13 @@ public class CatchDifficultyCalculator : DifficultyCalculator protected override int SectionLength => 750; - private float halfCatchWidth; + private float? halfCatchWidth; public CatchDifficultyCalculator(Ruleset ruleset, WorkingBeatmap beatmap) : base(ruleset, beatmap) { } - protected override void PreProcess(IBeatmap beatmap, Mod[] mods, double clockRate) - { - base.PreProcess(beatmap, mods, clockRate); - - var catcher = new CatcherArea.Catcher(beatmap.BeatmapInfo.BaseDifficulty); - halfCatchWidth = catcher.CatchWidth * 0.5f; - - // We're only using 80% of the catcher's width to simulate imperfect gameplay. - halfCatchWidth *= 0.8f; - } - protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate) { if (beatmap.HitObjects.Count == 0) @@ -60,6 +49,15 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat protected override IEnumerable CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate) { + if (halfCatchWidth == null) + { + var catcher = new CatcherArea.Catcher(beatmap.BeatmapInfo.BaseDifficulty); + halfCatchWidth = catcher.CatchWidth * 0.5f; + + // We're only using 80% of the catcher's width to simulate imperfect gameplay. + halfCatchWidth *= 0.8f; + } + CatchHitObject lastObject = null; foreach (var hitObject in beatmap.HitObjects.OfType()) @@ -74,14 +72,14 @@ protected override IEnumerable CreateDifficultyHitObjects(I { // We want to only consider fruits that contribute to the combo. Droplets are addressed as accuracy and spinners are not relevant for "skill" calculations. case Fruit fruit: - yield return new CatchDifficultyHitObject(fruit, lastObject, clockRate, halfCatchWidth); + yield return new CatchDifficultyHitObject(fruit, lastObject, clockRate, halfCatchWidth.Value); lastObject = hitObject; break; case JuiceStream _: foreach (var nested in hitObject.NestedHitObjects.OfType().Where(o => !(o is TinyDroplet))) { - yield return new CatchDifficultyHitObject(nested, lastObject, clockRate, halfCatchWidth); + yield return new CatchDifficultyHitObject(nested, lastObject, clockRate, halfCatchWidth.Value); lastObject = nested; } diff --git a/osu.Game/Rulesets/Difficulty/DifficultyCalculator.cs b/osu.Game/Rulesets/Difficulty/DifficultyCalculator.cs index c404fc6909..db8bdde6bb 100644 --- a/osu.Game/Rulesets/Difficulty/DifficultyCalculator.cs +++ b/osu.Game/Rulesets/Difficulty/DifficultyCalculator.cs @@ -63,8 +63,6 @@ public IEnumerable CalculateAll() private DifficultyAttributes calculate(IBeatmap beatmap, Mod[] mods, double clockRate) { - PreProcess(beatmap, mods, clockRate); - var skills = CreateSkills(beatmap); if (!beatmap.HitObjects.Any()) @@ -101,13 +99,6 @@ private DifficultyAttributes calculate(IBeatmap beatmap, Mod[] mods, double cloc return CreateDifficultyAttributes(beatmap, mods, skills, clockRate); } - /// - /// Computes any values to be used for difficulty calculation, prior to difficulty calculation taking place. - /// - protected virtual void PreProcess(IBeatmap beatmap, Mod[] mods, double clockRate) - { - } - /// /// Creates all combinations which adjust the difficulty. ///