23 flecs::entity_t e = ECS_PAIR_FIRST(id_);
32 flecs::entity_t e = ECS_PAIR_SECOND(id_);
46 ecs_assert((id_ & ECS_ID_FLAGS_MASK) ==
flags, ECS_INVALID_PARAMETER, NULL);
74template <
typename ... Args>
75inline flecs::id world::id(Args&&... args)
const {
76 return flecs::id(world_, FLECS_FWD(args)...);
79template <
typename First,
typename Second>
84 _::type<First>::id(world_),
85 _::type<Second>::id(world_)));
88template <
typename First>
90 ecs_assert(!ECS_IS_PAIR(o), ECS_INVALID_PARAMETER,
91 "cannot create nested pairs");
96 _::type<First>::id(world_),
101 ecs_assert(!ECS_IS_PAIR(r) && !ECS_IS_PAIR(o), ECS_INVALID_PARAMETER,
102 "cannot create nested pairs");
#define ecs_assert(condition, error_code,...)
Assert.
ecs_entity_t ecs_get_typeid(const ecs_world_t *world, ecs_id_t id)
Get the type for an id.
ecs_entity_t ecs_get_alive(const ecs_world_t *world, ecs_entity_t e)
Get alive identifier.
Class that wraps around a flecs::id_t.
bool is_pair() const
Test if id is pair (has first, second)
flecs::entity entity() const
Return id as entity (only allowed when id is valid entity)
flecs::entity flags() const
Return id flags set on id.
flecs::entity remove_flags() const
Return id without role.
flecs::entity type_id() const
Return component type of id.
flecs::entity add_flags(flecs::id_t flags) const
Return id with role added.
flecs::entity second() const
Get second element from a pair.
flecs::entity first() const
Get first element from a pair.
flecs::entity remove_generation() const
Return id without role.
flecs::id pair() const
Get pair id from relationship, object.