1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 20:25:39 +08:00

Remove unnecessary beatmap field

This commit is contained in:
Bartłomiej Dach 2020-04-28 23:24:21 +02:00
parent 24216b6600
commit 15bbedca87

View File

@ -6,7 +6,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using NUnit.Framework; using NUnit.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Testing; using osu.Framework.Testing;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints; using osu.Game.Beatmaps.ControlPoints;
@ -37,17 +36,9 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
TimeRange = { Value = 5000 }, TimeRange = { Value = 5000 },
}; };
private Bindable<WorkingBeatmap> workingBeatmap;
private IEnumerable<TestDrawableTaikoMascot> mascots => this.ChildrenOfType<TestDrawableTaikoMascot>(); private IEnumerable<TestDrawableTaikoMascot> mascots => this.ChildrenOfType<TestDrawableTaikoMascot>();
private IEnumerable<TaikoPlayfield> playfields => this.ChildrenOfType<TaikoPlayfield>(); private IEnumerable<TaikoPlayfield> playfields => this.ChildrenOfType<TaikoPlayfield>();
[BackgroundDependencyLoader]
private void load(Bindable<WorkingBeatmap> beatmap)
{
workingBeatmap = beatmap;
}
[Test] [Test]
public void TestStateTextures() public void TestStateTextures()
{ {
@ -75,7 +66,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
SetContents(() => SetContents(() =>
{ {
var ruleset = new TaikoRuleset(); var ruleset = new TaikoRuleset();
return new DrawableTaikoRuleset(ruleset, workingBeatmap.Value.GetPlayableBeatmap(ruleset.RulesetInfo)); return new DrawableTaikoRuleset(ruleset, Beatmap.Value.GetPlayableBeatmap(ruleset.RulesetInfo));
}); });
}); });
@ -101,16 +92,16 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
{ {
AddStep("Set beatmap", () => setBeatmap(true)); AddStep("Set beatmap", () => setBeatmap(true));
AddUntilStep("Wait for beatmap to be loaded", () => workingBeatmap.Value.Track.IsLoaded); AddUntilStep("Wait for beatmap to be loaded", () => Beatmap.Value.Track.IsLoaded);
AddStep("Create kiai ruleset", () => AddStep("Create kiai ruleset", () =>
{ {
workingBeatmap.Value.Track.Start(); Beatmap.Value.Track.Start();
SetContents(() => SetContents(() =>
{ {
var ruleset = new TaikoRuleset(); var ruleset = new TaikoRuleset();
return new DrawableTaikoRuleset(ruleset, workingBeatmap.Value.GetPlayableBeatmap(ruleset.RulesetInfo)); return new DrawableTaikoRuleset(ruleset, Beatmap.Value.GetPlayableBeatmap(ruleset.RulesetInfo));
}); });
}); });
@ -133,7 +124,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
if (kiai) if (kiai)
controlPointInfo.Add(0, new EffectControlPoint { KiaiMode = true }); controlPointInfo.Add(0, new EffectControlPoint { KiaiMode = true });
workingBeatmap.Value = CreateWorkingBeatmap(new Beatmap Beatmap.Value = CreateWorkingBeatmap(new Beatmap
{ {
HitObjects = new List<HitObject> { new Hit { Type = HitType.Centre } }, HitObjects = new List<HitObject> { new Hit { Type = HitType.Centre } },
BeatmapInfo = new BeatmapInfo BeatmapInfo = new BeatmapInfo