Add Song::SongHasNoteType, moved from ScreenSelectGroup.
This commit is contained in:
@@ -78,25 +78,13 @@ ScreenSelectGroup::ScreenSelectGroup()
|
||||
aAllSongs.Copy( SONGMAN->m_pSongs );
|
||||
|
||||
// Filter out Songs that can't be played by the current Style
|
||||
NotesType nt = GAMESTATE->GetCurrentStyleDef()->m_NotesType;
|
||||
|
||||
for( i=aAllSongs.GetSize()-1; i>=0; i-- ) // foreach Song, back to front
|
||||
{
|
||||
Song* pSong = aAllSongs[i];
|
||||
|
||||
bool bSongCanBePlayedByCurrentStyle = false;
|
||||
for( int j=0; j<pSong->m_apNotes.GetSize(); j++ ) // foreach Notes
|
||||
NotesType nt = GAMESTATE->GetCurrentStyleDef()->m_NotesType;
|
||||
for( i=aAllSongs.GetSize()-1; i>=0; i-- ) // foreach Song, back to front
|
||||
{
|
||||
Notes* pNotes = pSong->m_apNotes[j];
|
||||
|
||||
if( pNotes->m_NotesType == nt )
|
||||
{
|
||||
bSongCanBePlayedByCurrentStyle = true;
|
||||
break;
|
||||
}
|
||||
if( !aAllSongs[i]->SongHasNoteType(nt) )
|
||||
aAllSongs.RemoveAt( i );
|
||||
}
|
||||
if( !bSongCanBePlayedByCurrentStyle )
|
||||
aAllSongs.RemoveAt( i );
|
||||
}
|
||||
|
||||
// Get group names by thowing them into a hash
|
||||
|
||||
@@ -1212,6 +1212,17 @@ void Song::GetNotesThatMatch( NotesType nt, CArray<Notes*, Notes*>& arrayAddTo )
|
||||
arrayAddTo.Add( m_apNotes[i] );
|
||||
}
|
||||
|
||||
bool Song::SongHasNoteType( NotesType nt ) const
|
||||
{
|
||||
for( int i=0; i < m_apNotes.GetSize(); i++ ) // foreach Notes
|
||||
{
|
||||
if( m_apNotes[i]->m_NotesType == nt )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Song::SaveToCacheFile()
|
||||
{
|
||||
LOG->Trace( "Song::SaveToCacheFile()" );
|
||||
|
||||
@@ -156,6 +156,7 @@ public:
|
||||
|
||||
CArray<Notes*, Notes*> m_apNotes;
|
||||
|
||||
bool SongHasNoteType( NotesType nt ) const;
|
||||
void GetNotesThatMatch( NotesType nt, CArray<Notes*, Notes*>& arrayAddTo );
|
||||
int GetNumTimesPlayed()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user