1#include <iter_targets.h>
2#include <stdio.h>
3
4
5
6
7
8
9
10
11
12
13int main(int argc, char *argv[]) {
15
19
23
25
26
27 .terms = {{ .id = ecs_pair(Eats,
EcsAny) }}
28 });
29
34
35 for (int i = 0; i < it.count; i ++) {
37 for (int t = 0; t < tr->count; t ++) {
39 ecs, type->
array[t + tr->index]);
41 }
42 }
43 }
44
46
47
48
49
50
51}
ecs_id_t ecs_entity_t
An entity identifier.
struct ecs_table_record_t ecs_table_record_t
Opaque type for table record.
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
#define ecs_add_pair(world, subject, first, second)
Add a pair to an entity.
#define ecs_entity(world,...)
Shorthand for creating an entity with ecs_entity_init().
#define ECS_TAG(world, id)
Declare and define a tag.
#define ecs_query(world,...)
Shorthand for creating a query with ecs_query_init().
const char * ecs_get_name(const ecs_world_t *world, ecs_entity_t entity)
Get the name of an entity.
bool ecs_query_next(ecs_iter_t *it)
Progress a query iterator.
ecs_iter_t ecs_query_iter(const ecs_world_t *world, const ecs_query_t *query)
Create a query iterator.
const ecs_type_t * ecs_table_get_type(const ecs_table_t *table)
Get the type for a table.
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.
Queries are lists of constraints (terms) that match entities.
A type is a list of (component) IDs.
ecs_id_t * array
Array with IDs.