16template<
typename Base,
typename ... Components>
33 desc_->
events[event_count_ ++] = evt;
54 desc_->flags_ |= flags;
59 Base&
ctx(
void *ptr) {
71 virtual flecs::world_t* world_v()
override = 0;
75 return *
static_cast<Base*
>(
this);
void(* ecs_iter_action_t)(ecs_iter_t *it)
Function prototype for iterables.
Used with ecs_observer_init().
ecs_entity_t events[(8)]
Events to observe (OnAdd, OnRemove, OnSet)
void * ctx
User context to pass to callback.
ecs_query_desc_t query
Query for observer.
bool yield_existing
When observer is created, generate events from existing data.
ecs_run_action_t run
Callback invoked on an event.
Observer builder interface.
Base & event()
Specify the event(s) for when the observer should run.
Base & ctx(void *ptr)
Set observer context.
Base & yield_existing(bool value=true)
Invoke observer for anything that matches its query on creation.
Base & run(ecs_iter_action_t action)
Set observer run callback.
Base & event(entity_t evt)
Specify the event(s) for when the observer should run.
Base & observer_flags(ecs_flags32_t flags)
Set observer flags.