Rename `SliderPlacementState` to make way for more generic version

This commit is contained in:
Dean Herbert 2021-04-16 14:09:35 +09:00
parent a9d1d163bb
commit 5c0ef55691
1 changed files with 10 additions and 10 deletions

View File

@ -30,7 +30,7 @@ public class SliderPlacementBlueprint : PlacementBlueprint
private InputManager inputManager;
private PlacementState state;
private SliderPlacementState state;
private PathControlPoint segmentStart;
private PathControlPoint cursor;
private int currentSegmentLength;
@ -58,7 +58,7 @@ private void load(OsuColour colours)
controlPointVisualiser = new PathControlPointVisualiser(HitObject, false)
};
setState(PlacementState.Initial);
setState(SliderPlacementState.Initial);
}
protected override void LoadComplete()
@ -73,12 +73,12 @@ public override void UpdateTimeAndPosition(SnapResult result)
switch (state)
{
case PlacementState.Initial:
case SliderPlacementState.Initial:
BeginPlacement();
HitObject.Position = ToLocalSpace(result.ScreenSpacePosition);
break;
case PlacementState.Body:
case SliderPlacementState.Body:
updateCursor();
break;
}
@ -91,11 +91,11 @@ protected override bool OnMouseDown(MouseDownEvent e)
switch (state)
{
case PlacementState.Initial:
case SliderPlacementState.Initial:
beginCurve();
break;
case PlacementState.Body:
case SliderPlacementState.Body:
if (canPlaceNewControlPoint(out var lastPoint))
{
// Place a new point by detatching the current cursor.
@ -121,7 +121,7 @@ protected override bool OnMouseDown(MouseDownEvent e)
protected override void OnMouseUp(MouseUpEvent e)
{
if (state == PlacementState.Body && e.Button == MouseButton.Right)
if (state == SliderPlacementState.Body && e.Button == MouseButton.Right)
endCurve();
base.OnMouseUp(e);
}
@ -129,7 +129,7 @@ protected override void OnMouseUp(MouseUpEvent e)
private void beginCurve()
{
BeginPlacement(commitStart: true);
setState(PlacementState.Body);
setState(SliderPlacementState.Body);
}
private void endCurve()
@ -219,12 +219,12 @@ private void updateSlider()
tailCirclePiece.UpdateFrom(HitObject.TailCircle);
}
private void setState(PlacementState newState)
private void setState(SliderPlacementState newState)
{
state = newState;
}
private enum PlacementState
private enum SliderPlacementState
{
Initial,
Body,