From 1365a1b7bec8d444dfe99f098ed2ad2c1863f770 Mon Sep 17 00:00:00 2001 From: OliBomby Date: Wed, 20 Dec 2023 01:57:11 +0100 Subject: [PATCH] fix tests --- .../Editor/TestSceneSliderControlPointPiece.cs | 13 ++++++++++++- .../Editor/TestSceneSliderSelectionBlueprint.cs | 15 +++++++++++++-- .../Sliders/SliderSelectionBlueprint.cs | 3 ++- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderControlPointPiece.cs b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderControlPointPiece.cs index 085e11460f..1a7430704d 100644 --- a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderControlPointPiece.cs +++ b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderControlPointPiece.cs @@ -353,7 +353,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor { public new SliderBodyPiece BodyPiece => base.BodyPiece; public new TestSliderCircleOverlay HeadOverlay => (TestSliderCircleOverlay)base.HeadOverlay; - public new TestSliderCircleOverlay TailOverlay => (TestSliderCircleOverlay)base.TailPiece; + public new TestSliderTailPiece TailPiece => (TestSliderTailPiece)base.TailPiece; public new PathControlPointVisualiser ControlPointVisualiser => base.ControlPointVisualiser; public TestSliderBlueprint(Slider slider) @@ -362,6 +362,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor } protected override SliderCircleOverlay CreateCircleOverlay(Slider slider, SliderPosition position) => new TestSliderCircleOverlay(slider, position); + protected override SliderTailPiece CreateTailPiece(Slider slider, SliderPosition position) => new TestSliderTailPiece(slider, position); } private partial class TestSliderCircleOverlay : SliderCircleOverlay @@ -373,5 +374,15 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor { } } + + private partial class TestSliderTailPiece : SliderTailPiece + { + public new HitCirclePiece CirclePiece => base.CirclePiece; + + public TestSliderTailPiece(Slider slider, SliderPosition position) + : base(slider, position) + { + } + } } } diff --git a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderSelectionBlueprint.cs b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderSelectionBlueprint.cs index adc4929227..2c5cff3f70 100644 --- a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderSelectionBlueprint.cs +++ b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderSelectionBlueprint.cs @@ -179,7 +179,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor () => Precision.AlmostEquals(blueprint.HeadOverlay.CirclePiece.ScreenSpaceDrawQuad.Centre, drawableObject.HeadCircle.ScreenSpaceDrawQuad.Centre)); AddAssert("tail positioned correctly", - () => Precision.AlmostEquals(blueprint.TailOverlay.CirclePiece.ScreenSpaceDrawQuad.Centre, drawableObject.TailCircle.ScreenSpaceDrawQuad.Centre)); + () => Precision.AlmostEquals(blueprint.TailPiece.CirclePiece.ScreenSpaceDrawQuad.Centre, drawableObject.TailCircle.ScreenSpaceDrawQuad.Centre)); } private void moveMouseToControlPoint(int index) @@ -198,7 +198,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor { public new SliderBodyPiece BodyPiece => base.BodyPiece; public new TestSliderCircleOverlay HeadOverlay => (TestSliderCircleOverlay)base.HeadOverlay; - public new TestSliderCircleOverlay TailOverlay => (TestSliderCircleOverlay)base.TailPiece; + public new TestSliderTailPiece TailPiece => (TestSliderTailPiece)base.TailPiece; public new PathControlPointVisualiser ControlPointVisualiser => base.ControlPointVisualiser; public TestSliderBlueprint(Slider slider) @@ -207,6 +207,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor } protected override SliderCircleOverlay CreateCircleOverlay(Slider slider, SliderPosition position) => new TestSliderCircleOverlay(slider, position); + protected override SliderTailPiece CreateTailPiece(Slider slider, SliderPosition position) => new TestSliderTailPiece(slider, position); } private partial class TestSliderCircleOverlay : SliderCircleOverlay @@ -218,5 +219,15 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor { } } + + private partial class TestSliderTailPiece : SliderTailPiece + { + public new HitCirclePiece CirclePiece => base.CirclePiece; + + public TestSliderTailPiece(Slider slider, SliderPosition position) + : base(slider, position) + { + } + } } } diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderSelectionBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderSelectionBlueprint.cs index 37c433cf8b..a13eeb0208 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderSelectionBlueprint.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderSelectionBlueprint.cs @@ -72,7 +72,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders { BodyPiece = new SliderBodyPiece(), HeadOverlay = CreateCircleOverlay(HitObject, SliderPosition.Start), - TailPiece = new SliderTailPiece(HitObject, SliderPosition.End), + TailPiece = CreateTailPiece(HitObject, SliderPosition.End), }; } @@ -415,5 +415,6 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders BodyPiece.ReceivePositionalInputAt(screenSpacePos) || ControlPointVisualiser?.Pieces.Any(p => p.ReceivePositionalInputAt(screenSpacePos)) == true; protected virtual SliderCircleOverlay CreateCircleOverlay(Slider slider, SliderPosition position) => new SliderCircleOverlay(slider, position); + protected virtual SliderTailPiece CreateTailPiece(Slider slider, SliderPosition position) => new SliderTailPiece(slider, position); } }