lua bindings

This commit is contained in:
Glenn Maynard
2006-08-16 05:11:01 +00:00
parent dbf65f06ee
commit f48af0bbe6
2 changed files with 25 additions and 0 deletions
+21
View File
@@ -89,6 +89,27 @@ void RadarValues::FromString( RString sRadarValues )
}
// lua start
#include "LuaBinding.h"
class LunaRadarValues: public Luna<RadarValues>
{
public:
LunaRadarValues() { LUA->Register( Register ); }
static int GetValue( T* p, lua_State *L ) { lua_pushnumber( L, (*p)[IArg(1)] ); return 1; }
static void Register(lua_State *L)
{
ADD_METHOD( GetValue );
Luna<T>::Register( L );
}
};
LUA_REGISTER_CLASS( RadarValues )
// lua end
/*
* (c) 2001-2004 Chris Danford
* All rights reserved.
+4
View File
@@ -8,6 +8,7 @@
#define RADAR_VAL_UNKNOWN -1
class XNode;
struct lua_State;
struct RadarValues
{
@@ -63,6 +64,9 @@ struct RadarValues
RString ToString( int iMaxValues = -1 ) const; // default = all
void FromString( RString sValues );
// Lua
void PushSelf( lua_State *L );
};