add Lua binding
This commit is contained in:
@@ -377,6 +377,28 @@ float PlayerStageStats::GetPercentageOfTaps( TapNoteScore tns ) const
|
||||
}
|
||||
|
||||
|
||||
// lua start
|
||||
#include "LuaBinding.h"
|
||||
|
||||
template<class T>
|
||||
class LunaPlayerStageStats : public Luna<T>
|
||||
{
|
||||
public:
|
||||
LunaPlayerStageStats() { LUA->Register( Register ); }
|
||||
|
||||
static int GetCaloriesBurned( T* p, lua_State *L ) { lua_pushnumber(L, p->fCaloriesBurned ); return 1; }
|
||||
|
||||
static void Register(lua_State *L)
|
||||
{
|
||||
ADD_METHOD( GetCaloriesBurned )
|
||||
Luna<T>::Register( L );
|
||||
}
|
||||
};
|
||||
|
||||
LUA_REGISTER_CLASS( PlayerStageStats )
|
||||
// lua end
|
||||
|
||||
|
||||
/*
|
||||
* (c) 2001-2004 Chris Danford, Glenn Maynard
|
||||
* All rights reserved.
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "RadarValues.h"
|
||||
#include <map>
|
||||
class Steps;
|
||||
struct lua_State;
|
||||
|
||||
|
||||
struct PlayerStageStats
|
||||
{
|
||||
@@ -88,6 +90,9 @@ struct PlayerStageStats
|
||||
float GetPercentageOfTaps( TapNoteScore tns ) const;
|
||||
void UpdateComboList( float fSecond, bool rollover );
|
||||
Combo_t GetMaxCombo() const;
|
||||
|
||||
// Lua
|
||||
void PushSelf( lua_State *L );
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -81,6 +81,33 @@ bool StageStats::AllFailedEarlier() const
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// lua start
|
||||
#include "LuaBinding.h"
|
||||
|
||||
template<class T>
|
||||
class LunaStageStats : public Luna<T>
|
||||
{
|
||||
public:
|
||||
LunaStageStats() { LUA->Register( Register ); }
|
||||
|
||||
static int GetPlayerStageStats( T* p, lua_State *L ) { p->m_player[IArg(1)].PushSelf(L); return 1; }
|
||||
|
||||
static void Register(lua_State *L)
|
||||
{
|
||||
ADD_METHOD( GetPlayerStageStats )
|
||||
Luna<T>::Register( L );
|
||||
}
|
||||
};
|
||||
|
||||
LUA_REGISTER_CLASS( StageStats )
|
||||
// lua end
|
||||
|
||||
|
||||
//
|
||||
// Old Lua
|
||||
//
|
||||
|
||||
static Grade GetBestGrade()
|
||||
{
|
||||
Grade g = NUM_GRADES;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "PlayerStageStats.h"
|
||||
class Song;
|
||||
class Style;
|
||||
struct lua_State;
|
||||
|
||||
|
||||
struct StageStats
|
||||
@@ -31,6 +32,9 @@ struct StageStats
|
||||
float fGameplaySeconds; // how many seconds before gameplay ended. Updated by Gameplay, not scaled by music rate.
|
||||
|
||||
PlayerStageStats m_player[NUM_PLAYERS];
|
||||
|
||||
// Lua
|
||||
void PushSelf( lua_State *L );
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user