🐛 removed stub code and unused signal from FarmingControls2D
This commit is contained in:
@@ -19,7 +19,6 @@ public partial class FarmingControls2D : Node2D
|
||||
private int _toolId = -1;
|
||||
private bool _wateringCanFilled = false;
|
||||
|
||||
[Signal] public delegate void FieldCreatedEventHandler();
|
||||
|
||||
#region Tools
|
||||
|
||||
@@ -50,18 +49,7 @@ public partial class FarmingControls2D : Node2D
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public override void _Input(InputEvent @event)
|
||||
{
|
||||
if (@event.IsActionPressed("click"))
|
||||
{
|
||||
if ( _toolId == 0)
|
||||
{
|
||||
Vector2I adjustedPosition = GetAdjustedMousePosition();
|
||||
MakeField(adjustedPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Vector2I GetAdjustedMousePosition()
|
||||
{
|
||||
@@ -87,13 +75,4 @@ public partial class FarmingControls2D : Node2D
|
||||
|
||||
#endregion
|
||||
|
||||
#region FIELD CREATION
|
||||
private void MakeField(Vector2I mousePosition)
|
||||
{
|
||||
int potentialFieldIndex = FieldService.Instance.PositionToIndex(mousePosition);
|
||||
if(FieldService.Instance.TryGet(_sceneKeyProvider.Payload.AsString(), potentialFieldIndex) == null)
|
||||
EmitSignal(SignalName.FieldCreated);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -13,6 +13,8 @@ public partial class FieldActivator : Node
|
||||
|
||||
private bool _used = false;
|
||||
private bool _rakeInHand;
|
||||
|
||||
[Signal] public delegate void FieldCreatedEventHandler();
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
@@ -28,6 +30,7 @@ public partial class FieldActivator : Node
|
||||
{
|
||||
_field.Visible = true;
|
||||
_field.UpdateFieldState(FieldState.Tilled);
|
||||
EmitSignal(SignalName.FieldCreated, _field);
|
||||
_used = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,12 +85,6 @@ public partial class FieldService : Node
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int PositionToIndex(Vector2 position)
|
||||
{
|
||||
// some awesome code here
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
internal class FieldsInScene
|
||||
|
||||
Reference in New Issue
Block a user