2#include "gaia/config/config.h"
6#include "gaia/ecs/chunk.h"
7#include "gaia/ecs/component.h"
8#include "gaia/ecs/component_getter.h"
15 using ComponentGetter::ComponentGetter;
22 decltype(
auto)
mut() {
23 GAIA_ASSERT(m_pWorld !=
nullptr);
24 GAIA_ASSERT(m_entity != EntityBad);
25 GAIA_ASSERT(m_pChunk !=
nullptr);
26 return const_cast<Chunk*
>(m_pChunk)->
template sset<T>(m_row);
33 template <typename T, typename U = typename actual_type_t<T>::Type>
35 GAIA_ASSERT(m_pWorld !=
nullptr);
36 GAIA_ASSERT(m_entity != EntityBad);
37 GAIA_ASSERT(m_pChunk !=
nullptr);
38 smut<T>() = GAIA_FWD(value);
39 auto& chunk = *
const_cast<Chunk*
>(m_pChunk);
40 chunk.template modify<T, true>();
41 world_notify_on_set(chunk.world(), chunk.template comp_entity<T>(), chunk, m_row, (uint16_t)(m_row + 1));
65 GAIA_ASSERT(m_pWorld !=
nullptr);
66 GAIA_ASSERT(m_entity != EntityBad);
67 GAIA_ASSERT(m_pChunk !=
nullptr);
68 return const_cast<Chunk*
>(m_pChunk)->
template sset<T>(m_row);
75 template <typename T, typename U = typename actual_type_t<T>::Type>
77 GAIA_ASSERT(m_pWorld !=
nullptr);
78 GAIA_ASSERT(m_entity != EntityBad);
79 GAIA_ASSERT(m_pChunk !=
nullptr);
80 smut<T>() = GAIA_FWD(value);
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
Entity-scoped mutable component accessor bound to a specific world, chunk and row....
Definition component_setter.h:14
decltype(auto) mut()
Returns a mutable reference to component without triggering hooks, observers or world-version updates...
Definition component_setter.h:22
ComponentSetter & set(U &&value)
Sets the value of the component.
Definition component_setter.h:34
decltype(auto) smut()
Returns a mutable reference to component without triggering a world version update.
Definition component_setter.h:64
ComponentSetter & sset(U &&value)
Sets the value of the component without triggering a world version update.
Definition component_setter.h:76