Flecs v3.2
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
Has, Owns, Shares
Collaboration diagram for 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,
T )    ecs_has_id(world, entity, ecs_id(T))

Definition at line 523 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 526 of file flecs_c.h.

◆ ecs_owns

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

Definition at line 532 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 529 of file flecs_c.h.

◆ ecs_shares

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

Definition at line 542 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 535 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 539 of file flecs_c.h.