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