Owns the Lua VM and exposes the engine API to scripts.
More...
#include <ScriptEngine.hpp>
|
| | ScriptEngine () |
| | ScriptEngine (const ScriptEngine &)=delete |
| ScriptEngine & | operator= (const ScriptEngine &)=delete |
| sol::state & | state () |
| | The shared Lua state (used by LuaComponent to load scripts).
|
| void | defer (std::function< void()> fn) |
| | Queue a structural change (spawn/destroy) to run after the current update pass, so the scene tree isn't mutated while iterated.
|
| void | run_deferred () |
| | Execute and clear all queued deferred commands.
|
| void | run_string (const std::string &code) |
| | Execute a chunk of Lua (the editor REPL). Errors and non-nil results are printed to the console.
|
Owns the Lua VM and exposes the engine API to scripts.
A single Lua state is shared by every LuaComponent; each component runs its script in its own returned table, so instances don't collide.
◆ ScriptEngine() [1/2]
| turbo::script::ScriptEngine::ScriptEngine |
( |
| ) |
|
◆ ScriptEngine() [2/2]
| turbo::script::ScriptEngine::ScriptEngine |
( |
const ScriptEngine & | | ) |
|
|
delete |
◆ defer()
| void turbo::script::ScriptEngine::defer |
( |
std::function< void()> | fn | ) |
|
|
inline |
Queue a structural change (spawn/destroy) to run after the current update pass, so the scene tree isn't mutated while iterated.
◆ operator=()
◆ run_deferred()
| void turbo::script::ScriptEngine::run_deferred |
( |
| ) |
|
Execute and clear all queued deferred commands.
◆ run_string()
| void turbo::script::ScriptEngine::run_string |
( |
const std::string & | code | ) |
|
Execute a chunk of Lua (the editor REPL). Errors and non-nil results are printed to the console.
◆ state()
| sol::state & turbo::script::ScriptEngine::state |
( |
| ) |
|
|
inline |
The shared Lua state (used by LuaComponent to load scripts).
The documentation for this class was generated from the following files: