From c68309ac4f977a7fc104038bdc1ec6c78b0f8e0b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 17 Feb 2020 16:37:24 +0900 Subject: [PATCH] Update TestSceneCatcherArea to use SkinnableTestScene --- .../TestSceneCatcherArea.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Catch.Tests/TestSceneCatcherArea.cs b/osu.Game.Rulesets.Catch.Tests/TestSceneCatcherArea.cs index 3ae6886c31..83ea6359c2 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestSceneCatcherArea.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestSceneCatcherArea.cs @@ -3,8 +3,10 @@ using System; using System.Collections.Generic; +using System.Linq; using NUnit.Framework; using osu.Framework.Allocation; +using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.UI; @@ -13,10 +15,9 @@ using osu.Game.Tests.Visual; namespace osu.Game.Rulesets.Catch.Tests { [TestFixture] - public class TestSceneCatcherArea : OsuTestScene + public class TestSceneCatcherArea : SkinnableTestScene { private RulesetInfo catchRuleset; - private TestCatcherArea catcherArea; public override IReadOnlyList RequiredTypes => new[] { @@ -26,20 +27,22 @@ namespace osu.Game.Rulesets.Catch.Tests public TestSceneCatcherArea() { AddSliderStep("CircleSize", 0, 8, 5, createCatcher); - AddToggleStep("Hyperdash", t => catcherArea.ToggleHyperDash(t)); + AddToggleStep("Hyperdash", t => + CreatedDrawables.OfType().Select(i => i.Child) + .OfType().ForEach(c => c.ToggleHyperDash(t))); } private void createCatcher(float size) { - Child = new CatchInputManager(catchRuleset) + SetContents(() => new CatchInputManager(catchRuleset) { RelativeSizeAxes = Axes.Both, - Child = catcherArea = new TestCatcherArea(new BeatmapDifficulty { CircleSize = size }) + Child = new TestCatcherArea(new BeatmapDifficulty { CircleSize = size }) { Anchor = Anchor.CentreLeft, Origin = Anchor.TopLeft }, - }; + }); } [BackgroundDependencyLoader]