Flecs v4.0
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
mixin.inl
Go to the documentation of this file.
1
17int script_run(const char *name, const char *str) const {
18 return ecs_script_run(world_, name, str);
19}
20
24int script_run_file(const char *filename) const {
25 return ecs_script_run_file(world_, filename);
26}
27
31script_builder script(const char *name = nullptr) const {
32 return script_builder(world_, name);
33}
34
36flecs::string to_expr(flecs::entity_t tid, const void* value) {
37 char *expr = ecs_ptr_to_expr(world_, tid, value);
38 return flecs::string(expr);
39}
40
42template <typename T>
43flecs::string to_expr(const T* value) {
44 flecs::entity_t tid = _::type<T>::id(world_);
45 return to_expr(tid, value);
46}
47
48
FLECS_API char * ecs_ptr_to_expr(const ecs_world_t *world, ecs_entity_t type, const void *data)
Serialize value into expression string.
FLECS_API int ecs_script_run(ecs_world_t *world, const char *name, const char *code)
Parse script.
FLECS_API int ecs_script_run_file(ecs_world_t *world, const char *filename)
Parse script file.
int script_run(const char *name, const char *str) const
Run script.
Definition mixin.inl:17
int script_run_file(const char *filename) const
Run script from file.
Definition mixin.inl:24
flecs::string to_expr(flecs::entity_t tid, const void *value)
Convert value to string.
Definition mixin.inl:36
script_builder script(const char *name=nullptr) const
Build script.
Definition mixin.inl:31