Gaia-ECS v0.9.3
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::ecs::ComponentGetter Struct Reference

Entity-scoped component accessor bound to a specific world, chunk and row. It is not a standalone chunk view and expects the referenced entity to remain valid. More...

#include <component_getter.h>

+ Inheritance diagram for gaia::ecs::ComponentGetter:

Public Member Functions

 ComponentGetter (const World &world, const Chunk *pChunk, Entity entity, uint16_t row)
 
template<typename T >
GAIA_NODISCARD decltype(auto) get () const
 Returns the value stored in the component T on entity.
 
template<typename T >
GAIA_NODISCARD decltype(auto) get (Entity type) const
 Returns the value stored in the component associated with type on entity.
 
template<typename T >
GAIA_NODISCARD decltype(auto) get (Entity type) const
 

Public Attributes

const Worldm_pWorld
 
const Chunkm_pChunk
 
Entity m_entity
 
uint16_t m_row
 

Detailed Description

Entity-scoped component accessor bound to a specific world, chunk and row. It is not a standalone chunk view and expects the referenced entity to remain valid.

Member Function Documentation

◆ get() [1/2]

template<typename T >
GAIA_NODISCARD decltype(auto) gaia::ecs::ComponentGetter::get ( ) const
inline

Returns the value stored in the component T on entity.

Template Parameters
TComponent
Returns
Value stored in the component.

◆ get() [2/2]

template<typename T >
GAIA_NODISCARD decltype(auto) gaia::ecs::ComponentGetter::get ( Entity  type) const

Returns the value stored in the component associated with type on entity.

Template Parameters
TComponent
Parameters
typeEntity associated with the component type

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