LUAUtil Class Reference

#include <LUAUtil.h>

List of all members.

Static Public Member Functions

static void addVectorToStack (lua_State *L, const FixedVector &vector)
static FixedVector getVectorFromStack (lua_State *L, int position)
static fixed getNumberFromTable (lua_State *L, int tablePosition, const char *name, fixed defaultResult)
static int getIntFromTable (lua_State *L, int tablePosition, const char *name, int defaultResult)
static bool getBoolFromTable (lua_State *L, int tablePosition, const char *name, bool defaultResult)
static std::string getStringFromTable (lua_State *L, int tablePosition, const char *name, std::string &defaultResult)


Detailed Description

Definition at line 31 of file LUAUtil.h.


Member Function Documentation

void LUAUtil::addVectorToStack ( lua_State L,
const FixedVector vector 
) [static]

Definition at line 24 of file LUAUtil.cpp.

References lua_newtable, lua_pushnumber(), lua_pushstring(), and lua_settable().

Referenced by addTank(), and LUAScript::addVectorParameter().

FixedVector LUAUtil::getVectorFromStack ( lua_State L,
int  position 
) [static]

Definition at line 42 of file LUAUtil.cpp.

References lua_gettable(), lua_pop, lua_pushstring(), LUA_TTABLE, luaL_checknumber(), and luaL_checktype().

Referenced by s3d_explosion(), s3d_fire_weapon(), s3d_laser(), and s3d_napalm().

fixed LUAUtil::getNumberFromTable ( lua_State L,
int  tablePosition,
const char *  name,
fixed  defaultResult 
) [static]

Definition at line 66 of file LUAUtil.cpp.

References lua_gettable(), lua_isnil, lua_pop, lua_pushstring(), and luaL_checknumber().

Referenced by FixedActionParam::initLUA(), NapalmParams::parseLUA(), LaserParams::parseLUA(), and ExplosionParams::parseLUA().

int LUAUtil::getIntFromTable ( lua_State L,
int  tablePosition,
const char *  name,
int  defaultResult 
) [static]

Definition at line 81 of file LUAUtil.cpp.

References fixed::asInt(), lua_gettable(), lua_isnil, lua_pop, lua_pushstring(), and luaL_checknumber().

Referenced by NapalmParams::parseLUA().

bool LUAUtil::getBoolFromTable ( lua_State L,
int  tablePosition,
const char *  name,
bool  defaultResult 
) [static]

Definition at line 97 of file LUAUtil.cpp.

References lua_gettable(), lua_isboolean, lua_isnil, lua_pop, lua_pushstring(), and lua_toboolean().

Referenced by NapalmParams::parseLUA(), LaserParams::parseLUA(), and ExplosionParams::parseLUA().

std::string LUAUtil::getStringFromTable ( lua_State L,
int  tablePosition,
const char *  name,
std::string defaultResult 
) [static]

Definition at line 114 of file LUAUtil.cpp.

References lua_gettable(), lua_isnil, lua_isstring(), lua_pop, lua_pushstring(), and lua_tostring.

Referenced by NapalmParams::parseLUA(), and ExplosionParams::parseLUA().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:04 2009 for Scorched3D by  doxygen 1.5.3