8#define ECS_EVENT_DESC_ID_COUNT_MAX (8)
18template <
typename Base,
typename E>
32 m_ids.array = m_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));
70 Base&
id(flecs::id_t
id) {
71 m_ids.array = m_ids_array;
72 m_ids.array[m_ids.count] =
id;
84 Base&
table(flecs::table_t *t, int32_t offset = 0, int32_t count = 0) {
92 Base& ctx(
const E* ptr) {
93 m_desc.const_param = ptr;
104 m_ids.array = m_ids_array;
111 m_ids.array = m_ids_array;
114 ecs_enqueue(m_world, &m_desc);
118 flecs::world_t *m_world;
121 flecs::id_t m_ids_array[ECS_EVENT_DESC_ID_COUNT_MAX];
125 return *
static_cast<Base*
>(
this);
130 using event_builder_base::event_builder_base;
142 Class& ctx(
const E& ptr) {
143 this->m_desc.const_param = &ptr;
148 Class& ctx(E&& ptr) {
149 this->m_desc.
param = &ptr;
void ecs_emit(ecs_world_t *world, ecs_event_desc_t *desc)
Send event.
const ecs_world_t * ecs_get_world(const ecs_poly_t *poly)
Get world from poly.
ecs_entity_t entity
Single-entity alternative to setting table / offset / count.
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.
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.