![]() |
Flecs v4.1
A fast entity component system (ECS) for C & C++
|
Entity id range management. More...
Classes | |
| struct | ecs_entity_range_t |
| Type that stores an entity id range. More... | |
Typedefs | |
| typedef struct ecs_entity_range_t | ecs_entity_range_t |
| Type that stores an entity id range. | |
Functions | |
| FLECS_API const ecs_entity_range_t * | ecs_entity_range_new (ecs_world_t *world, uint32_t min, uint32_t max) |
| Create a new entity range. | |
| FLECS_API void | ecs_entity_range_set (ecs_world_t *world, const ecs_entity_range_t *range) |
| Set the active entity range. | |
| FLECS_API const ecs_entity_range_t * | ecs_entity_range_get (const ecs_world_t *world) |
| Get the currently active entity id range. | |
Entity id range management.
| typedef struct ecs_entity_range_t ecs_entity_range_t |
Type that stores an entity id range.
Returned by ecs_entity_range_new(), used with ecs_entity_range_set().
| FLECS_API const ecs_entity_range_t * ecs_entity_range_get | ( | const ecs_world_t * | world | ) |
Get the currently active entity id range.
Returns the range set by ecs_entity_range_set(), or NULL if no range is active.
| world | The world. |
| FLECS_API const ecs_entity_range_t * ecs_entity_range_new | ( | ecs_world_t * | world, |
| uint32_t | min, | ||
| uint32_t | max ) |
Create a new entity range.
This function creates a range that constrains new entity identifiers returned by the specified [min, max] interval. Each range maintains its own list of recycled entity ids, which ensures that recycled ids always respect the configured range. If max is set to 0, the range is unbounded.
Entity ranges cannot be deleted once created. Use ecs_entity_range_set() to activate a range.
| world | The world. |
| min | The first entity id in the range (inclusive). |
| max | The last entity id in the range (inclusive, 0 = unlimited). |
| FLECS_API void ecs_entity_range_set | ( | ecs_world_t * | world, |
| const ecs_entity_range_t * | range ) |
Set the active entity range.
This function activates a range created with ecs_entity_range_new(). When a range is activated, new entity identifiers will fall within the specified [min, max] interval, including recycled identifiers.
When the active range is out of available ids, operations that create new entity ids will assert.
The operation only accepts ranges that have been created by ecs_entity_range_new().
| world | The world. |
| range | The range to activate. |