using System; using Godot; namespace Newlon.Components.Level; public partial class RuntimeLevelData : Node { public enum LevelStates { ChooseYourSeeds, Pregame, Game, Win, Loose } [Export] public float SunCount { get; private set; } = 0; public event Action OnLevelStateChanged; public static RuntimeLevelData Instance { get; private set; } private LevelStates _currentState = LevelStates.ChooseYourSeeds; public override void _Ready() { Instance = this; GetTree().Paused = true; } #region Sun public void AddSun(float amount) { SunCount += amount; } public void SpendSun(float amount) { SunCount -= amount; } public bool CheckSpendSun(float amount) { if (SunCount - amount < 0) return false; return true; } #endregion public void SetLevelState(LevelStates state) { OnLevelStateChanged(state); _currentState = state; } //private Array _selectedPlants; //private bool _selected; //public Array GetSelectedPlants(); //public bool TrySelectPlants(Array); //public void ResetSelection(); }