Component that handles Lua scripting. More...
#include <components.hpp>
Public Member Functions | |
| ScriptComponent (const std::string &script) | |
| Constructs a script component with the given script code. | |
| ~ScriptComponent () | |
| Destructor that cleans up the Lua state. | |
| void | ExecuteFunction (const std::string &functionName) |
| Executes a Lua function within the script. | |
Public Attributes | |
| lua_State * | luaState |
| std::string | scriptCode |
| bool | enabled = true |
| bool | pause = true |
Component that handles Lua scripting.
Definition at line 113 of file components.hpp.
| Raftel::ScriptComponent::ScriptComponent | ( | const std::string & | script | ) |
Constructs a script component with the given script code.
| script | The Lua script code. |
| void Raftel::ScriptComponent::ExecuteFunction | ( | const std::string & | functionName | ) |
Executes a Lua function within the script.
| functionName | The name of the function to execute. |
| bool Raftel::ScriptComponent::enabled = true |
Whether the script is enabled.
Definition at line 134 of file components.hpp.
| lua_State* Raftel::ScriptComponent::luaState |
Lua state for script execution.
Definition at line 132 of file components.hpp.
| bool Raftel::ScriptComponent::pause = true |
Whether the script execution is paused.
Definition at line 135 of file components.hpp.
| std::string Raftel::ScriptComponent::scriptCode |
Script source code.
Definition at line 133 of file components.hpp.