1#include <script_run.h>
2#include <stdio.h>
3
4
5
6
8 "Sun {\n"
9 " Mercury {}\n"
10 " Venus {}\n"
11 " Earth {}\n"
12 " Mars {}\n"
13 " Jupiter {}\n"
14 " Saturn {}\n"
15 " Neptune {}\n"
16 " Uranus {}\n"
17 "}\n"
18 ;
19
20int main(int argc, char *argv[]) {
22
24 printf("script failed to run\n");
25 }
26
30 for (
int i = 0; i < it.
count; i ++) {
32 }
33 }
34
36
37
38
39
40
41
42
43
44
45
46}
FLECS_API int ecs_script_run(ecs_world_t *world, const char *name, const char *code, ecs_script_eval_result_t *result)
Parse script.
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.
script_builder script(const char *name=nullptr) const
Build a script.
bool ecs_children_next(ecs_iter_t *it)
Progress an iterator created with ecs_children().
ecs_iter_t ecs_children(const ecs_world_t *world, ecs_entity_t parent)
Iterate children of a parent.
ecs_entity_t ecs_lookup(const ecs_world_t *world, const char *path)
Look up an entity by its path.
const char * ecs_get_name(const ecs_world_t *world, ecs_entity_t entity)
Get the name of an entity.
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.
int32_t count
Number of entities to iterate.
const ecs_entity_t * entities
Entity identifiers.