![]() |
Flecs v4.1
A fast entity component system (ECS) for C & C++
|
Functions | |
| ecs_iter_t | ecs_each_id (const ecs_world_t *world, ecs_id_t component) |
| Iterate all entities with a 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 a parent. | |
| ecs_iter_t | ecs_children_w_rel (const ecs_world_t *world, ecs_entity_t relationship, ecs_entity_t parent) |
| Same as ecs_children(), but with a custom relationship argument. | |
| 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 a parent.
This operation is usually equivalent to doing:
The only exception is when the parent has the EcsOrderedChildren trait, in which case this operation will return a single result with the ordered child entity IDs.
This operation is equivalent to doing:
| 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_children_w_rel | ( | const ecs_world_t * | world, |
| ecs_entity_t | relationship, | ||
| ecs_entity_t | parent ) |
Same as ecs_children(), but with a custom relationship argument.
| world | The world. |
| relationship | The relationship. |
| parent | The parent. |
| ecs_iter_t ecs_each_id | ( | const ecs_world_t * | world, |
| ecs_id_t | component ) |
Iterate all entities with a 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. |
| component | The component to iterate. |
| bool ecs_each_next | ( | ecs_iter_t * | it | ) |
Progress an iterator created with ecs_each_id().
| it | The iterator. |