fixed EditMenu "Create from Autogen" weirdness

cleaned up some unnecessary header dependencies
This commit is contained in:
Chris Danford
2003-02-22 01:58:56 +00:00
parent 87c9516cc0
commit fc2108e85d
17 changed files with 83 additions and 84 deletions
+37 -43
View File
@@ -140,43 +140,6 @@ void Notes::TidyUpData()
}
}
//////////////////////////////////////////////
//
//////////////////////////////////////////////
bool CompareNotesPointersByRadarValues(const Notes* pNotes1, const Notes* pNotes2)
{
float fScore1 = 0;
float fScore2 = 0;
for( int r=0; r<NUM_RADAR_CATEGORIES; r++ )
{
fScore1 += pNotes1->GetRadarValues()[r];
fScore2 += pNotes2->GetRadarValues()[r];
}
return fScore1 < fScore2;
}
bool CompareNotesPointersByMeter(const Notes *pNotes1, const Notes* pNotes2)
{
return pNotes1->GetMeter() < pNotes2->GetMeter();
}
bool CompareNotesPointersByDifficulty(const Notes *pNotes1, const Notes *pNotes2)
{
return pNotes1->GetDifficulty() < pNotes2->GetDifficulty();
}
void SortNotesArrayByDifficulty( vector<Notes*> &arraySteps )
{
/* Sort in reverse order of priority. */
stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByRadarValues );
stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByMeter );
stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByDifficulty );
}
void Notes::Decompress() const
{
if(notes) return;
@@ -246,12 +209,6 @@ void Notes::AutogenFrom( Notes *parent_, NotesType ntTo )
m_NotesType = ntTo;
}
void Notes::BakeAutoGen()
{
Decompress();
parent = NULL;
}
void Notes::CopyFrom( Notes* pSource, NotesType ntTo ) // pSource does not have to be of the same NotesType!
{
m_NotesType = ntTo;
@@ -333,3 +290,40 @@ void Notes::AddScore( PlayerNumber pn, Grade grade, float fScore, bool& bNewReco
m_MemCardScores[MEMORY_CARD_MACHINE].grade = grade;
}
}
//
// Sorting stuff
//
bool CompareNotesPointersByRadarValues(const Notes* pNotes1, const Notes* pNotes2)
{
float fScore1 = 0;
float fScore2 = 0;
for( int r=0; r<NUM_RADAR_CATEGORIES; r++ )
{
fScore1 += pNotes1->GetRadarValues()[r];
fScore2 += pNotes2->GetRadarValues()[r];
}
return fScore1 < fScore2;
}
bool CompareNotesPointersByMeter(const Notes *pNotes1, const Notes* pNotes2)
{
return pNotes1->GetMeter() < pNotes2->GetMeter();
}
bool CompareNotesPointersByDifficulty(const Notes *pNotes1, const Notes *pNotes2)
{
return pNotes1->GetDifficulty() < pNotes2->GetDifficulty();
}
void SortNotesArrayByDifficulty( vector<Notes*> &arraySteps )
{
/* Sort in reverse order of priority. */
stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByRadarValues );
stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByMeter );
stable_sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByDifficulty );
}