simpler Lua boilerplate

This commit is contained in:
Glenn Maynard
2006-09-27 19:53:05 +00:00
parent 4002071bea
commit ea7c05cee5
8 changed files with 30 additions and 45 deletions
+3 -5
View File
@@ -95,15 +95,13 @@ void RadarValues::FromString( RString sRadarValues )
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)
LunaRadarValues()
{
ADD_METHOD( GetValue );
LUA->Register( Register );
Luna<T>::Register( L );
ADD_METHOD( GetValue );
}
};