From 0ef15f5bd5156b04cd972e553ebd64c9f6b7ca67 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 19 Feb 2019 17:45:16 +0900 Subject: [PATCH] Update with PopulateAttributes() removal --- .../Preprocessing/TaikoDifficultyHitObject.cs | 4 ++-- .../Difficulty/TaikoDifficultyCalculator.cs | 24 ++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Difficulty/Preprocessing/TaikoDifficultyHitObject.cs b/osu.Game.Rulesets.Taiko/Difficulty/Preprocessing/TaikoDifficultyHitObject.cs index 4d63d81663..24345275c1 100644 --- a/osu.Game.Rulesets.Taiko/Difficulty/Preprocessing/TaikoDifficultyHitObject.cs +++ b/osu.Game.Rulesets.Taiko/Difficulty/Preprocessing/TaikoDifficultyHitObject.cs @@ -11,8 +11,8 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing { public readonly bool HasTypeChange; - public TaikoDifficultyHitObject(HitObject hitObject, HitObject lastObject, double timeRate) - : base(hitObject, lastObject, timeRate) + public TaikoDifficultyHitObject(HitObject hitObject, HitObject lastObject, double clockRate) + : base(hitObject, lastObject, clockRate) { HasTypeChange = lastObject is RimHit != hitObject is RimHit; } diff --git a/osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyCalculator.cs b/osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyCalculator.cs index e2c0ea7f46..d973b80e12 100644 --- a/osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyCalculator.cs @@ -24,27 +24,29 @@ namespace osu.Game.Rulesets.Taiko.Difficulty { } - protected override void PopulateAttributes(DifficultyAttributes attributes, IBeatmap beatmap, Skill[] skills, double timeRate) + protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate) { - var taikoAttributes = (TaikoDifficultyAttributes)attributes; + if (beatmap.HitObjects.Count == 0) + return new TaikoDifficultyAttributes(); - taikoAttributes.StarRating = skills.Single().DifficultyValue() * star_scaling_factor; - - // Todo: This int cast is temporary to achieve 1:1 results with osu!stable, and should be removed in the future - taikoAttributes.GreatHitWindow = (int)(beatmap.HitObjects.First().HitWindows.Great / 2) / timeRate; - taikoAttributes.MaxCombo = beatmap.HitObjects.Count(h => h is Hit); + return new TaikoDifficultyAttributes + { + StarRating = skills.Single().DifficultyValue() * star_scaling_factor, + Mods = mods, + // Todo: This int cast is temporary to achieve 1:1 results with osu!stable, and should be removed in the future + GreatHitWindow = (int)(beatmap.HitObjects.First().HitWindows.Great / 2) / clockRate, + MaxCombo = beatmap.HitObjects.Count(h => h is Hit), + }; } - protected override IEnumerable CreateDifficultyHitObjects(IBeatmap beatmap, double timeRate) + protected override IEnumerable CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate) { for (int i = 1; i < beatmap.HitObjects.Count; i++) - yield return new TaikoDifficultyHitObject(beatmap.HitObjects[i], beatmap.HitObjects[i - 1], timeRate); + yield return new TaikoDifficultyHitObject(beatmap.HitObjects[i], beatmap.HitObjects[i - 1], clockRate); } protected override Skill[] CreateSkills() => new Skill[] { new Strain() }; - protected override DifficultyAttributes CreateDifficultyAttributes() => new TaikoDifficultyAttributes(); - protected override Mod[] DifficultyAdjustmentMods => new Mod[] { new TaikoModDoubleTime(),