Function ecs_get_typeid

Synopsis

#include <include/flecs.h>

FLECS_API ecs_entity_t ecs_get_typeid(const ecs_world_t *world, ecs_id_t id)

Description

Get the type for an id. This operation returns the component id for an id, if the id is associated with a type. For a regular component with a non-zero size (an entity with the EcsComponent component) the operation will return the entity itself.

For an entity that does not have the EcsComponent component, or with an EcsComponent value with size 0, the operation will return 0.

For a pair id the operation will return the type associated with the pair, by applying the following rules in order:

  • The first pair element is returned if it is a component
  • 0 is returned if the relationship entity has the Tag property
  • The second pair element is returned if it is a component
  • 0 is returned.
Parameters

world - The world.

id - The id.

Returns
The type id of the id.

Source

Line 2318 in include/flecs.h.