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"
12 struct ComponentRawMutView;
29 decltype(
auto)
mut() {
33 const auto row = (uint16_t)(
m_row * (actual_type_t<T>::Kind == EntityKind::EK_Gen));
41 template <typename T, typename U = typename actual_type_t<T>::Type>
46 smut<T>() = GAIA_FWD(value);
48 chunk.template modify<T, true>();
49 world_notify_on_set(chunk.world(), chunk.template comp_entity<T>(), chunk,
m_row, (uint16_t)(
m_row + 1));
77 const auto row = (uint16_t)(
m_row * (actual_type_t<T>::Kind == EntityKind::EK_Gen));
85 template <typename T, typename U = typename actual_type_t<T>::Type>
90 smut<T>() = GAIA_FWD(value);
106 template <
typename T>
Fixed-capacity archetype storage unit holding entities and their component columns.
Definition chunk.h:36
Entity-scoped component accessor bound to a specific world, chunk and row. It is not a standalone chu...
Definition component_getter.h:16
const Chunk * m_pChunk
Chunk containing the entity's table-backed data.
Definition component_getter.h:20
Entity m_entity
Entity whose components are accessed.
Definition component_getter.h:22
const World * m_pWorld
World used to resolve inherited and sparse component data.
Definition component_getter.h:18
ComponentGetter(const World &world, const Chunk *pChunk, Entity entity, uint16_t row)
Creates an accessor for one entity row.
Definition component_getter.h:31
uint16_t m_row
Entity row within the chunk.
Definition component_getter.h:24
Non-owning mutable view over raw component bytes on an entity.
Definition component_cursor.h:64
Entity-scoped mutable component accessor bound to a specific world, chunk and row....
Definition component_setter.h:16
decltype(auto) mut()
Returns a mutable reference to component without triggering hooks, observers or world-version updates...
Definition component_setter.h:29
GAIA_NODISCARD ComponentRawMutView mut_raw(Entity component)
Returns a mutable raw byte view for a runtime component without finishing the write....
Definition world.h:15209
GAIA_NODISCARD ComponentRawMutView mut_raw_field(Entity component, uint32_t fieldIdx)
Returns one mutable SoA field value without finishing the component write. Pair with modify_raw(compo...
Definition world.h:15215
ComponentSetter & set(U &&value)
Sets the value of the component.
Definition component_setter.h:42
decltype(auto) smut()
Returns a mutable reference to component without triggering a world version update.
Definition component_setter.h:73
ComponentSetter & modify_raw(Entity component)
Marks a raw payload or SoA field returned by a mutable raw view as modified.
Definition world.h:15230
ComponentSetter & sset(U &&value)
Sets the value of the component without triggering a world version update.
Definition component_setter.h:86
ComponentSetter & set_raw(Entity component, const void *data, uint32_t size)
Replaces a runtime component payload and emits normal post-write set notifications.
Definition world.h:15221
Identifier of an entity or component instance in the world. Packs the entity index,...
Definition id.h:296