00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if !defined(__INCLUDE_LUAUtil_INCLUDE__)
00022 #define __INCLUDE_LUAUtil_INCLUDE__
00023
00024 #include <string>
00025 #include <common/FixedVector.h>
00026
00027 #include "lua.h"
00028 #include "lauxlib.h"
00029 #include "lualib.h"
00030
00031 class LUAUtil
00032 {
00033 public:
00034 static void addVectorToStack(lua_State *L, const FixedVector &vector);
00035 static FixedVector getVectorFromStack(lua_State *L, int position);
00036
00037 static fixed getNumberFromTable(lua_State *L, int tablePosition,
00038 const char *name, fixed defaultResult);
00039 static int getIntFromTable(lua_State *L, int tablePosition,
00040 const char *name, int defaultResult);
00041 static bool getBoolFromTable(lua_State *L, int tablePosition,
00042 const char *name, bool defaultResult);
00043 static std::string getStringFromTable(lua_State *L, int tablePosition,
00044 const char *name, std::string &defaultResult);
00045 };
00046
00047 #endif // __INCLUDE_LUAUtil_INCLUDE__