Flecs v4.0
A fast entity component system (ECS) for C & C++
|
Functions | |
ecs_iter_t | ecs_each_id (const ecs_world_t *world, ecs_id_t id) |
Iterate all entities with specified (component id). | |
bool | ecs_each_next (ecs_iter_t *it) |
Progress an iterator created with ecs_each_id(). | |
ecs_iter_t | ecs_children (const ecs_world_t *world, ecs_entity_t parent) |
Iterate children of parent. | |
bool | ecs_children_next (ecs_iter_t *it) |
Progress an iterator created with ecs_children(). | |
Find all entities that have a single (component) id.
ecs_iter_t ecs_children | ( | const ecs_world_t * | world, |
ecs_entity_t | parent ) |
Iterate children of parent.
Equivalent to:
world | The world. |
parent | The parent. |
bool ecs_children_next | ( | ecs_iter_t * | it | ) |
Progress an iterator created with ecs_children().
it | The iterator. |
ecs_iter_t ecs_each_id | ( | const ecs_world_t * | world, |
ecs_id_t | id ) |
Iterate all entities with specified (component id).
This returns an iterator that yields all entities with a single specified component. This is a much lighter weight operation than creating and iterating a query.
Usage:
If the specified id is a component, it is possible to access the component pointer with ecs_field just like with regular queries:
world | The world. |
id | The (component) id to iterate. |
bool ecs_each_next | ( | ecs_iter_t * | it | ) |
Progress an iterator created with ecs_each_id().
it | The iterator. |