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>
|
| | ComponentGetter (const World &world, const Chunk *pChunk, Entity entity, uint16_t row) |
| | Creates an accessor for one entity 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.
|
| |
| GAIA_NODISCARD ComponentRawView | get_raw (Entity component) const |
| | Returns a raw byte view for a runtime component on this entity.
|
| |
| GAIA_NODISCARD ComponentRawView | get_raw_field (Entity component, uint32_t fieldIdx) const |
| | Returns one read-only SoA field value for a runtime component on this entity.
|
| |
|
|
const World * | m_pWorld |
| | World used to resolve inherited and sparse component data.
|
| |
|
const Chunk * | m_pChunk |
| | Chunk containing the entity's table-backed data.
|
| |
|
Entity | m_entity |
| | Entity whose components are accessed.
|
| |
|
uint16_t | m_row |
| | Entity row within the chunk.
|
| |
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.
◆ ComponentGetter()
| gaia::ecs::ComponentGetter::ComponentGetter |
( |
const World & |
world, |
|
|
const Chunk * |
pChunk, |
|
|
Entity |
entity, |
|
|
uint16_t |
row |
|
) |
| |
|
inline |
Creates an accessor for one entity row.
- Parameters
-
| world | World that owns the entity. |
| pChunk | Chunk containing the entity row. |
| entity | Entity being accessed. |
| row | Entity row within pChunk. |
◆ 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
-
- 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
-
- Parameters
-
| type | Entity associated with the component type |
- Returns
- Value stored in the selected component.
◆ get_raw()
Returns a raw byte view for a runtime component on this entity.
- Parameters
-
| component | Runtime component entity. |
- Returns
- Raw payload view, or an invalid view when unavailable.
◆ get_raw_field()
Returns one read-only SoA field value for a runtime component on this entity.
- Parameters
-
| component | Runtime component entity. |
| fieldIdx | SoA field array index. |
- Returns
- Raw field value view, or an invalid view when unavailable.
The documentation for this struct was generated from the following files:
- /home/runner/work/gaia-ecs/gaia-ecs/include/gaia/ecs/component_getter.h
- /home/runner/work/gaia-ecs/gaia-ecs/include/gaia/ecs/world.h