Flecs
v4.1
A fast entity component system (ECS) for C & C++
Toggle main menu visibility
Loading...
Searching...
No Matches
mixin.inl
Go to the documentation of this file.
1
5
13
17
int
script_run
(
const
char
*name,
const
char
*str)
const
{
18
return
ecs_script_run
(world_, name, str,
nullptr
);
19
}
20
24
int
script_run_file
(
const
char
*filename)
const
{
25
return
ecs_script_run_file
(world_, filename);
26
}
27
31
script_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
42
template
<
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
65
template
<
typename
T>
66
T
get_const_var
(
const
char
*name,
const
T& default_value = {})
const
;
67
85
template
<
typename
T>
86
void
get_const_var
(
const
char
*name, T& out,
const
T& default_value = {})
const
;
87
88
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, ecs_script_eval_result_t *result)
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 a script.
Definition
mixin.inl:17
script_run_file
int script_run_file(const char *filename) const
Run a script from a file.
Definition
mixin.inl:24
to_expr
flecs::string to_expr(flecs::entity_t tid, const void *value)
Convert a value to a string.
Definition
mixin.inl:36
get_const_var
T get_const_var(const char *name, const T &default_value={}) const
Get the value of an exported script variable.
script
script_builder script(const char *name=nullptr) const
Build a script.
Definition
mixin.inl:31
flecs::entity_t
ecs_entity_t entity_t
Entity type.
Definition
c_types.hpp:21
flecs::string
Owned string wrapper.
Definition
string.hpp:15