diff --git a/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs b/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs index 703eb6fe91..990ec083cb 100644 --- a/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs +++ b/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs @@ -15,6 +15,8 @@ namespace osu.Game.Modes.Catch.UI { } + protected override PlayMode PlayMode => PlayMode.Catch; + protected override Playfield CreatePlayfield() => new CatchPlayfield(); protected override DrawableHitObject GetVisualRepresentation(CatchBaseHit h) => null;// new DrawableFruit(h); diff --git a/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs b/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs index 33b82738f8..916d919851 100644 --- a/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs +++ b/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs @@ -18,6 +18,8 @@ namespace osu.Game.Modes.Mania.UI this.columns = columns; } + protected override PlayMode PlayMode => PlayMode.Mania; + protected override Playfield CreatePlayfield() => new ManiaPlayfield(columns); protected override DrawableHitObject GetVisualRepresentation(ManiaBaseHit h) diff --git a/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs b/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs index 118f96e145..040543fe1b 100644 --- a/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs +++ b/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs @@ -16,6 +16,8 @@ namespace osu.Game.Modes.Osu.UI { } + protected override PlayMode PlayMode => PlayMode.Osu; + protected override Playfield CreatePlayfield() => new OsuPlayfield(); protected override DrawableHitObject GetVisualRepresentation(OsuHitObject h) diff --git a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs index e7d0372f43..365ab94dcb 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs @@ -15,6 +15,8 @@ namespace osu.Game.Modes.Taiko.UI { } + protected override PlayMode PlayMode => PlayMode.Taiko; + protected override Playfield CreatePlayfield() => new TaikoPlayfield(); protected override DrawableHitObject GetVisualRepresentation(TaikoBaseHit h) => null;// new DrawableTaikoHit(h); diff --git a/osu.Game/Beatmaps/Beatmap.cs b/osu.Game/Beatmaps/Beatmap.cs index 94a56231f0..99a212adf4 100644 --- a/osu.Game/Beatmaps/Beatmap.cs +++ b/osu.Game/Beatmaps/Beatmap.cs @@ -87,9 +87,9 @@ namespace osu.Game.Beatmaps /// /// The type of HitObject the new Beatmap should contain. /// - public Beatmap ConvertTo() where T : HitObject + public Beatmap ConvertTo(PlayMode playMode) where T : HitObject { - return Ruleset.GetRuleset(BeatmapInfo.Mode).CreateBeatmapConverter().Convert(this); + return Ruleset.GetRuleset(playMode).CreateBeatmapConverter().Convert(this); } } } diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index cb021b7490..1443d55068 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -37,7 +37,7 @@ namespace osu.Game.Beatmaps protected DifficultyCalculator(Beatmap beatmap) { - Objects = beatmap.ConvertTo().HitObjects; + Objects = beatmap.ConvertTo(PlayMode).HitObjects; PreprocessHitObjects(); } diff --git a/osu.Game/Modes/UI/HitRenderer.cs b/osu.Game/Modes/UI/HitRenderer.cs index 68b4c6d022..c7c1c82781 100644 --- a/osu.Game/Modes/UI/HitRenderer.cs +++ b/osu.Game/Modes/UI/HitRenderer.cs @@ -50,15 +50,16 @@ namespace osu.Game.Modes.UI protected override Container Content => content; protected override bool AllObjectsJudged => Playfield.HitObjects.Children.All(h => h.Judgement.Result.HasValue); - protected Playfield Playfield; + protected abstract PlayMode PlayMode { get; } + protected Playfield Playfield; protected Beatmap Beatmap; private Container content; protected HitRenderer(Beatmap beatmap) { - Beatmap = beatmap.ConvertTo(); + Beatmap = beatmap.ConvertTo(PlayMode); RelativeSizeAxes = Axes.Both;