file refactor
This commit is contained in:
parent
da5a3e874b
commit
bffb012a26
175 changed files with 1086 additions and 1107 deletions
|
|
@ -1,61 +0,0 @@
|
|||
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<LevelStates> 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<PlantResource> _selectedPlants;
|
||||
//private bool _selected;
|
||||
//public Array<PlantResource> GetSelectedPlants();
|
||||
//public bool TrySelectPlants(Array<PlantResource>);
|
||||
//public void ResetSelection();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue