simpler Lua boilerplate

This commit is contained in:
Glenn Maynard
2006-09-27 19:47:52 +00:00
parent e0bf203af4
commit 4002071bea
7 changed files with 29 additions and 43 deletions
+3 -8
View File
@@ -198,24 +198,19 @@ void Character::UndemandGraphics()
class LunaCharacter: public Luna<Character>
{
public:
LunaCharacter() { LUA->Register( Register ); }
static int GetCardPath( T* p, lua_State *L ) { lua_pushstring(L, p->GetCardPath() ); return 1; }
static int GetIconPath( T* p, lua_State *L ) { lua_pushstring(L, p->GetIconPath() ); return 1; }
static int GetSongSelectIconPath( T* p, lua_State *L ) { lua_pushstring(L, p->GetSongSelectIconPath() ); return 1; }
static int GetStageIconPath( T* p, lua_State *L ) { lua_pushstring(L, p->GetStageIconPath() ); return 1; }
RString GetCardPath() const;
RString GetIconPath() const;
static void Register( Lua *L )
LunaCharacter()
{
LUA->Register( Register );
ADD_METHOD( GetCardPath );
ADD_METHOD( GetIconPath );
ADD_METHOD( GetSongSelectIconPath );
ADD_METHOD( GetStageIconPath );
Luna<T>::Register( L );
}
};