🚧 saving of field parameters as json implemented

This commit is contained in:
2025-11-12 18:46:30 +01:00
parent 5cc65bc3f4
commit 3fcb34c04d
17 changed files with 192 additions and 46 deletions
@@ -9,6 +9,7 @@ namespace Babushka.scripts.CSharp.Common.Farming;
/// </summary>
public partial class PlantBehaviour2D : Node2D
{
[Export] private string _prefabPath;
[Export] private Sprite2D[] _seeds;
[Export] private Sprite2D[] _smallPlants;
[Export] private Sprite2D[] _bigPlants;
@@ -24,6 +25,12 @@ public partial class PlantBehaviour2D : Node2D
private bool _magicWordSaid = false;
private bool _calledOnReady = false;
public PlantState State => _state;
public int DaysGrowing { get; set; }
public string PrefabPath => _prefabPath;
/// <summary>
/// public accessor for the field reference
/// </summary>
@@ -35,7 +42,6 @@ public partial class PlantBehaviour2D : Node2D
public override void _Ready()
{
GD.Print($"Ready: {Name}");
if (_state == PlantState.None)
{
_state = PlantState.Planted;
@@ -44,7 +50,6 @@ public partial class PlantBehaviour2D : Node2D
}
else
{
GD.Print("plant state not none.");
_calledOnReady = true;
GrowPlant();
}