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.
Babushka/scripts/CSharp/Common/Farming/FieldBehaviour.cs

41 lines
960 B

using Godot;
namespace Babushka.scripts.CSharp.Common.Farming;
public enum FieldState
{
Empty = 0,
Tilled = 1,
Planted = 2,
Watered = 3
}
public partial class FieldBehaviour : Sprite3D
{
[Export] private Texture2D Untilled;
[Export] private Texture2D Tilled;
[Export] private Texture3D Watered;
[Export] private FieldState FieldState = FieldState.Empty;
/// <summary>
/// Called when the player enters the field'S interaction area and presses <E>.
/// </summary>
public void Farm()
{
switch (FieldState)
{
case FieldState.Empty:
Texture = Tilled;
FieldState = FieldState.Tilled;
break;
case FieldState.Tilled:
FieldState = FieldState.Planted;
break;
case FieldState.Planted:
break;
default:
break;
}
}
}