cleanup, simplify

Separate Easy courses aren't needed anymore; just select easy course
mode.  (Having three times as many autogen courses was way too many,
especially considering most beginners don't want to play courses anyway.)
This commit is contained in:
Glenn Maynard
2004-05-20 23:14:36 +00:00
parent 49562bb4a5
commit 9dd9735532
3 changed files with 25 additions and 74 deletions
+16 -37
View File
@@ -429,7 +429,7 @@ void Course::Save()
}
void Course::AutogenEndlessFromGroup( CString sGroupName, vector<Song*> &apSongsInGroup, Difficulty diff )
void Course::AutogenEndlessFromGroup( CString sGroupName, Difficulty diff )
{
m_bIsAutogen = true;
m_bRepeat = true;
@@ -437,15 +437,24 @@ void Course::AutogenEndlessFromGroup( CString sGroupName, vector<Song*> &apSongs
m_iLives = -1;
m_iMeter[0] = m_iMeter[1] = -1;
m_sName = SONGMAN->ShortenGroupName( sGroupName ) + GetAutogenDifficultySuffix( diff );
m_sBannerPath = SONGMAN->GetGroupBannerPath( sGroupName );
if( sGroupName == "" )
{
m_sName = "All Songs";
// m_sBannerPath = ""; // XXX
} else {
m_sName = SONGMAN->ShortenGroupName( sGroupName ) + GetAutogenDifficultySuffix( diff );
m_sBannerPath = SONGMAN->GetGroupBannerPath( sGroupName );
}
// 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
CourseEntry e;
e.type = COURSE_ENTRY_RANDOM_WITHIN_GROUP;
if( sGroupName != "" )
e.type = COURSE_ENTRY_RANDOM_WITHIN_GROUP;
else
e.type = COURSE_ENTRY_RANDOM;
e.group_name = sGroupName;
e.difficulty = diff;
e.mystery = true;
@@ -456,39 +465,9 @@ void Course::AutogenEndlessFromGroup( CString sGroupName, vector<Song*> &apSongs
m_entries.push_back( e );
}
void Course::AutogenEndlessFromVector( CString sCourseName, vector<Song*> &apSongsInCourse, Difficulty diff )
void Course::AutogenNonstopFromGroup( CString sGroupName, Difficulty diff )
{
m_bIsAutogen = true;
m_bRepeat = true;
m_bRandomize = true;
m_iLives = -1;
m_iMeter[0] = m_iMeter[1] = -1;
m_sName = SONGMAN->ShortenGroupName( sCourseName ) + GetAutogenDifficultySuffix( diff );
//m_sBannerPath = SONGMAN->GetGroupBannerPath( sBannerName );
CourseEntry e;
e.type = COURSE_ENTRY_FIXED;
e.group_name = sCourseName;
e.difficulty = diff;
e.mystery = true;
for ( unsigned i = 0; i < apSongsInCourse.size(); ++i )
{
e.pSong = apSongsInCourse[i];
m_entries.push_back( e );
}
//This means that the course will be the same each time until re-init
//Currently, this is only used for the All Songs endless course, so it's
//a non-issue
//Also, it appears to be what COURSE_ENTRY_RANDOM does anyways
random_shuffle(m_entries.begin(),m_entries.end());
}
void Course::AutogenNonstopFromGroup( CString sGroupName, vector<Song*> &apSongsInGroup, Difficulty diff )
{
AutogenEndlessFromGroup( sGroupName, apSongsInGroup, diff );
AutogenEndlessFromGroup( sGroupName, diff );
m_bRepeat = false;
+2 -3
View File
@@ -139,9 +139,8 @@ public:
void LoadFromCRSFile( CString sPath );
void Unload();
void Save();
void AutogenEndlessFromGroup( CString sGroupName, vector<Song*> &apSongsInGroup, Difficulty diff );
void AutogenEndlessFromVector( CString sCourseName, vector<Song*> &apSongsInCourse, Difficulty diff );
void AutogenNonstopFromGroup( CString sGroupName, vector<Song*> &apSongsInGroup, Difficulty diff );
void AutogenEndlessFromGroup( CString sGroupName, Difficulty diff );
void AutogenNonstopFromGroup( CString sGroupName, Difficulty diff );
RadarValues GetRadarValues( StepsType st, CourseDifficulty cd ) const;
+7 -34
View File
@@ -566,55 +566,28 @@ void SongManager::InitAutogenCourses()
//
CStringArray saGroupNames;
this->GetGroupNames( saGroupNames );
unsigned g;
for( g=0; g<saGroupNames.size(); g++ ) // foreach Group
Course* pCourse;
for( unsigned g=0; g<saGroupNames.size(); g++ ) // foreach Group
{
CString sGroupName = saGroupNames[g];
vector<Song*> apGroupSongs;
GetSongs( apGroupSongs, sGroupName );
Course* pCourse;
//Generate random courses from each group for each of the main three difficulty levels
// Generate random courses from each group.
pCourse = new Course;
pCourse->AutogenEndlessFromGroup( sGroupName, apGroupSongs, DIFFICULTY_EASY );
pCourse->AutogenEndlessFromGroup( sGroupName, DIFFICULTY_MEDIUM );
m_pCourses.push_back( pCourse );
pCourse = new Course;
pCourse->AutogenEndlessFromGroup( sGroupName, apGroupSongs, DIFFICULTY_MEDIUM );
m_pCourses.push_back( pCourse );
pCourse = new Course;
pCourse->AutogenEndlessFromGroup( sGroupName, apGroupSongs, DIFFICULTY_HARD );
m_pCourses.push_back( pCourse );
pCourse = new Course;
pCourse->AutogenNonstopFromGroup( sGroupName, apGroupSongs, DIFFICULTY_EASY );
m_pCourses.push_back( pCourse );
pCourse = new Course;
pCourse->AutogenNonstopFromGroup( sGroupName, apGroupSongs, DIFFICULTY_MEDIUM );
m_pCourses.push_back( pCourse );
pCourse = new Course;
pCourse->AutogenNonstopFromGroup( sGroupName, apGroupSongs, DIFFICULTY_HARD );
pCourse->AutogenNonstopFromGroup( sGroupName, DIFFICULTY_MEDIUM );
m_pCourses.push_back( pCourse );
}
vector<Song*> apCourseSongs = GetAllSongs();
Course* pCourse;
//Generate "All Songs" endless course
// Generate "All Songs" endless course.
pCourse = new Course;
pCourse->AutogenEndlessFromVector( "All Groups", apCourseSongs, DIFFICULTY_EASY );
m_pCourses.push_back( pCourse );
pCourse = new Course;
pCourse->AutogenEndlessFromVector( "All Groups", apCourseSongs, DIFFICULTY_MEDIUM );
m_pCourses.push_back( pCourse );
pCourse = new Course;
pCourse->AutogenEndlessFromVector( "All Groups", apCourseSongs, DIFFICULTY_HARD );
pCourse->AutogenEndlessFromGroup( "", DIFFICULTY_MEDIUM );
m_pCourses.push_back( pCourse );
}