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
galaxy::core::Registry Class Referencefinal

Wrapper around entt::registry to expand functionality. More...

#include <Registry.hpp>

+ Collaboration diagram for galaxy::core::Registry:

Public Member Functions

 Registry ()
 Typedef for creating b2 bodies from components.
 
 Registry (Registry &&)
 Move constructor.
 
Registryoperator= (Registry &&)
 Move assignment operator.
 
 ~Registry ()
 Destructor.
 
entt::entity create ()
 Create an entity with some default components.
 
bool is_valid (const entt::entity entity)
 Validate an entity to make sure all components have met their requirements as defined by register_dependencies().
 
void clear ()
 Clear any pending data.
 

Public Attributes

entt::registry m_entt
 Scene entities.
 

Private Member Functions

 Registry (const Registry &)=delete
 Copy constructor.
 
Registryoperator= (const Registry &)=delete
 Copy assignment operator.
 
void enable_entity (entt::registry &registry, entt::entity entity)
 Function that runs when an entity is enabled.
 
void disable_entity (entt::registry &registry, entt::entity entity)
 Function that runs when an entity is disabled.
 

Detailed Description

Wrapper around entt::registry to expand functionality.

Definition at line 20 of file Registry.hpp.

Constructor & Destructor Documentation

◆ Registry() [1/3]

galaxy::core::Registry::Registry ( )

Typedef for creating b2 bodies from components.

Constructor.

Definition at line 20 of file Registry.cpp.

◆ Registry() [2/3]

galaxy::core::Registry::Registry ( Registry && r)

Move constructor.

Definition at line 31 of file Registry.cpp.

◆ ~Registry()

galaxy::core::Registry::~Registry ( )

Destructor.

Definition at line 48 of file Registry.cpp.

◆ Registry() [3/3]

galaxy::core::Registry::Registry ( const Registry & )
privatedelete

Copy constructor.

Member Function Documentation

◆ operator=() [1/2]

Registry & galaxy::core::Registry::operator= ( Registry && r)

Move assignment operator.

Definition at line 37 of file Registry.cpp.

◆ create()

entt::entity galaxy::core::Registry::create ( )

Create an entity with some default components.

Returns
Created entity, or entt::null if failed.

Definition at line 52 of file Registry.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_valid()

bool galaxy::core::Registry::is_valid ( const entt::entity entity)
nodiscard

Validate an entity to make sure all components have met their requirements as defined by register_dependencies().

Parameters
entityEntity to validate.
Returns
True if entity is valid.

Definition at line 78 of file Registry.cpp.

◆ clear()

void galaxy::core::Registry::clear ( )

Clear any pending data.

Definition at line 124 of file Registry.cpp.

+ Here is the caller graph for this function:

◆ operator=() [2/2]

Registry & galaxy::core::Registry::operator= ( const Registry & )
privatedelete

Copy assignment operator.

◆ enable_entity()

void galaxy::core::Registry::enable_entity ( entt::registry & registry,
entt::entity entity )
private

Function that runs when an entity is enabled.

Parameters
registryRegistry component belongs to.
entityEntity component belongs to.

Definition at line 262 of file Registry.cpp.

◆ disable_entity()

void galaxy::core::Registry::disable_entity ( entt::registry & registry,
entt::entity entity )
private

Function that runs when an entity is disabled.

Parameters
registryRegistry component belongs to.
entityEntity component belongs to.

Definition at line 271 of file Registry.cpp.

Member Data Documentation

◆ m_entt

entt::registry galaxy::core::Registry::m_entt

Scene entities.

Definition at line 169 of file Registry.hpp.


The documentation for this class was generated from the following files: