This commit is contained in:
Glenn Maynard
2005-10-15 00:09:19 +00:00
parent 1150c33a57
commit b9238373b7
2 changed files with 52 additions and 0 deletions
+49
View File
@@ -82,6 +82,55 @@ void DifficultyIcon::SetFromDifficulty( PlayerNumber pn, Difficulty dc )
}
}
// lua start
#include "LuaBinding.h"
class LunaDifficultyIcon: public Luna<DifficultyIcon>
{
public:
LunaDifficultyIcon() { LUA->Register( Register ); }
static int SetFromSteps( T* p, lua_State *L )
{
if( lua_isnil(L,1) )
{
p->SetFromSteps( PLAYER_1, NULL );
}
else
{
Steps *pS = Luna<Steps>::check(L,1);
p->SetFromSteps( PLAYER_1, pS );
}
return 0;
}
static int SetFromTrail( T* p, lua_State *L )
{
if( lua_isnil(L,1) )
{
p->SetFromTrail( PLAYER_1, NULL );
}
else
{
Trail *pT = Luna<Trail>::check(L,1);
p->SetFromTrail( PLAYER_1, pT );
}
return 0;
}
static int SetFromDifficulty( T* p, lua_State *L ) { p->SetFromDifficulty( PLAYER_1, (Difficulty)IArg(1) ); return 0; }
static void Register(lua_State *L)
{
ADD_METHOD( SetFromSteps );
ADD_METHOD( SetFromTrail );
ADD_METHOD( SetFromDifficulty );
Luna<T>::Register( L );
}
};
LUA_REGISTER_DERIVED_CLASS( DifficultyIcon, Sprite )
// lua end
/*
* (c) 2001-2004 Chris Danford
* All rights reserved.
+3
View File
@@ -25,6 +25,9 @@ public:
void SetFromTrail( PlayerNumber pn, const Trail* pTrail );
void SetFromDifficulty( PlayerNumber pn, Difficulty dc );
// Lua
void PushSelf( lua_State *L );
protected:
bool m_bBlank;
};