Function ecs_get_alive

Synopsis

#include <include/flecs.h>

FLECS_API ecs_entity_t ecs_get_alive(const ecs_world_t *world, ecs_entity_t e)

Description

Get alive identifier. In some cases an application may need to work with identifiers from which the generation has been stripped. A typical scenario in which this happens is when iterating relationships in an entity type.

For example, when obtaining the parent id from a ChildOf relation, the parent (object part of the pair) will have been stored in a 32 bit value, which cannot store the entity generation. This function can retrieve the identifier with the current generation for that id.

If the provided identifier is not alive, the function will return 0.

Parameters

world - The world.

e - The for which to obtain the current alive entity id.

Returns
The alive entity id if there is one, or 0 if the id is not alive.

Source

Line 1795 in include/flecs.h.