From a551958eeb413e7e4a4b34b72cc8ed53b14f6d5c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 1 May 2021 21:32:45 +0900 Subject: [PATCH] Move caching of `IBeatmap` to base `DrawableRuleset` --- osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs | 4 ---- osu.Game/Rulesets/UI/DrawableRuleset.cs | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs b/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs index 536d7b39b7..4ee060e91e 100644 --- a/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs @@ -45,9 +45,6 @@ namespace osu.Game.Rulesets.Mania.UI public new ManiaBeatmap Beatmap => (ManiaBeatmap)base.Beatmap; - [Cached(typeof(IBeatmap))] - private ManiaBeatmap cachedBeatmap { get; set; } - public IEnumerable BarLines; protected override bool RelativeScaleBeatLengths => true; @@ -80,7 +77,6 @@ namespace osu.Game.Rulesets.Mania.UI : base(ruleset, beatmap, mods) { BarLines = new BarLineGenerator(Beatmap).BarLines; - cachedBeatmap = Beatmap; } [BackgroundDependencyLoader] diff --git a/osu.Game/Rulesets/UI/DrawableRuleset.cs b/osu.Game/Rulesets/UI/DrawableRuleset.cs index ca27e6b21a..a2dade2627 100644 --- a/osu.Game/Rulesets/UI/DrawableRuleset.cs +++ b/osu.Game/Rulesets/UI/DrawableRuleset.cs @@ -85,6 +85,7 @@ namespace osu.Game.Rulesets.UI /// /// The beatmap. /// + [Cached(typeof(IBeatmap))] public readonly Beatmap Beatmap; public override IEnumerable Objects => Beatmap.HitObjects;