8#define ECS_EVENT_DESC_ID_COUNT_MAX (8)
18template <
typename Base,
typename E>
32 ids_.
array = ids_array_;
43 template <
typename First,
typename Second>
55 template <
typename First>
66 return id(ecs_pair(first, second));
74 template <typename Enum, if_t<is_enum<Enum>::value> = 0>
76 const auto& et = enum_type<Enum>(this->world_);
78 return id(et.entity(), target);
83 ids_.
array = ids_array_;
117 ids_.
array = ids_array_;
125 ids_.
array = ids_array_;
135 flecs::id_t ids_array_[ECS_EVENT_DESC_ID_COUNT_MAX];
139 return *
static_cast<Base*
>(
this);
145 using event_builder_base::event_builder_base;
165 this->desc_.
param = &ptr;
ecs_table_t table_t
Table type.
ecs_entity_t entity_t
Entity type.
ecs_world_t world_t
World type.
void ecs_emit(ecs_world_t *world, ecs_event_desc_t *desc)
Send an event.
void ecs_enqueue(ecs_world_t *world, ecs_event_desc_t *desc)
Enqueue an event.
const ecs_world_t * ecs_get_world(const ecs_poly_t *poly)
Get the world from a poly.
Component added to enum type entities.
ecs_entity_t entity
Single-entity alternative to setting table / offset / count.
const void * const_param
Same as param, but with the guarantee that the value won't be modified.
ecs_table_t * table
The table for which to notify.
int32_t count
Limit number of notified entities to count.
int32_t offset
Limit notified entities to ones starting from offset (row) in table.
const ecs_type_t * ids
Component IDs.
ecs_poly_t * observable
Observable (usually the world).
ecs_entity_t event
The event ID.
void * param
Optional context.
A type is a list of (component) IDs.
ecs_id_t * array
Array with IDs.
int32_t count
Number of elements in array.
void enqueue()
Enqueue the event.
Base & id(Enum value)
Add an enum constant to emit for.
Base & ctx(E *ptr)
Set event data (mutable).
Base & id()
Add a component to emit for.
Base & id(flecs::id_t id)
Add a (component) ID to emit for.
Base & entity(flecs::entity_t e)
Set the entity for which to emit the event.
Base & id(entity_t first, entity_t second)
Add a pair to emit for.
void emit()
Emit the event.
Base & id(entity_t second)
Add a pair to emit for.
Base & table(flecs::table_t *t, int32_t offset=0, int32_t count=0)
Set the table for which to emit the event.
Base & id()
Add a pair to emit for.
Base & ctx(const E *ptr)
Set event data (const).
Class & ctx(const E &ptr)
Set event data (const reference).
Class & ctx(E &&ptr)
Set event data (rvalue reference).