Flecs: Adding & Removing
Description: A fast entity component system (ECS) for C & C++

| Flecs v4.0 A fast entity component system (ECS) for C & C++

Loading...
Searching...
No Matches
Adding & Removing
C API » Macro API » Type Safe API » Entity API
Collaboration diagram for Adding & Removing:

## Macros
#define | ecs_add(world, entity, T)
#define | ecs_add_pair(world, subject, first, second)
#define | ecs_remove(world, entity, T)
#define | ecs_remove_pair(world, subject, first, second)
#define | ecs_auto_override(world, entity, T)
#define | ecs_auto_override_pair(world, subject, first, second)

## Detailed Description

## Macro Definition Documentation

## ◆ ecs_add

#define ecs_add | ( |  | world,
|  |  | entity,
|  |  | T )

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

Definition at line 330 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))

Definition at line 333 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))
ecs_auto_override_id
void ecs_auto_override_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Add auto override for (component) id.

Definition at line 344 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))

Definition at line 347 of file flecs_c.h.

## ◆ ecs_remove

#define ecs_remove | ( |  | world,
|  |  | entity,
|  |  | T )

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

Definition at line 337 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))

Definition at line 340 of file flecs_c.h.