Basic ECS setup.

- Added std::variant to pch.h
This commit is contained in:
2026-11-04 09:08:38 +00:00
parent cd8ecb09c0
commit 1eba06f19b
2 changed files with 19 additions and 5 deletions
+18 -5
View File
@@ -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<float> position;
std::unordered_map<std::string, size_t> components;
};
struct EntityPool {
Entity entities[];
struct Component {
enum struct Type {
Int,
Float,
Boolean,
RubyObject
};
std::unordered_map<std::string, std::variant<int64_t, double, bool, Ruby::RubyObject>> globals;
std::vector<std::tuple<std::string, Type, void *>> table;
};
struct System {
Ruby::Block function;
};
#endif