25 lines
592 B
C#
25 lines
592 B
C#
|
|
using Godot;
|
||
|
|
using PositionalEntity = Babushka.scripts.CSharp.GameEntity.Entities.PositionalEntity;
|
||
|
|
|
||
|
|
namespace Babushka.scripts.CSharp.GameEntity.Management;
|
||
|
|
|
||
|
|
public partial class EntitySceneManager : Node2D
|
||
|
|
{
|
||
|
|
[Export] public string sceneName = "none";
|
||
|
|
|
||
|
|
public void AddEntity(PositionalEntity entity)
|
||
|
|
{
|
||
|
|
AddChild(entity);
|
||
|
|
}
|
||
|
|
|
||
|
|
public void RemoveAllEntities()
|
||
|
|
{
|
||
|
|
foreach (var entity in GetChildren())
|
||
|
|
{
|
||
|
|
if (entity is PositionalEntity positionalEntity)
|
||
|
|
{
|
||
|
|
RemoveChild(entity);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|