You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
861 B
37 lines
861 B
using Godot;
|
|
|
|
namespace Babushka.scripts.CSharp.Common.Farming;
|
|
|
|
public partial class VesnaBehaviour2D : Node
|
|
{
|
|
[ExportGroup("Farming")]
|
|
[Export] private FieldService2D _fieldParent;
|
|
[Export] private FarmingControls2D _farmingControls;
|
|
|
|
[Signal] public delegate void ToolPickupEventHandler(bool success);
|
|
|
|
public override void _Ready()
|
|
{
|
|
_farmingControls.FieldParent = _fieldParent;
|
|
}
|
|
|
|
#region Farming
|
|
|
|
public void ActivateHoe(bool activate)
|
|
{
|
|
ActivateTool(activate, 0);
|
|
}
|
|
|
|
public void ActivateWateringCan(bool activate)
|
|
{
|
|
ActivateTool(activate, 1);
|
|
}
|
|
|
|
private void ActivateTool(bool activate , int toolId)
|
|
{
|
|
bool activated = _farmingControls.ActivateTool(activate, toolId);
|
|
EmitSignal(SignalName.ToolPickup, activated);
|
|
}
|
|
|
|
#endregion
|
|
} |