c53f742: add GetBestFullComboTapNoteScore [Chris Danford]

This commit is contained in:
AJ Kelly
2010-07-03 17:59:38 -05:00
parent ccc3a55cca
commit 5c54a7985e
2 changed files with 15 additions and 0 deletions
+14
View File
@@ -530,6 +530,18 @@ bool PlayerStageStats::FullComboOfScore( TapNoteScore tnsAllGreaterOrEqual ) con
return false; return false;
} }
TapNoteScore PlayerStageStats::GetBestFullComboTapNoteScore() const
{
// Optimization opportunity: ...
// (seriously? -aj)
for( TapNoteScore i=TNS_W1; i >= TNS_W5; enum_add(i,-1))
{
if( FullComboOfScore(i) )
return i;
}
return TapNoteScore_Invalid;
}
bool PlayerStageStats::SingleDigitsOfScore( TapNoteScore tnsAllGreaterOrEqual ) const bool PlayerStageStats::SingleDigitsOfScore( TapNoteScore tnsAllGreaterOrEqual ) const
{ {
return FullComboOfScore( tnsAllGreaterOrEqual ) && return FullComboOfScore( tnsAllGreaterOrEqual ) &&
@@ -681,6 +693,7 @@ public:
DEFINE_METHOD( IsDisqualified, IsDisqualified() ) DEFINE_METHOD( IsDisqualified, IsDisqualified() )
DEFINE_METHOD( GetAliveSeconds, m_fAliveSeconds ) DEFINE_METHOD( GetAliveSeconds, m_fAliveSeconds )
DEFINE_METHOD( GetPercentageOfTaps, GetPercentageOfTaps( Enum::Check<TapNoteScore>(L, 1) ) ) DEFINE_METHOD( GetPercentageOfTaps, GetPercentageOfTaps( Enum::Check<TapNoteScore>(L, 1) ) )
DEFINE_METHOD( GetBestFullComboTapNoteScore, GetBestFullComboTapNoteScore() )
static int GetPlayedSteps( T* p, lua_State *L ) static int GetPlayedSteps( T* p, lua_State *L )
{ {
@@ -739,6 +752,7 @@ public:
ADD_METHOD( GetPercentageOfTaps ); ADD_METHOD( GetPercentageOfTaps );
ADD_METHOD( GetRadarActual ); ADD_METHOD( GetRadarActual );
ADD_METHOD( GetRadarPossible ); ADD_METHOD( GetRadarPossible );
ADD_METHOD( GetBestFullComboTapNoteScore );
} }
}; };
+1
View File
@@ -96,6 +96,7 @@ public:
int GetComboAtStartOfStage() const; int GetComboAtStartOfStage() const;
bool FullComboOfScore( TapNoteScore tnsAllGreaterOrEqual ) const; bool FullComboOfScore( TapNoteScore tnsAllGreaterOrEqual ) const;
bool FullCombo() const { return FullComboOfScore(TNS_W3); } bool FullCombo() const { return FullComboOfScore(TNS_W3); }
TapNoteScore PlayerStageStats::GetBestFullComboTapNoteScore() const;
bool SingleDigitsOfScore( TapNoteScore tnsAllGreaterOrEqual ) const; bool SingleDigitsOfScore( TapNoteScore tnsAllGreaterOrEqual ) const;
bool OneOfScore( TapNoteScore tnsAllGreaterOrEqual ) const; bool OneOfScore( TapNoteScore tnsAllGreaterOrEqual ) const;
int GetTotalTaps() const; int GetTotalTaps() const;