Use test scene beatmap bindable

This commit is contained in:
Craftplacer 2020-04-27 23:17:19 +02:00
parent ece6e2db5c
commit 0972442b3a
2 changed files with 13 additions and 8 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RiderProjectSettingsUpdater">
<option name="vcsConfiguration" value="2" />
<option name="vcsConfiguration" value="1" />
</component>
</project>

View File

@ -37,13 +37,18 @@ public class TestSceneDrawableTaikoMascot : TaikoSkinnableTestScene
TimeRange = { Value = 5000 },
};
[Cached(typeof(IBindable<WorkingBeatmap>))]
private Bindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
private Bindable<WorkingBeatmap> workingBeatmap;
private readonly List<DrawableTaikoMascot> mascots = new List<DrawableTaikoMascot>();
private readonly List<TaikoPlayfield> playfields = new List<TaikoPlayfield>();
private readonly List<DrawableTaikoRuleset> rulesets = new List<DrawableTaikoRuleset>();
[BackgroundDependencyLoader]
private void load(Bindable<WorkingBeatmap> 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<HitObject> { new Hit { Type = HitType.Centre } },
BeatmapInfo = new BeatmapInfo