diff --git a/src/EngineSharp.Core/EngineSharp.Core/ECS/Entity.cs b/src/EngineSharp.Core/EngineSharp.Core/ECS/Entity.cs new file mode 100644 index 0000000..3d12846 --- /dev/null +++ b/src/EngineSharp.Core/EngineSharp.Core/ECS/Entity.cs @@ -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 _logicComponents; +} \ No newline at end of file diff --git a/src/EngineSharp.Core/EngineSharp.Core/ECS/GameObject.cs b/src/EngineSharp.Core/EngineSharp.Core/ECS/GameObject.cs deleted file mode 100644 index b8dfa71..0000000 --- a/src/EngineSharp.Core/EngineSharp.Core/ECS/GameObject.cs +++ /dev/null @@ -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); -} \ No newline at end of file diff --git a/src/EngineSharp.Core/EngineSharp.Core/ECS/LogicComponent.cs b/src/EngineSharp.Core/EngineSharp.Core/ECS/LogicComponent.cs new file mode 100644 index 0000000..7439bde --- /dev/null +++ b/src/EngineSharp.Core/EngineSharp.Core/ECS/LogicComponent.cs @@ -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); +} \ No newline at end of file