This commit is contained in:
Glenn Maynard
2007-03-14 04:26:32 +00:00
parent 0198161675
commit d50f66373a
5 changed files with 86 additions and 1 deletions
+23
View File
@@ -272,6 +272,27 @@ class LunaStageStats: public Luna<StageStats>
public:
static int GetPlayerStageStats( T* p, lua_State *L ) { p->m_player[Enum::Check<PlayerNumber>(L, 1)].PushSelf(L); return 1; }
static int GetMultiPlayerStageStats( T* p, lua_State *L ) { p->m_multiPlayer[Enum::Check<MultiPlayer>(L, 1)].PushSelf(L); return 1; }
static int GetPlayedSongs( T* p, lua_State *L )
{
lua_newtable(L);
for( int i = 0; i < (int) p->m_vpPlayedSongs.size(); ++i )
{
p->m_vpPlayedSongs[i]->PushSelf(L);
lua_rawseti( L, -2, i+1 );
}
return 1;
}
static int GetPossibleSongs( T* p, lua_State *L )
{
lua_newtable(L);
for( int i = 0; i < (int) p->m_vpPossibleSongs.size(); ++i )
{
p->m_vpPossibleSongs[i]->PushSelf(L);
lua_rawseti( L, -2, i+1 );
}
return 1;
}
static int GetGameplaySeconds( T* p, lua_State *L ) { lua_pushnumber(L, p->m_fGameplaySeconds); return 1; }
static int OnePassed( T* p, lua_State *L ) { lua_pushboolean(L, p->OnePassed()); return 1; }
static int AllFailed( T* p, lua_State *L ) { lua_pushboolean(L, p->AllFailed()); return 1; }
@@ -280,6 +301,8 @@ public:
{
ADD_METHOD( GetPlayerStageStats );
ADD_METHOD( GetMultiPlayerStageStats );
ADD_METHOD( GetPlayedSongs );
ADD_METHOD( GetPossibleSongs );
ADD_METHOD( GetGameplaySeconds );
ADD_METHOD( OnePassed );
ADD_METHOD( AllFailed );