Tidy up code quality

This commit is contained in:
Dean Herbert 2022-09-08 19:44:29 +09:00
parent 4f22616860
commit b9afe6f4cf
1 changed files with 11 additions and 16 deletions

View File

@ -18,28 +18,17 @@ namespace osu.Game.Rulesets.Catch.UI
{
public class CatchTouchInputMapper : VisibilityContainer
{
public enum TouchCatchAction
{
MoveLeft = 0,
MoveRight = 1,
DashLeft = 2,
DashRight = 3,
None = 4
}
private Dictionary<object, TouchCatchAction> trackedActions = new Dictionary<object, TouchCatchAction>();
private KeyBindingContainer<CatchAction> keyBindingContainer = null!;
private Container mainContent = null!;
// Fill values with null because UI is not declared in constructor
private ArrowHitbox leftBox = null!;
private ArrowHitbox rightBox = null!;
private ArrowHitbox leftDashBox = null!;
private ArrowHitbox rightDashBox = null!;
// Force input to be prossed even when hidden.
public override bool PropagatePositionalInputSubTree => true;
public override bool PropagateNonPositionalInputSubTree => true;
@ -151,11 +140,6 @@ protected override bool OnDragStart(DragStartEvent e)
return true;
}
protected override void OnDragEnd(DragEndEvent e)
{
base.OnDragEnd(e);
}
protected override void OnDrag(DragEvent e)
{
// I'm not sure if this is posible but let's be safe
@ -167,6 +151,7 @@ protected override void OnDrag(DragEvent e)
base.OnDrag(e);
}
protected override void OnTouchMove(TouchMoveEvent e)
{
// I'm not sure if this is posible but let's be safe
@ -240,6 +225,7 @@ private TouchCatchAction getTouchCatchActionFromInput(Vector2 inputPosition)
return TouchCatchAction.MoveLeft;
if (rightBox.Contains(inputPosition))
return TouchCatchAction.MoveRight;
return TouchCatchAction.None;
}
@ -316,5 +302,14 @@ public void OnReleased(KeyBindingReleaseEvent<CatchAction> _)
}
}
}
public enum TouchCatchAction
{
MoveLeft = 0,
MoveRight = 1,
DashLeft = 2,
DashRight = 3,
None = 4
}
}
}