split HighScore to separate file

move score data from ProfileManager to Profile
store score data in XML for easier forward/backward compatibility
This commit is contained in:
Chris Danford
2004-02-10 09:42:01 +00:00
parent 0196abe99b
commit 4f439be739
25 changed files with 1727 additions and 1337 deletions
+10 -1
View File
@@ -1369,8 +1369,17 @@ bool CompareSongPointersBySortValueDescending(const Song *pSong1, const Song *pS
void SortSongPointerArrayByMostPlayed( vector<Song*> &arraySongPointers, ProfileSlot slot )
{
Profile* pProfile = PROFILEMAN->GetProfile(slot);
if( pProfile == NULL )
return; // nothing to do since we don't have data
SortSongPointerArrayByMostPlayed( arraySongPointers, pProfile );
}
void SortSongPointerArrayByMostPlayed( vector<Song*> &arraySongPointers, Profile* pProfile )
{
ASSERT( pProfile );
for(unsigned i = 0; i < arraySongPointers.size(); ++i)
song_sort_val[arraySongPointers[i]] = ssprintf("%9i", PROFILEMAN->GetSongNumTimesPlayed(arraySongPointers[i],slot));
song_sort_val[arraySongPointers[i]] = ssprintf("%9i", pProfile->GetSongNumTimesPlayed(arraySongPointers[i]));
stable_sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersBySortValueDescending );
song_sort_val.clear();
}