Euphoria
eu::core::ecs::Registry Struct Reference

#include <ecs.h>

Public Member Functions

 Registry ()
 
 ~Registry ()
 
 Registry (const Registry &)=delete
 
 Registry (Registry &&)=delete
 
Registryoperator= (const Registry &)=delete
 
Registryoperator= (Registry &&)=delete
 
EntityHandle create ()
 
void destroy (EntityHandle entity)
 
ComponentIndex set_component_array (const std::string &name, std::unique_ptr< ComponentArrayBase > &&components)
 
template<typename T >
ComponentIndex register_component (const std::string &name)
 
template<typename T >
void add_component (EntityHandle entity, ComponentIndex comp_ind, T &&component)
 
template<typename T >
void remove_component (EntityHandle entity, ComponentIndex comp_ind)
 
template<typename T >
T & get_component (EntityHandle entity, ComponentIndex comp_ind)
 
template<typename T >
T * get_component_or_null (EntityHandle entity, ComponentIndex comp_ind)
 
std::string get_component_debug_name (ComponentIndex c) const
 
bool has_component (EntityHandle entity, ComponentIndex comp_ind) const
 
std::vector< EntityHandleview (const std::vector< ComponentIndex > &matching_components) const
 
int get_number_of_active_entities () const
 

Detailed Description

Definition at line 132 of file ecs.h.

Constructor & Destructor Documentation

◆ Registry() [1/3]

eu::core::ecs::Registry::Registry ( )

Definition at line 225 of file ecs.cc.

◆ ~Registry()

eu::core::ecs::Registry::~Registry ( )

Definition at line 230 of file ecs.cc.

◆ Registry() [2/3]

eu::core::ecs::Registry::Registry ( const Registry )
delete

◆ Registry() [3/3]

eu::core::ecs::Registry::Registry ( Registry &&  )
delete

Member Function Documentation

◆ add_component()

template<typename T >
void eu::core::ecs::Registry::add_component ( EntityHandle  entity,
ComponentIndex  comp_ind,
T &&  component 
)
inline

Definition at line 155 of file ecs.h.

◆ create()

EntityHandle eu::core::ecs::Registry::create ( )

Definition at line 241 of file ecs.cc.

◆ destroy()

void eu::core::ecs::Registry::destroy ( EntityHandle  entity)

Definition at line 252 of file ecs.cc.

◆ get_component()

template<typename T >
T& eu::core::ecs::Registry::get_component ( EntityHandle  entity,
ComponentIndex  comp_ind 
)
inline

Definition at line 171 of file ecs.h.

◆ get_component_debug_name()

std::string eu::core::ecs::Registry::get_component_debug_name ( ComponentIndex  c) const

Definition at line 247 of file ecs.cc.

◆ get_component_or_null()

template<typename T >
T* eu::core::ecs::Registry::get_component_or_null ( EntityHandle  entity,
ComponentIndex  comp_ind 
)
inline

Definition at line 177 of file ecs.h.

◆ get_number_of_active_entities()

int eu::core::ecs::Registry::get_number_of_active_entities ( ) const

Definition at line 236 of file ecs.cc.

◆ has_component()

bool eu::core::ecs::Registry::has_component ( EntityHandle  entity,
ComponentIndex  comp_ind 
) const

Definition at line 258 of file ecs.cc.

◆ operator=() [1/2]

Registry& eu::core::ecs::Registry::operator= ( const Registry )
delete

◆ operator=() [2/2]

Registry& eu::core::ecs::Registry::operator= ( Registry &&  )
delete

◆ register_component()

template<typename T >
ComponentIndex eu::core::ecs::Registry::register_component ( const std::string &  name)
inline

Definition at line 148 of file ecs.h.

◆ remove_component()

template<typename T >
void eu::core::ecs::Registry::remove_component ( EntityHandle  entity,
ComponentIndex  comp_ind 
)
inline

Definition at line 163 of file ecs.h.

◆ set_component_array()

ComponentIndex eu::core::ecs::Registry::set_component_array ( const std::string &  name,
std::unique_ptr< ComponentArrayBase > &&  components 
)

Definition at line 263 of file ecs.cc.

◆ view()

std::vector< EntityHandle > eu::core::ecs::Registry::view ( const std::vector< ComponentIndex > &  matching_components) const

Definition at line 279 of file ecs.cc.


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