28 lines
480 B
C++
28 lines
480 B
C++
#ifndef ECS_H
|
|
#define ECS_H
|
|
|
|
#include "bindings/ruby.h"
|
|
#include "utils.h"
|
|
|
|
struct Entity {
|
|
Vec2<float> position;
|
|
std::unordered_map<std::string, size_t> components;
|
|
};
|
|
|
|
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
|