First adjustments to the Entity System to make it work with different types

This commit is contained in:
Katharina Ziolkowski
2026-02-03 13:55:13 +01:00
parent 745f54b375
commit bcbc074c86
33 changed files with 12822 additions and 107 deletions
@@ -0,0 +1,23 @@
using Babushka.scripts.CSharp.GameEntity.Management;
using Godot;
namespace Babushka.scripts.CSharp.GameEntity.Entities;
public class TrashEntity : PositionalEntity
{
public override string EntityType => OWN_TYPE_NAME;
public const string OWN_TYPE_NAME = "TrashEntity";
private EntityNodeCreator _creator;
public TrashEntity()
{
}
public override void AddEntity(Node2D parent)
{
if(_creator == null) _creator = EntityManager.Instance.NodeCreator;
var entityNode = _creator.CreateNode2D(EntityType);
parent.AddChild(entityNode);
entityNode.GlobalPosition = position;
}
}