Flecs v3.2
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
Has, Owns, Shares

Macros

#define ecs_has(world, entity, T)    ecs_has_id(world, entity, ecs_id(T))
 
#define ecs_has_pair(world, entity, first, second)    ecs_has_id(world, entity, ecs_pair(first, second))
 
#define ecs_owns_pair(world, entity, first, second)    ecs_owns_id(world, entity, ecs_pair(first, second))
 
#define ecs_owns(world, entity, T)    ecs_owns_id(world, entity, ecs_id(T))
 
#define ecs_shares_id(world, entity, id)
 
#define ecs_shares_pair(world, entity, first, second)    (ecs_shares_id(world, entity, ecs_pair(first, second)))
 
#define ecs_shares(world, entity, T)    (ecs_shares_id(world, entity, ecs_id(T)))
 

Detailed Description

Macro Definition Documentation

◆ ecs_has

#define ecs_has (   world,
  entity,
 
)     ecs_has_id(world, entity, ecs_id(T))

Definition at line 430 of file flecs_c.h.

◆ ecs_has_pair

#define ecs_has_pair (   world,
  entity,
  first,
  second 
)     ecs_has_id(world, entity, ecs_pair(first, second))

Definition at line 433 of file flecs_c.h.

◆ ecs_owns

#define ecs_owns (   world,
  entity,
 
)     ecs_owns_id(world, entity, ecs_id(T))

Definition at line 439 of file flecs_c.h.

◆ ecs_owns_pair

#define ecs_owns_pair (   world,
  entity,
  first,
  second 
)     ecs_owns_id(world, entity, ecs_pair(first, second))

Definition at line 436 of file flecs_c.h.

◆ ecs_shares

#define ecs_shares (   world,
  entity,
 
)     (ecs_shares_id(world, entity, ecs_id(T)))

Definition at line 449 of file flecs_c.h.

◆ ecs_shares_id

#define ecs_shares_id (   world,
  entity,
  id 
)
Value:
(ecs_search_relation(world, ecs_get_table(world, entity), 0, ecs_id(id), \
EcsIsA, 1, 0, 0, 0, 0) != -1)
const ecs_entity_t EcsIsA
Used to express inheritance relationships.
ecs_table_t * ecs_get_table(const ecs_world_t *world, ecs_entity_t entity)
Get the table of an entity.
int32_t ecs_search_relation(const ecs_world_t *world, const ecs_table_t *table, int32_t offset, ecs_id_t id, ecs_entity_t rel, ecs_flags32_t flags, ecs_entity_t *subject_out, ecs_id_t *id_out, struct ecs_table_record_t **tr_out)
Search for component/relationship id in table type starting from an offset.

Definition at line 442 of file flecs_c.h.

◆ ecs_shares_pair

#define ecs_shares_pair (   world,
  entity,
  first,
  second 
)     (ecs_shares_id(world, entity, ecs_pair(first, second)))

Definition at line 446 of file flecs_c.h.