From 0972442b3a6bbc64845d7a79b926454310c014ef Mon Sep 17 00:00:00 2001 From: Craftplacer Date: Mon, 27 Apr 2020 23:17:19 +0200 Subject: [PATCH] Use test scene beatmap bindable --- .../.idea/projectSettingsUpdater.xml | 2 +- .../Skinning/TestSceneDrawableTaikoMascot.cs | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.idea/.idea.osu.Desktop/.idea/projectSettingsUpdater.xml b/.idea/.idea.osu.Desktop/.idea/projectSettingsUpdater.xml index 4bb9f4d2a0..7515e76054 100644 --- a/.idea/.idea.osu.Desktop/.idea/projectSettingsUpdater.xml +++ b/.idea/.idea.osu.Desktop/.idea/projectSettingsUpdater.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneDrawableTaikoMascot.cs b/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneDrawableTaikoMascot.cs index 93b5803e87..3a78ad76a6 100644 --- a/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneDrawableTaikoMascot.cs +++ b/osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneDrawableTaikoMascot.cs @@ -37,13 +37,18 @@ public class TestSceneDrawableTaikoMascot : TaikoSkinnableTestScene TimeRange = { Value = 5000 }, }; - [Cached(typeof(IBindable))] - private Bindable beatmap = new Bindable(); + private Bindable workingBeatmap; private readonly List mascots = new List(); private readonly List playfields = new List(); private readonly List rulesets = new List(); + [BackgroundDependencyLoader] + private void load(Bindable beatmap) + { + workingBeatmap = beatmap; + } + [Test] public void TestStateTextures() { @@ -79,7 +84,7 @@ public void TestPlayfield() SetContents(() => { var ruleset = new TaikoRuleset(); - var drawableRuleset = new DrawableTaikoRuleset(ruleset, beatmap.Value.GetPlayableBeatmap(ruleset.RulesetInfo)); + var drawableRuleset = new DrawableTaikoRuleset(ruleset, workingBeatmap.Value.GetPlayableBeatmap(ruleset.RulesetInfo)); rulesets.Add(drawableRuleset); return drawableRuleset; }); @@ -110,17 +115,17 @@ public void TestKiai() { AddStep("Set beatmap", () => setBeatmap(true)); - AddUntilStep("Wait for beatmap to be loaded", () => beatmap.Value.Track.IsLoaded); + AddUntilStep("Wait for beatmap to be loaded", () => workingBeatmap.Value.Track.IsLoaded); AddStep("Create kiai ruleset", () => { - beatmap.Value.Track.Start(); + workingBeatmap.Value.Track.Start(); rulesets.Clear(); SetContents(() => { var ruleset = new TaikoRuleset(); - var drawableRuleset = new DrawableTaikoRuleset(ruleset, beatmap.Value.GetPlayableBeatmap(ruleset.RulesetInfo)); + var drawableRuleset = new DrawableTaikoRuleset(ruleset, workingBeatmap.Value.GetPlayableBeatmap(ruleset.RulesetInfo)); rulesets.Add(drawableRuleset); return drawableRuleset; }); @@ -148,7 +153,7 @@ private void setBeatmap(bool kiai = false) if (kiai) controlPointInfo.Add(0, new EffectControlPoint { KiaiMode = true }); - beatmap.Value = CreateWorkingBeatmap(new Beatmap + workingBeatmap.Value = CreateWorkingBeatmap(new Beatmap { HitObjects = new List { new Hit { Type = HitType.Centre } }, BeatmapInfo = new BeatmapInfo