Add an entry per song for endless courses, to reduce repetition.

Improve IsPlayableIn.
This commit is contained in:
Glenn Maynard
2003-02-24 00:58:04 +00:00
parent bed2c0a74b
commit fff1449239
+17 -3
View File
@@ -267,11 +267,18 @@ void Course::AutoGenEndlessFromGroupAndDifficulty( CString sGroupName, Difficult
} }
// only need one song because it repeats // only need one song because it repeats
// We want multiple songs, so we can try to prevent repeats during
// gameplay. (We might still get a repeat at the repeat boundary,
// but that'd be rare.) -glenn
Entry e; Entry e;
e.type = Entry::random_within_group; e.type = Entry::random_within_group;
e.group_name = sGroupName; e.group_name = sGroupName;
e.difficulty = dc; e.difficulty = dc;
m_entries.push_back( e );
vector<Song*> vSongs;
SONGMAN->GetSongs( vSongs, e.group_name );
for( unsigned i = 0; i < vSongs.size(); ++i)
m_entries.push_back( e );
} }
@@ -285,8 +292,15 @@ bool Course::HasDifficult() const
bool Course::IsPlayableIn( NotesType nt ) const bool Course::IsPlayableIn( NotesType nt ) const
{ {
// TODO: something smarter here /* XXX: Is this good enough? This needs to be guaranteed: if we say
return m_entries.size() > 0; * a course is playable and it's not, we'll crash in ScreenGameplay. */
vector<Song*> vSongs;
vector<Notes*> vNotes;
vector<CString> vsModifiers;
GetStageInfo( vSongs, vNotes, vsModifiers, nt, false);
return vNotes.size() > 0;
} }