LuaScript Class Reference

Implementation of the Script class for Lua. More...

#include <luascript.hpp>

Inheritance diagram for LuaScript:

Script

List of all members.

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.


Detailed Description

Implementation of the Script class for Lua.

Definition at line 35 of file luascript.hpp.


Constructor & Destructor Documentation

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().


Member Function Documentation

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.

Returns:
the value returned by the script.

Implements Script.

Definition at line 64 of file luascript.cpp.

Referenced by getPostCallback(), and getQuestCallback().


The documentation for this class was generated from the following files:

Generated on Sun Apr 26 17:30:46 2009 for TMW Server Collection by  doxygen 1.5.5