galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
Registry.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_CORE_REGISTRY_HPP_
9#define GALAXY_CORE_REGISTRY_HPP_
10
11#include <entt/entity/registry.hpp>
12
13namespace galaxy
14{
15 namespace core
16 {
20 class Registry final
21 {
25 // using B2BodyConstruction = meta::vector<std::pair<components::RigidBody*, components::Transform*>>;
26
27 public:
31 Registry();
32
37
42
46 ~Registry();
47
53 [[maybe_unused]]
54 entt::entity create();
55
56 /*///
63 [[maybe_unused]]
64 entt::entity create_from_prefab(const std::string& name);*/
65
73 [[nodiscard]]
74 bool is_valid(const entt::entity entity);
75
76 /*///
83 void update(b2World& b2World);*/
84
88 void clear();
89
90 private:
94 Registry(const Registry&) = delete;
95
99 Registry& operator=(const Registry&) = delete;
100
101 /*///
107 void construct_rigidbody(entt::registry& registry, entt::entity entity);
108
115 void destroy_rigidbody(entt::registry& registry, entt::entity entity);
116
123 void construct_script(entt::registry& registry, entt::entity entity);
124
131 void destruct_script(entt::registry& registry, entt::entity entity);
132
139 void construct_nui(entt::registry& registry, entt::entity entity);
140
147 void destruct_nui(entt::registry& registry, entt::entity entity);*/
148
155 void enable_entity(entt::registry& registry, entt::entity entity);
156
163 void disable_entity(entt::registry& registry, entt::entity entity);
164
165 public:
169 entt::registry m_entt;
170
171 private:
175 // B2BodyConstruction m_bodies_to_construct;
176 };
177 } // namespace core
178} // namespace galaxy
179
180#endif
Wrapper around entt::registry to expand functionality.
Definition Registry.hpp:21
void clear()
Clear any pending data.
Definition Registry.cpp:124
Registry & operator=(Registry &&)
Move assignment operator.
Definition Registry.cpp:37
void disable_entity(entt::registry &registry, entt::entity entity)
Function that runs when an entity is disabled.
Definition Registry.cpp:271
entt::entity create()
Create an entity with some default components.
Definition Registry.cpp:52
~Registry()
Destructor.
Definition Registry.cpp:48
Registry & operator=(const Registry &)=delete
Copy assignment operator.
void enable_entity(entt::registry &registry, entt::entity entity)
Function that runs when an entity is enabled.
Definition Registry.cpp:262
Registry()
Typedef for creating b2 bodies from components.
Definition Registry.cpp:20
Registry(const Registry &)=delete
Copy constructor.
entt::registry m_entt
Scene entities.
Definition Registry.hpp:169
bool is_valid(const entt::entity entity)
Validate an entity to make sure all components have met their requirements as defined by register_dep...
Definition Registry.cpp:78
Timer.hpp galaxy.
Definition Async.hpp:17