make edit sorts consistent; fix description sorting

This commit is contained in:
Glenn Maynard
2005-04-06 08:17:29 +00:00
parent f64a93bb21
commit 8d460ba70b
+4 -2
View File
@@ -87,7 +87,9 @@ bool StepsUtil::CompareNotesPointersByDifficulty(const Steps *pSteps1, const Ste
void StepsUtil::SortNotesArrayByDifficulty( vector<Steps*> &arraySteps ) void StepsUtil::SortNotesArrayByDifficulty( vector<Steps*> &arraySteps )
{ {
/* Sort in reverse order of priority. */ /* Sort in reverse order of priority. Sort by description first, to get
* a predictable order for songs with no radar values (edits). */
stable_sort( arraySteps.begin(), arraySteps.end(), CompareStepsPointersByDescription );
stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByRadarValues ); stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByRadarValues );
stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByMeter ); stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByMeter );
stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByDifficulty ); stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByDifficulty );
@@ -109,7 +111,7 @@ void StepsUtil::SortStepsByTypeAndDifficulty( vector<Steps*> &arraySongPointers
bool StepsUtil::CompareStepsPointersByDescription(const Steps *pStep1, const Steps *pStep2) bool StepsUtil::CompareStepsPointersByDescription(const Steps *pStep1, const Steps *pStep2)
{ {
return pStep1->GetDifficulty() < pStep2->GetDifficulty(); return pStep1->GetDescription().CompareNoCase( pStep2->GetDescription() ) < 0;
} }
void StepsUtil::SortStepsByDescription( vector<Steps*> &arraySongPointers ) void StepsUtil::SortStepsByDescription( vector<Steps*> &arraySongPointers )