#include <luascript.hpp>
Public Member Functions | |
LuaScript () | |
Constructor. | |
~LuaScript () | |
Destructor. | |
void | load (const char *) |
Loads a chunk of text into script context and executes its global statements. | |
void | prepare (const std::string &) |
Prepares a call to the given function. | |
void | push (int) |
Pushes an integer argument for the function being prepared. | |
void | push (const std::string &) |
Pushes a string argument for the function being prepared. | |
void | push (Thing *) |
Pushes a pointer argument to a game entity. | |
int | execute () |
Executes the function being prepared. | |
void | processDeathEvent (Being *thing) |
void | processRemoveEvent (Thing *thing) |
Static Public Member Functions | |
static void | getQuestCallback (Character *, const std::string &, const std::string &, void *) |
Called when the server has recovered the value of a quest variable. | |
static void | getPostCallback (Character *, const std::string &, const std::string &, void *) |
Called when the server has recovered the post for a user. |
Definition at line 35 of file luascript.hpp.
LuaScript::LuaScript | ( | ) |
Constructor.
Initializes a new Lua state, registers the native API and loads the libtmw.lua file.
Definition at line 1122 of file lua.cpp.
References Script::loadFile().
void LuaScript::prepare | ( | const std::string & | name | ) | [virtual] |
Prepares a call to the given function.
Only one function can be prepared at once.
Implements Script.
Definition at line 35 of file luascript.cpp.
void LuaScript::push | ( | Thing * | ) | [virtual] |
Pushes a pointer argument to a game entity.
The interface can pass the pointer as an opaque value to the scripting engine, if needed. This value will usually be passed by the script to some callback functions.
Implements Script.
Definition at line 57 of file luascript.cpp.
int LuaScript::execute | ( | ) | [virtual] |
Executes the function being prepared.
Implements Script.
Definition at line 64 of file luascript.cpp.
Referenced by getPostCallback(), and getQuestCallback().