skip exporting round data when nothing was played (no taps, no holds)

This commit is contained in:
Glenn Maynard
2009-10-31 21:22:38 +00:00
parent 577005a595
commit 8f6a7f7394
3 changed files with 24 additions and 0 deletions
+15
View File
@@ -160,6 +160,21 @@ void HighScore::Unset()
m_Impl = new HighScoreImpl;
}
bool HighScore::IsEmpty() const
{
FOREACH_ENUM( TapNoteScore, tns )
{
if( m_Impl->iTapNoteScores[tns] > 0 )
return false;
}
FOREACH_ENUM( HoldNoteScore, hns )
{
if( m_Impl->iHoldNoteScores[hns] > 0 )
return false;
}
return true;
}
RString HighScore::GetName() const { return m_Impl->sName; }
Grade HighScore::GetGrade() const { return m_Impl->grade; }
int HighScore::GetScore() const { return m_Impl->iScore; }
+1
View File
@@ -20,6 +20,7 @@ struct HighScore
RString GetName() const;
Grade GetGrade() const;
int GetScore() const;
bool IsEmpty() const;
float GetPercentDP() const;
float GetSurviveSeconds() const;
float GetSurvivalSeconds() const;
+8
View File
@@ -264,12 +264,20 @@ void StatsManager::CommitStatsToProfiles( const StageStats *pSS )
if(!GAMESTATE->m_bMultiplayer)
{
FOREACH_HumanPlayer( p )
{
if( pSS->m_player[p].m_HighScore.IsEmpty() )
continue;
recent->AppendChild( MakeRecentScoreNode( *pSS, GAMESTATE->m_pCurTrail[p], pSS->m_player[p], MultiPlayer_Invalid ) );
}
}
else
{
FOREACH_EnabledMultiPlayer( mp )
{
if( pSS->m_multiPlayer[mp].m_HighScore.IsEmpty() )
continue;
recent->AppendChild( MakeRecentScoreNode( *pSS, GAMESTATE->m_pCurTrail[GAMESTATE->m_MasterPlayerNumber], pSS->m_multiPlayer[mp], mp ) );
}
}
RString sDate = DateTime::GetNowDate().GetString();