Flecs: include/flecs/addons/cpp/mixins/script/mixin.inl Source File
Description: A fast entity component system (ECS) for C & C++

| 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
17 int script_run(const char *name, const char *str) const {
18 return ecs_script_run(world_, name, str);
19}
20
24 int 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
36 flecs::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>
43 flecs::string to_expr(const T* value) {
44 flecs::entity_t tid = _::type<T>::id(world_);
45 return to_expr(tid, value);
46}
47
48
ecs_ptr_to_expr
FLECS_API char * ecs_ptr_to_expr(const ecs_world_t *world, ecs_entity_t type, const void *data)
Serialize value into expression string.
ecs_script_run
FLECS_API int ecs_script_run(ecs_world_t *world, const char *name, const char *code)
Parse script.
ecs_script_run_file
FLECS_API int ecs_script_run_file(ecs_world_t *world, const char *filename)
Parse script file.
script_run
int script_run(const char *name, const char *str) const
Run script.
Definition mixin.inl:17
script_run_file
int script_run_file(const char *filename) const
Run script from file.
Definition mixin.inl:24
to_expr
flecs::string to_expr(flecs::entity_t tid, const void *value)
Convert value to string.
Definition mixin.inl:36
script
script_builder script(const char *name=nullptr) const
Build script.
Definition mixin.inl:31
flecs::string
Definition string.hpp:13