Flecs v4.1
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches

Misc convenience macros. More...

Collaboration diagram for Misc:

Macros

#define ecs_isa(e)
 Construct an IsA pair.
#define ecs_childof(e)
 Construct a ChildOf pair.
#define ecs_dependson(e)
 Construct a DependsOn pair.
#define ecs_with(e)
 Construct a With pair.
#define ecs_each(world, id)
 Iterate entities with a component.
#define ecs_each_pair(world, r, t)
 Iterate entities with a pair.
#define ecs_each_pair_t(world, R, t)
 Iterate entities with a pair (type-safe first element).

Detailed Description

Misc convenience macros.

Macro Definition Documentation

◆ ecs_childof

#define ecs_childof ( e)
Value:
ecs_pair(EcsChildOf, e)
const ecs_entity_t EcsChildOf
Used to express parent-child relationships.

Construct a ChildOf pair.

Definition at line 924 of file flecs_c.h.

◆ ecs_dependson

#define ecs_dependson ( e)
Value:
ecs_pair(EcsDependsOn, e)
const ecs_entity_t EcsDependsOn
Used to express dependency relationships.

Construct a DependsOn pair.

Definition at line 926 of file flecs_c.h.

◆ ecs_each

#define ecs_each ( world,
id )
Value:
ecs_each_id(world, ecs_id(id))
FLECS_API const ecs_entity_t ecs_id(EcsDocDescription)
Component ID for EcsDocDescription.
ecs_iter_t ecs_each_id(const ecs_world_t *world, ecs_id_t component)
Iterate all entities with a specified (component ID).

Iterate entities with a component.

Definition at line 931 of file flecs_c.h.

◆ ecs_each_pair

#define ecs_each_pair ( world,
r,
t )
Value:
ecs_each_id(world, ecs_pair(r, t))

Iterate entities with a pair.

Definition at line 933 of file flecs_c.h.

◆ ecs_each_pair_t

#define ecs_each_pair_t ( world,
R,
t )
Value:
ecs_each_id(world, ecs_pair(ecs_id(R), t))

Iterate entities with a pair (type-safe first element).

Definition at line 935 of file flecs_c.h.

◆ ecs_isa

#define ecs_isa ( e)
Value:
ecs_pair(EcsIsA, e)
const ecs_entity_t EcsIsA
Used to express inheritance relationships.

Construct an IsA pair.

Definition at line 922 of file flecs_c.h.

◆ ecs_with

#define ecs_with ( e)
Value:
ecs_pair(EcsWith, e)
const ecs_entity_t EcsWith
Ensure that a component is always added together with another component.

Construct a With pair.

Definition at line 928 of file flecs_c.h.