2#include "gaia/config/config.h"
6#include "gaia/ecs/chunk.h"
7#include "gaia/ecs/component.h"
16 const World* m_pWorld;
17 const Chunk* m_pChunk;
22 m_pWorld(&world), m_pChunk(pChunk), m_entity(entity), m_row(row) {}
28 GAIA_NODISCARD
decltype(
auto)
get()
const {
29 GAIA_ASSERT(m_pWorld !=
nullptr);
30 GAIA_ASSERT(m_entity != EntityBad);
31 GAIA_ASSERT(m_pChunk !=
nullptr);
34 if constexpr (entity_kind_v<T> == EntityKind::EK_Gen)
35 return m_pChunk->template get<T>(m_row);
37 return m_pChunk->template get<T>();
44 GAIA_NODISCARD
decltype(
auto)
get(
Entity type)
const;
Checks if endianess was detected correctly at compile-time.
Definition bitset.h:9
Entity-scoped component accessor bound to a specific world, chunk and row. It is not a standalone chu...
Definition component_getter.h:15
GAIA_NODISCARD decltype(auto) get() const
Returns the value stored in the component T on entity.
Definition component_getter.h:28
GAIA_NODISCARD decltype(auto) get(Entity type) const
Returns the value stored in the component associated with type on entity.