1#include <symmetric_relations.h>
2#include <stdio.h>
3
4int main(int argc, char *argv[]) {
6
8
9
10
12
13
16
17
18
20
21
22 printf("Player 1 trades with Player 2: %s\n",
23 (
ecs_has_pair(ecs, player_1, TradesWith, player_2) ?
"true" :
"false"));
24 printf("Player 2 trades with Player 1: %s\n",
25 (
ecs_has_pair(ecs, player_2, TradesWith, player_1) ?
"true" :
"false"));
26
27
28
29
30
32}
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 EcsSymmetric
Mark relationship as commutative.
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.