Data definition format for loading entity data. More...
Classes | |
| struct | flecs::script_builder |
| Script builder interface. More... | |
| struct | flecs::parsed_script |
Typedefs | |
| using | flecs::Script = EcsScript |
Functions | |
| int | script_run (const char *name, const char *str) const |
| Run a script. | |
| int | script_run_file (const char *filename) const |
| Run a script from a file. | |
| script_builder | script (const char *name=nullptr) const |
| Build a script. | |
| parsed_script | script_parse (const char *name, const char *code, const ecs_script_eval_desc_t *desc=nullptr, ecs_script_eval_result_t *result=nullptr) const |
| int | script_update (flecs::entity_t script, const char *code, flecs::entity_t instance=0) const |
| int | script_reload (flecs::entity_t script, const char *code=nullptr) const |
| Reload a script from new code, or from its file when code is nullptr. | |
| function_builder | function (const char *name) const |
| function_builder | method (flecs::entity_t type, const char *name) const |
| template<typename T> | |
| function_builder | method (const char *name) const |
| template<typename T> | |
| flecs::entity | const_var (const char *name, const T &value, flecs::entity_t parent=0) const |
| template<typename T> | |
| flecs::entity | mut_var (const char *name, const T &value, flecs::entity_t parent=0) const |
| template<typename T> | |
| int | set_mut_var (const char *name, const T &value) const |
| flecs::string | to_expr (flecs::entity_t tid, const void *value) |
| Convert a value to a string. | |
| template<typename T> | |
| flecs::string | to_expr (const T *value) |
| Convert a value to a string. | |
| template<typename T> | |
| T | get_const_var (const char *name, const T &default_value={}) const |
| Get the value of an exported script variable. | |
| template<typename T> | |
| void | get_const_var (const char *name, T &out, const T &default_value={}) const |
| Get the value of an exported script variable. | |
| template<typename T> | |
| T | get_mut_var (const char *name, const T &default_value={}) const |
| Get the value of an exported script mut variable. | |
| template<typename T> | |
| void | get_mut_var (const char *name, T &out, const T &default_value={}) const |
| Get the value of an exported script mut variable. | |
| int | flecs::world::script_run (const char *name, const char *str) const |
| Run a script. | |
| int | flecs::world::script_run_file (const char *filename) const |
| Run a script from a file. | |
| script_builder | flecs::world::script (const char *name=nullptr) const |
| Build a script. | |
| parsed_script | flecs::world::script_parse (const char *name, const char *code, const ecs_script_eval_desc_t *desc=nullptr, ecs_script_eval_result_t *result=nullptr) const |
| int | flecs::world::script_update (flecs::entity_t script, const char *code, flecs::entity_t instance=0) const |
| int | flecs::world::script_reload (flecs::entity_t script, const char *code=nullptr) const |
| Reload a script from new code, or from its file when code is nullptr. | |
| function_builder | flecs::world::function (const char *name) const |
| function_builder | flecs::world::method (flecs::entity_t type, const char *name) const |
| template<typename T> | |
| function_builder | flecs::world::method (const char *name) const |
| template<typename T> | |
| flecs::entity | flecs::world::const_var (const char *name, const T &value, flecs::entity_t parent=0) const |
| template<typename T> | |
| flecs::entity | flecs::world::mut_var (const char *name, const T &value, flecs::entity_t parent=0) const |
| template<typename T> | |
| int | flecs::world::set_mut_var (const char *name, const T &value) const |
| flecs::string | flecs::world::to_expr (flecs::entity_t tid, const void *value) |
| Convert a value to a string. | |
| template<typename T> | |
| flecs::string | flecs::world::to_expr (const T *value) |
| Convert a value to a string. | |
| template<typename T> | |
| T | flecs::world::get_const_var (const char *name, const T &default_value={}) const |
| Get the value of an exported script variable. | |
| template<typename T> | |
| void | flecs::world::get_const_var (const char *name, T &out, const T &default_value={}) const |
| Get the value of an exported script variable. | |
| template<typename T> | |
| T | flecs::world::get_mut_var (const char *name, const T &default_value={}) const |
| Get the value of an exported script mut variable. | |
| template<typename T> | |
| void | flecs::world::get_mut_var (const char *name, T &out, const T &default_value={}) const |
| Get the value of an exported script mut variable. | |
Data definition format for loading entity data.
|
inline |
|
inline |
|
inline |
Get the value of an exported script variable.
This operation will panic if no const var with the provided name was found, or if the type of the variable cannot be converted to the provided type.
An exported variable can be created in a script like this:
See the Flecs script manual for more details.
| T | The type of the value to obtain. |
| name | The name of the exported variable. |
| default_value | Optional default value. Returned when const var lookup failed. |
| void flecs::world::get_const_var | ( | const char * | name, |
| T & | out, | ||
| const T & | default_value = {} ) const |
Get the value of an exported script variable.
This operation will panic if no const var with the provided name was found, or if the type of the variable cannot be converted to the provided type.
An exported variable can be created in a script like this:
See the Flecs script manual for more details.
| T | The type of the value to obtain. |
| name | The name of the exported variable. |
| out | Optional pointer to out variable. Can be used to automatically deduce T. |
| default_value | Optional default value. Returned when const var lookup failed. |
| T get_const_var | ( | const char * | name, |
| const T & | default_value = {} ) const |
Get the value of an exported script variable.
This operation will panic if no const var with the provided name was found, or if the type of the variable cannot be converted to the provided type.
An exported variable can be created in a script like this:
See the Flecs script manual for more details.
| T | The type of the value to obtain. |
| name | The name of the exported variable. |
| default_value | Optional default value. Returned when const var lookup failed. |
| void get_const_var | ( | const char * | name, |
| T & | out, | ||
| const T & | default_value = {} ) const |
Get the value of an exported script variable.
This operation will panic if no const var with the provided name was found, or if the type of the variable cannot be converted to the provided type.
An exported variable can be created in a script like this:
See the Flecs script manual for more details.
| T | The type of the value to obtain. |
| name | The name of the exported variable. |
| out | Optional pointer to out variable. Can be used to automatically deduce T. |
| default_value | Optional default value. Returned when const var lookup failed. |
|
inline |
Get the value of an exported script mut variable.
Unlike a const variable, the value of a mut variable is never folded into expressions that use it.
An exported mut variable can be created in a script like this:
See the Flecs script manual for more details.
| T | The type of the value to obtain. |
| name | The name of the exported variable. |
| default_value | Optional default value. Returned when mut var lookup failed. |
| void flecs::world::get_mut_var | ( | const char * | name, |
| T & | out, | ||
| const T & | default_value = {} ) const |
Get the value of an exported script mut variable.
Unlike a const variable, the value of a mut variable is never folded into expressions that use it.
An exported mut variable can be created in a script like this:
See the Flecs script manual for more details.
| T | The type of the value to obtain. |
| name | The name of the exported variable. |
| out | Optional pointer to out variable. Can be used to automatically deduce T. |
| default_value | Optional default value. Returned when mut var lookup failed. |
| T get_mut_var | ( | const char * | name, |
| const T & | default_value = {} ) const |
Get the value of an exported script mut variable.
Unlike a const variable, the value of a mut variable is never folded into expressions that use it.
An exported mut variable can be created in a script like this:
See the Flecs script manual for more details.
| T | The type of the value to obtain. |
| name | The name of the exported variable. |
| default_value | Optional default value. Returned when mut var lookup failed. |
| void get_mut_var | ( | const char * | name, |
| T & | out, | ||
| const T & | default_value = {} ) const |
Get the value of an exported script mut variable.
Unlike a const variable, the value of a mut variable is never folded into expressions that use it.
An exported mut variable can be created in a script like this:
See the Flecs script manual for more details.
| T | The type of the value to obtain. |
| name | The name of the exported variable. |
| out | Optional pointer to out variable. Can be used to automatically deduce T. |
| default_value | Optional default value. Returned when mut var lookup failed. |
|
inline |
|
inline |
| function_builder method | ( | const char * | name | ) | const |
| function_builder method | ( | flecs::entity_t | type, |
| const char * | name ) const |
|
inline |
|
inline |
| script_builder script | ( | const char * | name = nullptr | ) | const |
|
inline |
| parsed_script script_parse | ( | const char * | name, |
| const char * | code, | ||
| const ecs_script_eval_desc_t * | desc = nullptr, | ||
| ecs_script_eval_result_t * | result = nullptr ) const |
|
inline |
Reload a script from new code, or from its file when code is nullptr.
| int script_reload | ( | flecs::entity_t | script, |
| const char * | code = nullptr ) const |
Reload a script from new code, or from its file when code is nullptr.
|
inline |
| int script_run | ( | const char * | name, |
| const char * | str ) const |
|
inline |
| int script_run_file | ( | const char * | filename | ) | const |
|
inline |
| int script_update | ( | flecs::entity_t | script, |
| const char * | code, | ||
| flecs::entity_t | instance = 0 ) const |
|
inline |
|
inline |
|
inline |
| flecs::string to_expr | ( | const T * | value | ) |
| flecs::string to_expr | ( | flecs::entity_t | tid, |
| const void * | value ) |