bind
This commit is contained in:
@@ -373,6 +373,29 @@ void Screenshot::LoadFromNode( const XNode* pNode )
|
||||
highScore.LoadFromNode( pHighScore );
|
||||
}
|
||||
|
||||
// lua start
|
||||
#include "LuaBinding.h"
|
||||
|
||||
class LunaHighScore: public Luna<HighScore>
|
||||
{
|
||||
public:
|
||||
LunaHighScore() { LUA->Register( Register ); }
|
||||
|
||||
static int GetName( T* p, lua_State *L ) { lua_pushstring(L, p->GetName() ); return 1; }
|
||||
static int GetScore( T* p, lua_State *L ) { lua_pushnumber(L, p->GetScore() ); return 1; }
|
||||
|
||||
static void Register(lua_State *L)
|
||||
{
|
||||
ADD_METHOD( GetName );
|
||||
ADD_METHOD( GetScore );
|
||||
|
||||
Luna<T>::Register( L );
|
||||
}
|
||||
};
|
||||
|
||||
LUA_REGISTER_CLASS( HighScore )
|
||||
// lua end
|
||||
|
||||
/*
|
||||
* (c) 2004 Chris Danford
|
||||
* All rights reserved.
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "RageUtil_AutoPtr.h"
|
||||
|
||||
class XNode;
|
||||
struct lua_State;
|
||||
|
||||
struct HighScoreImpl;
|
||||
struct HighScore
|
||||
@@ -59,6 +60,9 @@ struct HighScore
|
||||
void LoadFromNode( const XNode* pNode );
|
||||
|
||||
RString GetDisplayName() const;
|
||||
|
||||
// Lua
|
||||
void PushSelf( lua_State *L );
|
||||
private:
|
||||
HiddenPtr<HighScoreImpl> m_Impl;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user