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;
82 ecs_assert(r !=
nullptr, ECS_INVALID_PARAMETER,
nullptr);
83 ecs_assert(r->table !=
nullptr, ECS_INVALID_PARAMETER,
nullptr);
85 m_desc.
table = r->table;
86 m_desc.
offset = ECS_RECORD_TO_ROW(r->row);
92 Base&
table(flecs::table_t *t, int32_t offset = 0, int32_t count = 0) {
100 Base& ctx(
const E* ptr) {
106 ecs_assert(m_ids.count != 0, ECS_INVALID_PARAMETER, NULL);
108 m_ids.array = m_ids_array;
115 flecs::world_t *m_world;
118 flecs::id_t m_ids_array[ECS_EVENT_DESC_ID_COUNT_MAX];
122 return *
static_cast<Base*
>(
this);
127 using event_builder_base::event_builder_base;
139 Class& ctx(
const E& ptr) {
140 this->m_desc.
param = &ptr;
#define ecs_assert(condition, error_code,...)
Assert.
struct ecs_record_t ecs_record_t
Information about an entity, like its table and row.
void ecs_emit(ecs_world_t *world, ecs_event_desc_t *desc)
Send event.
ecs_record_t * ecs_record_find(const ecs_world_t *world, ecs_entity_t entity)
Find record for entity.
const ecs_world_t * ecs_get_world(const ecs_poly_t *poly)
Get world from poly.
ecs_table_t * table
The table for which to notify.
int32_t count
Limit number of notified entities to count.
const void * param
Optional context.
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.
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.