continuation of implementing ECS

This commit is contained in:
2025-09-07 09:54:18 +02:00
parent 94ca0f046a
commit 161a166141
3 changed files with 22 additions and 12 deletions

View File

@ -0,0 +1,11 @@
namespace EngineSharp.Core.ECS;
// Maybe look at this C# ECS to get an idea of how to implement one myself
// https://github.com/friflo/Friflo.Engine.ECS/tree/main
public struct Entity
{
public readonly long Id;
private List<LogicComponent> _logicComponents;
}

View File

@ -1,12 +0,0 @@
namespace EngineSharp.Core.ECS;
// TODO: A GameObject would have a list of Components. A GameObject is basically what will be stored in the scene graph and all components of all GameObjects will have their Update methods etc. be called
// Maybe look at this C# ECS to get an idea of how to implement one myself
// https://github.com/friflo/Friflo.Engine.ECS/tree/main
public abstract class GameObject
{
private long Id { get; set; }
public abstract void OnUpdate(double deltaTime);
}

View File

@ -0,0 +1,11 @@
namespace EngineSharp.Core.ECS;
// TODO: A LogicComponent would have a list of Components. A LogicComponent is basically what will be stored in the scene graph and all components of all LogicComponents will have their Update methods etc. be called
public abstract class LogicComponent
{
internal Entity _entity; // the entity this component belongs to
public abstract void Start();
public abstract void OnUpdate(double deltaTime);
}