|
| 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.
|
| 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.
|
| 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.
|
| 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.
|
Data definition format for loading entity data.
template<typename T>
| T flecs::world::get_const_var |
( |
const char * | name, |
|
|
const T & | default_value = {} ) const |
|
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.
- Template Parameters
-
| T | The type of the value to obtain. |
- Parameters
-
| name | The name of the exported variable. |
| default_value | Optional default value. Returned when const var lookup failed. |
- Returns
- The value of the variable.
Definition at line 152 of file impl.hpp.
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.
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.
- Template Parameters
-
| T | The type of the value to obtain. |
- Parameters
-
| 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. |
Definition at line 171 of file impl.hpp.
template<typename T>
| 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.
- Template Parameters
-
| T | The type of the value to obtain. |
- Parameters
-
| name | The name of the exported variable. |
| default_value | Optional default value. Returned when const var lookup failed. |
- Returns
- The value of the 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.
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.
- Template Parameters
-
| T | The type of the value to obtain. |
- Parameters
-
| 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. |