Euphoria
eu::core::ecs::GenericComponentArray< T > Struct Template Reference

#include <ecs.h>

Inheritance diagram for eu::core::ecs::GenericComponentArray< T >:
eu::core::ecs::ComponentArrayBase

Public Member Functions

 GenericComponentArray ()
 
void add (EntityHandle entity, T &&component)
 
T & get (EntityHandle entity)
 
T * get_or_null (EntityHandle entity)
 
bool has_value_for_index (std::size_t index) const
 
void remove (EntityHandle entity) override
 
bool has (EntityHandle entity) const override
 
- Public Member Functions inherited from eu::core::ecs::ComponentArrayBase
 ComponentArrayBase (std::string_view n)
 
virtual ~ComponentArrayBase ()=default
 
 ComponentArrayBase (const ComponentArrayBase &)=delete
 
 ComponentArrayBase (ComponentArrayBase &&)=delete
 
ComponentArrayBaseoperator= (const ComponentArrayBase &)=delete
 
ComponentArrayBaseoperator= (ComponentArrayBase &&)=delete
 

Public Attributes

std::vector< std::optional< T > > components
 
- Public Attributes inherited from eu::core::ecs::ComponentArrayBase
std::string_view name
 

Detailed Description

template<typename T>
struct eu::core::ecs::GenericComponentArray< T >

Definition at line 45 of file ecs.h.

Constructor & Destructor Documentation

◆ GenericComponentArray()

template<typename T >
eu::core::ecs::GenericComponentArray< T >::GenericComponentArray ( )
inline

Definition at line 50 of file ecs.h.

Member Function Documentation

◆ add()

template<typename T >
void eu::core::ecs::GenericComponentArray< T >::add ( EntityHandle  entity,
T &&  component 
)
inline

Definition at line 56 of file ecs.h.

◆ get()

template<typename T >
T& eu::core::ecs::GenericComponentArray< T >::get ( EntityHandle  entity)
inline

Definition at line 68 of file ecs.h.

◆ get_or_null()

template<typename T >
T* eu::core::ecs::GenericComponentArray< T >::get_or_null ( EntityHandle  entity)
inline

Definition at line 77 of file ecs.h.

◆ has()

template<typename T >
bool eu::core::ecs::GenericComponentArray< T >::has ( EntityHandle  entity) const
inlineoverridevirtual

Implements eu::core::ecs::ComponentArrayBase.

Definition at line 118 of file ecs.h.

◆ has_value_for_index()

template<typename T >
bool eu::core::ecs::GenericComponentArray< T >::has_value_for_index ( std::size_t  index) const
inline

Definition at line 93 of file ecs.h.

◆ remove()

template<typename T >
void eu::core::ecs::GenericComponentArray< T >::remove ( EntityHandle  entity)
inlineoverridevirtual

Implements eu::core::ecs::ComponentArrayBase.

Definition at line 104 of file ecs.h.

Member Data Documentation

◆ components

template<typename T >
std::vector<std::optional<T> > eu::core::ecs::GenericComponentArray< T >::components

Definition at line 48 of file ecs.h.


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