From 1eba06f19b708900be41f2a361d422b9dd1960ab Mon Sep 17 00:00:00 2001 From: Syed Daanish Date: Wed, 4 Nov 2026 09:08:38 +0000 Subject: [PATCH] Basic ECS setup. - Added std::variant to pch.h --- include/ecs/ecs.h | 23 ++++++++++++++++++----- include/pch.h | 1 + 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/include/ecs/ecs.h b/include/ecs/ecs.h index 136e3b6..bb9815b 100644 --- a/include/ecs/ecs.h +++ b/include/ecs/ecs.h @@ -1,14 +1,27 @@ #ifndef ECS_H #define ECS_H +#include "bindings/ruby.h" #include "utils.h" -struct Entity {}; -struct Component; -struct System; +struct Entity { + Vec2 position; + std::unordered_map components; +}; -struct EntityPool { - Entity entities[]; +struct Component { + enum struct Type { + Int, + Float, + Boolean, + RubyObject + }; + std::unordered_map> globals; + std::vector> table; +}; + +struct System { + Ruby::Block function; }; #endif diff --git a/include/pch.h b/include/pch.h index f8055ce..05468f1 100644 --- a/include/pch.h +++ b/include/pch.h @@ -69,6 +69,7 @@ #include #include #include +#include #include #endif