1#include <exclusive_relations.h>
2#include <stdio.h>
3
4int main(int argc, char *argv[]) {
6
8
9
10
12
13
16
17
19
20
22
23
24 printf("Unit in platoon 1: %s\n",
25 ecs_has_pair(ecs, unit, Platoon, platoon_1) ?
"true" :
"false");
26 printf("Unit in platoon 2: %s\n\n",
27 ecs_has_pair(ecs, unit, Platoon, platoon_2) ?
"true" :
"false");
28
29
30
31
33
34 printf("Unit in platoon 1: %s\n",
35 ecs_has_pair(ecs, unit, Platoon, platoon_1) ?
"true" :
"false");
36 printf("Unit in platoon 2: %s\n",
37 ecs_has_pair(ecs, unit, Platoon, platoon_2) ?
"true" :
"false");
38
39
40
41
42
43
44
45
47}
void ecs_add_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Add a (component) ID to an entity.
ecs_id_t ecs_entity_t
An entity identifier.
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
ecs_entity_t ecs_new(ecs_world_t *world)
Create new entity ID.
#define ecs_add_pair(world, subject, first, second)
Add a pair to an entity.
#define ECS_TAG(world, id)
Declare and define a tag.
#define ecs_has_pair(world, entity, first, second)
Test if an entity has a pair.
int ecs_fini(ecs_world_t *world)
Delete a world.
ecs_world_t * ecs_init_w_args(int argc, char *argv[])
Create a new world with arguments.