Refactor game state management to use a unified Stat system and update UI labels for production and corruption
This commit is contained in:
17
Scripts/Core/StatData.cs
Normal file
17
Scripts/Core/StatData.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace ParasiticGod.Scripts.Core;
|
||||
|
||||
public class StatData
|
||||
{
|
||||
public double Value { get; private set; }
|
||||
public event Action<double> OnChanged;
|
||||
|
||||
public void Set(double value)
|
||||
{
|
||||
if (!(Math.Abs(Value - value) > 0.001)) return;
|
||||
|
||||
Value = value;
|
||||
OnChanged?.Invoke(Value);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user