Add initial resource and presenter classes for game entities and effects

This commit is contained in:
2025-10-13 12:11:50 +02:00
commit ad3e631d8c
75 changed files with 1423 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using System.Collections.Generic;
using GameCore.ECS;
using Godot;
namespace CryptonymThunder.Code.Autoloads;
public partial class PresenterRegistry : Node
{
private readonly Dictionary<ulong, Entity> _instanceIdToEntity = new();
public void RegisterPresenter(Node presenterNode, Entity entity)
{
_instanceIdToEntity[presenterNode.GetInstanceId()] = entity;
}
public void UnregisterPresenter(Node presenterNode)
{
_instanceIdToEntity.Remove(presenterNode.GetInstanceId());
}
public bool TryGetEntity(ulong instanceId, out Entity entity)
{
return _instanceIdToEntity.TryGetValue(instanceId, out entity);
}
}