private void checkHyperDashCatcherColour(ISkin skin, Color4 expectedCatcherColour, Color4?expectedEndGlowColour = null) { CatcherArea catcherArea = null; CatcherTrailDisplay trails = null; AddStep("create hyper-dashing catcher", () => { Child = setupSkinHierarchy(catcherArea = new CatcherArea { Anchor = Anchor.Centre, Origin = Anchor.Centre, Scale = new Vector2(4f), }, skin); }); AddStep("get trails container", () => { trails = catcherArea.OfType <CatcherTrailDisplay>().Single(); catcherArea.MovableCatcher.SetHyperDashState(2); }); AddUntilStep("catcher colour is correct", () => catcherArea.MovableCatcher.Colour == expectedCatcherColour); AddAssert("catcher trails colours are correct", () => trails.HyperDashTrailsColour == expectedCatcherColour); AddAssert("catcher end-glow colours are correct", () => trails.EndGlowSpritesColour == (expectedEndGlowColour ?? expectedCatcherColour)); AddStep("finish hyper-dashing", () => { catcherArea.MovableCatcher.SetHyperDashState(1); catcherArea.MovableCatcher.FinishTransforms(); }); AddAssert("catcher colour returned to white", () => catcherArea.MovableCatcher.Colour == Color4.White); }
private void checkHyperDashCatcherColour(ISkin skin, Color4 expectedCatcherColour, Color4?expectedAfterImageColour = null) { CatcherTrailDisplay trails = null; Catcher catcher = null; AddStep("create hyper-dashing catcher", () => { CatcherArea catcherArea; Child = setupSkinHierarchy(new Container { Anchor = Anchor.Centre, Child = catcherArea = new CatcherArea { Catcher = catcher = new Catcher(new DroppedObjectContainer()) { Scale = new Vector2(4) } } }, skin); trails = catcherArea.ChildrenOfType <CatcherTrailDisplay>().Single(); }); AddStep("start hyper-dash", () => { catcher.SetHyperDashState(2); }); AddUntilStep("catcher colour is correct", () => catcher.Colour == expectedCatcherColour); AddAssert("catcher trails colours are correct", () => trails.HyperDashTrailsColour == expectedCatcherColour); AddAssert("catcher after-image colours are correct", () => trails.HyperDashAfterImageColour == (expectedAfterImageColour ?? expectedCatcherColour)); AddStep("finish hyper-dashing", () => { catcher.SetHyperDashState(); catcher.FinishTransforms(); }); AddAssert("catcher colour returned to white", () => catcher.Colour == Color4.White); }