Initial commit
This commit is contained in:
commit
c266d22f58
85 changed files with 1649 additions and 0 deletions
24
scripts/components/level/PoolContainer.cs
Normal file
24
scripts/components/level/PoolContainer.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
//
|
||||
// PoolContainer contains nodes that contain different elemnts that generate during runtime
|
||||
// Is not pool in traditional sense, but named like that to prevent repetition
|
||||
//
|
||||
|
||||
public partial class PoolContainer : Node
|
||||
{
|
||||
[Export]
|
||||
public Node Zombies { get; private set; }
|
||||
[Export]
|
||||
public Node Plants { get; private set; }
|
||||
[Export]
|
||||
public Node Projectiles { get; private set; }
|
||||
[Export]
|
||||
public Node Structures { get; private set; }
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
LevelController.Instance.Pools = this;
|
||||
}
|
||||
}
|
||||
33
scripts/components/level/RuntimeLevelData.cs
Normal file
33
scripts/components/level/RuntimeLevelData.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
using Godot;
|
||||
//using Godot.Collections;
|
||||
using System;
|
||||
|
||||
public partial class RuntimeLevelData : Node
|
||||
{
|
||||
public int SunCount { get; private set; } = 0;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
LevelController.Instance.LevelData = this;
|
||||
}
|
||||
|
||||
public void AddSun(int amount)
|
||||
{
|
||||
SunCount += amount;
|
||||
}
|
||||
|
||||
public bool TrySpendSun(int amount)
|
||||
{
|
||||
if (SunCount - amount < 0) return false;
|
||||
|
||||
SunCount -= amount;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//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