Add fields to EWorld class.
This commit is contained in:
+14
-4
@@ -2,6 +2,7 @@
|
|||||||
#define ELEMENTS_H
|
#define ELEMENTS_H
|
||||||
|
|
||||||
#include "bindings/ruby.h"
|
#include "bindings/ruby.h"
|
||||||
|
#include "ecs/ecs.h"
|
||||||
#include "localization/localization.h"
|
#include "localization/localization.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "window/window.h"
|
#include "window/window.h"
|
||||||
@@ -84,14 +85,23 @@ struct ERect : Element {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct EWorld : Element {
|
struct EWorld : Element {
|
||||||
#warning need to implement ecs system first before implementing this
|
EWorld() : Element(Type::WORLD) {}
|
||||||
uint64_t world_id = UINT64_MAX;
|
|
||||||
|
|
||||||
EWorld(uint64_t world_id) : Element(Type::WORLD), world_id(world_id) {}
|
|
||||||
|
|
||||||
Vec2<float> size() override;
|
Vec2<float> size() override;
|
||||||
|
|
||||||
void render(uint64_t) override;
|
void render(uint64_t) override;
|
||||||
|
|
||||||
|
Vec2<float> cam_pos;
|
||||||
|
float cam_rotation = 0;
|
||||||
|
Vec2<float> cam_scale = {1, 1};
|
||||||
|
|
||||||
|
using V = std::variant<int64_t, double, bool, Ruby::RubyObject>;
|
||||||
|
|
||||||
|
void add_component(
|
||||||
|
std::string_view name,
|
||||||
|
std::unordered_map<std::string, Component::Type, V> fields,
|
||||||
|
std::unordered_map<std::string, Component::Type, V> globals
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
inline Pool<Element> element_pool;
|
inline Pool<Element> element_pool;
|
||||||
|
|||||||
Reference in New Issue
Block a user