add top5 high score saving of Courses and Steps for memory cards/ranking screen
This commit is contained in:
@@ -41,13 +41,6 @@ Steps::Steps()
|
||||
notes = NULL;
|
||||
notes_comp = NULL;
|
||||
parent = NULL;
|
||||
|
||||
for( int m=0; m<NUM_MEMORY_CARDS; m++ )
|
||||
{
|
||||
m_MemCardScores[m].iNumTimesPlayed = 0;
|
||||
m_MemCardScores[m].grade = GRADE_NO_DATA;
|
||||
m_MemCardScores[m].fScore = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Steps::~Steps()
|
||||
@@ -292,43 +285,6 @@ void Steps::SetRadarValue(int r, float val)
|
||||
}
|
||||
|
||||
|
||||
/* Make sure we treat AAAA as higher than AAA, even though the score
|
||||
* is the same.
|
||||
*
|
||||
* XXX: Isn't it possible to beat the grade but not beat the score, since
|
||||
* grading and scores are on completely different systems? Should we be
|
||||
* checking for these completely separately? */
|
||||
bool Steps::MemCardScore::HigherScore( float vsScore, Grade vsGrade ) const
|
||||
{
|
||||
if( vsScore > this->fScore )
|
||||
return true;
|
||||
if( vsScore < this->fScore )
|
||||
return false;
|
||||
return vsGrade > this->grade;
|
||||
}
|
||||
|
||||
void Steps::AddScore( PlayerNumber pn, Grade grade, float fScore, bool& bNewRecordOut )
|
||||
{
|
||||
bNewRecordOut = false;
|
||||
|
||||
m_MemCardScores[MEMORY_CARD_MACHINE].iNumTimesPlayed++;
|
||||
m_MemCardScores[pn].iNumTimesPlayed++;
|
||||
|
||||
if( m_MemCardScores[pn].HigherScore(fScore, grade) && fScore > 0)
|
||||
{
|
||||
m_MemCardScores[pn].fScore = fScore;
|
||||
m_MemCardScores[pn].grade = grade;
|
||||
bNewRecordOut = true;
|
||||
}
|
||||
|
||||
if( m_MemCardScores[MEMORY_CARD_MACHINE].HigherScore(fScore, grade) )
|
||||
{
|
||||
m_MemCardScores[MEMORY_CARD_MACHINE].fScore = fScore;
|
||||
m_MemCardScores[MEMORY_CARD_MACHINE].grade = grade;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Sorting stuff
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user