watering can fillstate is saving and loading

This commit is contained in:
2025-12-03 17:04:38 +01:00
parent c288af296c
commit 0ecae5a4d9
6 changed files with 109 additions and 34 deletions
@@ -29,6 +29,7 @@ public static class WateringCanState
public delegate void WateringCanDelegate(bool state);
public static event WateringCanDelegate WateringCanActiveStateChanged;
public static event Action? OnWater;
public static event Action? OnFill;
@@ -38,6 +39,7 @@ public static class WateringCanState
public static void Fill()
{
_fillstate = MAX_FILLSTATE;
OnFill?.Invoke();
}
/// <summary>
@@ -69,6 +71,15 @@ public static class WateringCanState
return _fillstate;
}
/// <summary>
/// Public setter. Used for saving and loading.
/// </summary>
/// <param name="fillstate"></param>
public static void SetFillState(int fillstate)
{
_fillstate = fillstate;
}
/// <summary>
/// Sets the Active state of the watering can, i.e. if it is currently in hand and if the ui should be active.
/// </summary>