8#ifndef GALAXY_CORE_REGISTRY_HPP_
9#define GALAXY_CORE_REGISTRY_HPP_
11#include <entt/entity/registry.hpp>
25 using B2BodyConstruction = meta::vector<std::pair<components::RigidBody*, components::Transform*>>;
53 [[maybe_unused]] entt::entity
create();
71 [[nodiscard]]
bool is_valid(
const entt::entity entity);
80 void update(b2World& b2World);
136 void construct_nui(entt::registry& registry, entt::entity entity);
144 void destruct_nui(entt::registry& registry, entt::entity entity);
152 void enable_entity(entt::registry& registry, entt::entity entity);
160 void disable_entity(entt::registry& registry, entt::entity entity);
Wrapper around entt::registry to expand functionality.
void construct_script(entt::registry ®istry, entt::entity entity)
Function that integrates lua init with entt on construct event.
void clear()
Clear any pending data.
Registry & operator=(Registry &&)
Move assignment operator.
void construct_nui(entt::registry ®istry, entt::entity entity)
Function that integrates nuklear init with entt on construct event.
void destruct_nui(entt::registry ®istry, entt::entity entity)
Function that integrates nuklear destroy with entt on destruction event.
void destruct_script(entt::registry ®istry, entt::entity entity)
Function that integrates lua destroy with entt on destruction event.
void disable_entity(entt::registry ®istry, entt::entity entity)
Function that runs when an entity is disabled.
void destroy_rigidbody(entt::registry ®istry, entt::entity entity)
Function that integrates a box2d destruction with entt.
entt::entity create()
Create an entity with some default components.
void construct_rigidbody(entt::registry ®istry, entt::entity entity)
Function that integrates a box2d construction with entt.
meta::vector< std::pair< components::RigidBody *, components::Transform * > > B2BodyConstruction
Typedef for creating b2 bodies from components.
void update(b2World &b2World)
Updates pending component data.
Registry & operator=(const Registry &)=delete
Copy assignment operator.
entt::entity create_from_prefab(const std::string &name)
Create an entity from a prefab.
Registry(const Registry &)=delete
Copy constructor.
void enable_entity(entt::registry ®istry, entt::entity entity)
Function that runs when an entity is enabled.
B2BodyConstruction m_bodies_to_construct
List of rigid bodies that need to be constructed.
entt::registry m_entt
Scene entities.
bool is_valid(const entt::entity entity)
Validate an entity to make sure all components have met their requirements as defined by register_dep...