Add fields to EWorld class.

This commit is contained in:
2026-11-04 09:09:22 +00:00
parent 74557e5647
commit 431ecd31d8
2 changed files with 14 additions and 4 deletions
+14 -4
View File
@@ -2,6 +2,7 @@
#define ELEMENTS_H
#include "bindings/ruby.h"
#include "ecs/ecs.h"
#include "localization/localization.h"
#include "utils.h"
#include "window/window.h"
@@ -84,14 +85,23 @@ struct ERect : Element {
};
struct EWorld : Element {
#warning need to implement ecs system first before implementing this
uint64_t world_id = UINT64_MAX;
EWorld(uint64_t world_id) : Element(Type::WORLD), world_id(world_id) {}
EWorld() : Element(Type::WORLD) {}
Vec2<float> size() 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;
View File