cubos::core::ecs::Observers class

Stores and manages all of the observers associated with a world.

Public functions

auto notifyAdd(CommandBuffer& commandBuffer, Entity entity, ColumnId column) -> bool
Notifies that the given entity has a new column.
auto notifyRemove(CommandBuffer& commandBuffer, Entity entity, ColumnId column) -> bool
Notifies that the given entity has lost a column.
auto notifyDestroy(CommandBuffer& commandBuffer, Entity entity, ColumnId column) -> bool
Notifies was destroyed.
auto hookOnAdd(ColumnId column, System<void> observer) -> ObserverId
Hooks an observer to the addition of a column.
auto hookOnRemove(ColumnId column, System<void> observer) -> ObserverId
Hooks an observer to the removal of a column.
auto hookOnDestroy(ColumnId column, System<void> observer) -> ObserverId
Hooks an observer to the entity destruction.
void unhook(ObserverId id)
Unhooks an observer.

Function documentation

bool cubos::core::ecs::Observers::notifyAdd(CommandBuffer& commandBuffer, Entity entity, ColumnId column)

Notifies that the given entity has a new column.

Parameters
commandBuffer Command buffer to record the any commands emitted by the observer.
entity Entity.
column Column.
Returns Whether an observer was triggered.

bool cubos::core::ecs::Observers::notifyRemove(CommandBuffer& commandBuffer, Entity entity, ColumnId column)

Notifies that the given entity has lost a column.

Parameters
commandBuffer Command buffer to record the any commands emitted by the observer.
entity Entity.
column Column.
Returns Whether an observer was triggered.

bool cubos::core::ecs::Observers::notifyDestroy(CommandBuffer& commandBuffer, Entity entity, ColumnId column)

Notifies was destroyed.

Parameters
commandBuffer Command buffer to record the any commands emitted by the observer.
entity Entity.
column Column.
Returns Whether an observer was triggered.

ObserverId cubos::core::ecs::Observers::hookOnAdd(ColumnId column, System<void> observer)

Hooks an observer to the addition of a column.

Parameters
column Column.
observer Observer system.
Returns Observer identifier.

ObserverId cubos::core::ecs::Observers::hookOnRemove(ColumnId column, System<void> observer)

Hooks an observer to the removal of a column.

Parameters
column Column.
observer Observer system.
Returns Observer identifier.

ObserverId cubos::core::ecs::Observers::hookOnDestroy(ColumnId column, System<void> observer)

Hooks an observer to the entity destruction.

Parameters
column Column.
observer Observer system.
Returns Observer identifier.

void cubos::core::ecs::Observers::unhook(ObserverId id)

Unhooks an observer.

Parameters
id Observer identifier.