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
@@ -1,16 +1,14 @@
using Babushka.scripts.CSharp.GameEntity.Types;
using Godot;
using Godot;
using Godot.Collections;
using Entity = Babushka.scripts.CSharp.GameEntity.Entities.Entity;
namespace Babushka.scripts.CSharp.GameEntity.Management;
public partial class EntityNodeCreator : Node
{
[Export] private Dictionary<EntityType, PackedScene> _entityPrefabs;
[Export] private Dictionary<string, PackedScene> _entityPrefabs;
public T Create<T>(EntityType type) where T:Entity
public Node2D CreateNode2D(string type)
{
return _entityPrefabs[type].Instantiate<T>();
return _entityPrefabs[type].Instantiate<Node2D>();
}
}