diff --git a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapProcessor.cs b/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapProcessor.cs index cc3f1dfc7a..ef585e2675 100644 --- a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapProcessor.cs +++ b/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapProcessor.cs @@ -8,11 +8,11 @@ namespace osu.Game.Modes.Catch.Beatmaps { internal class CatchBeatmapProcessor : IBeatmapProcessor { - public void PostProcess(Beatmap beatmap) + public void SetDefaults(CatchBaseHit hitObject, Beatmap beatmap) { } - public void SetDefaults(CatchBaseHit hitObject) + public void PostProcess(Beatmap beatmap) { } } diff --git a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapProcessor.cs b/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapProcessor.cs index 062c5f1bf4..5e85a8f864 100644 --- a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapProcessor.cs +++ b/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapProcessor.cs @@ -8,11 +8,11 @@ namespace osu.Game.Modes.Mania.Beatmaps { internal class ManiaBeatmapProcessor : IBeatmapProcessor { - public void PostProcess(Beatmap beatmap) + public void SetDefaults(ManiaBaseHit hitObject, Beatmap beatmap) { } - public void SetDefaults(ManiaBaseHit hitObject) + public void PostProcess(Beatmap beatmap) { } } diff --git a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs index 17187323d8..60f3d31765 100644 --- a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs +++ b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs @@ -8,8 +8,9 @@ namespace osu.Game.Modes.Osu.Beatmaps { internal class OsuBeatmapProcessor : IBeatmapProcessor { - public void SetDefaults(OsuHitObject hitObject) + public void SetDefaults(OsuHitObject hitObject, Beatmap beatmap) { + hitObject.SetDefaultsFromBeatmap(beatmap); } public void PostProcess(Beatmap beatmap) diff --git a/osu.Game.Modes.Osu/Objects/OsuHitObject.cs b/osu.Game.Modes.Osu/Objects/OsuHitObject.cs index bec4a863c9..a3f2222fbb 100644 --- a/osu.Game.Modes.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Modes.Osu/Objects/OsuHitObject.cs @@ -67,10 +67,8 @@ namespace osu.Game.Modes.Osu.Objects return OsuScoreResult.Miss; } - public override void SetDefaultsFromBeatmap(Beatmap beatmap) + public virtual void SetDefaultsFromBeatmap(Beatmap beatmap) { - base.SetDefaultsFromBeatmap(beatmap); - Scale = (1.0f - 0.7f * (beatmap.BeatmapInfo.BaseDifficulty.CircleSize - 5) / 5) / 2; } } diff --git a/osu.Game.Modes.Osu/Objects/Slider.cs b/osu.Game.Modes.Osu/Objects/Slider.cs index 664629bf6d..7aecdb1240 100644 --- a/osu.Game.Modes.Osu/Objects/Slider.cs +++ b/osu.Game.Modes.Osu/Objects/Slider.cs @@ -75,7 +75,7 @@ namespace osu.Game.Modes.Osu.Objects public double Velocity; public double TickDistance; - public override void SetDefaultsFromBeatmap(Beatmap beatmap) + public override void SetDefaultsFromBeatmap(Beatmap beatmap) { base.SetDefaultsFromBeatmap(beatmap); diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs index 6a9ca5801b..9a244cd23e 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs +++ b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs @@ -8,11 +8,11 @@ namespace osu.Game.Modes.Taiko.Beatmaps { internal class TaikoBeatmapProcessor : IBeatmapProcessor { - public void PostProcess(Beatmap beatmap) + public void SetDefaults(TaikoBaseHit hitObject, Beatmap beatmap) { } - public void SetDefaults(TaikoBaseHit hitObject) + public void PostProcess(Beatmap beatmap) { } } diff --git a/osu.Game/Beatmaps/IBeatmapProcessor.cs b/osu.Game/Beatmaps/IBeatmapProcessor.cs index 1a86ac8128..3773f69279 100644 --- a/osu.Game/Beatmaps/IBeatmapProcessor.cs +++ b/osu.Game/Beatmaps/IBeatmapProcessor.cs @@ -16,7 +16,8 @@ namespace osu.Game.Beatmaps /// Sets default values for a HitObject. /// /// The HitObject to set default values for. - void SetDefaults(T hitObject); + /// The Beatmap to extract the default values from. + void SetDefaults(T hitObject, Beatmap beatmap); /// /// Post-processes a Beatmap to add mode-specific components that aren't added during conversion. diff --git a/osu.Game/Modes/Objects/HitObject.cs b/osu.Game/Modes/Objects/HitObject.cs index 20fab2e8d7..4df1354adf 100644 --- a/osu.Game/Modes/Objects/HitObject.cs +++ b/osu.Game/Modes/Objects/HitObject.cs @@ -23,11 +23,5 @@ namespace osu.Game.Modes.Objects /// The sample to be played when this HitObject is hit. /// public HitSampleInfo Sample { get; set; } - - /// - /// Sets default parameters from a beatmap. - /// - /// The beatmap to set from. - public virtual void SetDefaultsFromBeatmap(Beatmap beatmap) { } } } diff --git a/osu.Game/Modes/UI/HitRenderer.cs b/osu.Game/Modes/UI/HitRenderer.cs index 88f1f68709..32496e5d45 100644 --- a/osu.Game/Modes/UI/HitRenderer.cs +++ b/osu.Game/Modes/UI/HitRenderer.cs @@ -65,7 +65,7 @@ namespace osu.Game.Modes.UI // Convert + process the beatmap Beatmap = CreateBeatmapConverter().Convert(beatmap.Beatmap); - Beatmap.HitObjects.ForEach(CreateBeatmapProcessor().SetDefaults); + Beatmap.HitObjects.ForEach(h => CreateBeatmapProcessor().SetDefaults(h, Beatmap)); CreateBeatmapProcessor().PostProcess(Beatmap); applyMods(beatmap.Mods.Value);