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>
56 Base&
id(entity_t second) {
65 Base&
id(entity_t first, entity_t second) {
66 return id(ecs_pair(first, second));
69 template <typename Enum, if_t<is_enum<Enum>::value> = 0>
71 const auto& et = enum_type<Enum>(this->world_);
72 flecs::entity_t target = et.entity(value);
73 return id(et.entity(), target);
77 Base&
id(flecs::id_t
id) {
78 ids_.
array = ids_array_;
91 Base&
table(flecs::table_t *t, int32_t offset = 0, int32_t count = 0) {
99 Base& ctx(
const E* ptr) {
111 ids_.
array = ids_array_;
118 ids_.
array = ids_array_;
125 flecs::world_t *world_;
128 flecs::id_t ids_array_[ECS_EVENT_DESC_ID_COUNT_MAX];
132 return *
static_cast<Base*
>(
this);
137 using event_builder_base::event_builder_base;
149 Class& ctx(
const E& ptr) {
155 Class& ctx(E&& ptr) {
156 this->desc_.
param = &ptr;
void ecs_emit(ecs_world_t *world, ecs_event_desc_t *desc)
Send event.
void ecs_enqueue(ecs_world_t *world, ecs_event_desc_t *desc)
Enqueue event.
const ecs_world_t * ecs_get_world(const ecs_poly_t *poly)
Get world from 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.
Base & id()
Add component to emit for.
Base & id(flecs::id_t id)
Add (component) id to emit for.
Base & entity(flecs::entity_t e)
Set entity for which to emit event.
Base & id(entity_t first, entity_t second)
Add pair to emit for.
Base & id(entity_t second)
Add pair to emit for.
Base & id()
Add pair to emit for.