Basic ECS setup.
- Added std::variant to pch.h
This commit is contained in:
+18
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user