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

Macros

#define ecs_add(world, entity, T)
 Add a component to an entity.
#define ecs_add_pair(world, subject, first, second)
 Add a pair to an entity.
#define ecs_remove(world, entity, T)
 Remove a component from an entity.
#define ecs_remove_pair(world, subject, first, second)
 Remove a pair from an entity.
#define ecs_auto_override(world, entity, T)
 Auto-override a component on an entity.
#define ecs_auto_override_pair(world, subject, first, second)
 Auto-override a pair on an entity.

Detailed Description

Macro Definition Documentation

◆ ecs_add

#define ecs_add ( world,
entity,
T )
Value:
ecs_add_id(world, entity, ecs_id(T))
void ecs_add_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Add a (component) ID to an entity.
FLECS_API const ecs_entity_t ecs_id(EcsDocDescription)
Component ID for EcsDocDescription.

Add a component to an entity.

Definition at line 318 of file flecs_c.h.

◆ ecs_add_pair

#define ecs_add_pair ( world,
subject,
first,
second )
Value:
ecs_add_id(world, subject, ecs_pair(first, second))

Add a pair to an entity.

Definition at line 322 of file flecs_c.h.

◆ ecs_auto_override

#define ecs_auto_override ( world,
entity,
T )
Value:
ecs_auto_override_id(world, entity, ecs_id(T))
void ecs_auto_override_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Add an auto override for a component.

Auto-override a component on an entity.

Definition at line 334 of file flecs_c.h.

◆ ecs_auto_override_pair

#define ecs_auto_override_pair ( world,
subject,
first,
second )
Value:
ecs_auto_override_id(world, subject, ecs_pair(first, second))

Auto-override a pair on an entity.

Definition at line 338 of file flecs_c.h.

◆ ecs_remove

#define ecs_remove ( world,
entity,
T )
Value:
ecs_remove_id(world, entity, ecs_id(T))
void ecs_remove_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Remove a component from an entity.

Remove a component from an entity.

Definition at line 326 of file flecs_c.h.

◆ ecs_remove_pair

#define ecs_remove_pair ( world,
subject,
first,
second )
Value:
ecs_remove_id(world, subject, ecs_pair(first, second))

Remove a pair from an entity.

Definition at line 330 of file flecs_c.h.