use accessors
This commit is contained in:
@@ -182,8 +182,8 @@ void Course::CreateEndlessCourseFromGroupAndDifficulty( CString sGroupName, Diff
|
||||
void Course::Shuffle()
|
||||
{
|
||||
/* Shuffle the list. */
|
||||
for( int i = 0; i < m_iStages; ++i)
|
||||
swap(SongOrdering[i], SongOrdering[rand() % m_iStages]);
|
||||
for( int i = 0; i < GetNumStages(); ++i)
|
||||
swap(SongOrdering[i], SongOrdering[rand() % GetNumStages()]);
|
||||
}
|
||||
|
||||
Notes* Course::GetNotesForStage( int iStage )
|
||||
@@ -249,7 +249,7 @@ void Course::GetSongAndNotesForCurrentStyle(
|
||||
CStringArray& asModifiersOut,
|
||||
bool bShuffled )
|
||||
{
|
||||
for( int i=0; i<m_iStages; i++ )
|
||||
for( int i=0; i<GetNumStages(); i++ )
|
||||
{
|
||||
int num = bShuffled? SongOrdering[i]:i;
|
||||
|
||||
@@ -271,9 +271,9 @@ void Course::GetSongAndNotesForCurrentStyle(
|
||||
RageColor Course::GetColor()
|
||||
{
|
||||
// This could be made smarter
|
||||
if( m_iStages >= 7 )
|
||||
if( GetNumStages() >= 7 )
|
||||
return RageColor(1,0,0,1); // red
|
||||
else if( m_iStages >= 4 )
|
||||
else if( GetNumStages() >= 4 )
|
||||
return RageColor(1,0.5f,0,1); // orange
|
||||
else
|
||||
return RageColor(0,1,0,1); // green
|
||||
@@ -303,7 +303,7 @@ int Course::GetNumStages() const
|
||||
|
||||
static int CompareCoursePointersByDifficulty(const Course* pCourse1, const Course* pCourse2)
|
||||
{
|
||||
return pCourse1->m_iStages < pCourse2->m_iStages;
|
||||
return pCourse1->GetNumStages() < pCourse2->GetNumStages();
|
||||
}
|
||||
|
||||
void SortCoursePointerArrayByDifficulty( CArray<Course*,Course*> &apCourses )
|
||||
|
||||
@@ -102,7 +102,7 @@ void CourseContentsFrame::SetFromCourse( Course* pCourse )
|
||||
|
||||
m_iNumContents = 0;
|
||||
|
||||
for( int i=0; i<min(pCourse->m_iStages, MAX_TOTAL_CONTENTS); i++ )
|
||||
for( int i=0; i<min(pCourse->GetNumStages(), MAX_TOTAL_CONTENTS); i++ )
|
||||
{
|
||||
Song* pSong = pCourse->GetSong(i);
|
||||
Notes* pNotes = pCourse->GetNotesForStage(i);
|
||||
|
||||
@@ -1029,7 +1029,7 @@ void SaveChanges()
|
||||
case PLAY_MODE_ONI:
|
||||
case PLAY_MODE_ENDLESS:
|
||||
{
|
||||
for( int i=0; i<GAMESTATE->m_pCurCourse->m_iStages; i++ )
|
||||
for( int i=0; i<GAMESTATE->m_pCurCourse->GetNumStages(); i++ )
|
||||
{
|
||||
Song* pSong = GAMESTATE->m_pCurCourse->GetSong(i);
|
||||
pSong->Save();
|
||||
@@ -1053,7 +1053,7 @@ void DontSaveChanges()
|
||||
case PLAY_MODE_ONI:
|
||||
case PLAY_MODE_ENDLESS:
|
||||
{
|
||||
for( int i=0; i<GAMESTATE->m_pCurCourse->m_iStages; i++ )
|
||||
for( int i=0; i<GAMESTATE->m_pCurCourse->GetNumStages(); i++ )
|
||||
{
|
||||
Song* pSong = GAMESTATE->m_pCurCourse->GetSong(i);
|
||||
ld.LoadFromSMFile( GAMESTATE->m_pCurSong->GetCacheFilePath(), *pSong );
|
||||
|
||||
@@ -329,9 +329,9 @@ void ScreenSelectCourse::AfterCourseChange()
|
||||
{
|
||||
Course* pCourse = m_MusicWheel.GetSelectedCourse();
|
||||
|
||||
m_textNumSongs.SetText( ssprintf("%d", pCourse->m_iStages) );
|
||||
m_textNumSongs.SetText( ssprintf("%d", pCourse->GetNumStages()) );
|
||||
float fTotalSeconds = 0;
|
||||
for( int i=0; i<pCourse->m_iStages; i++ )
|
||||
for( int i=0; i<pCourse->GetNumStages(); i++ )
|
||||
fTotalSeconds += pCourse->GetSong(i)->m_fMusicLengthSeconds;
|
||||
m_textTime.SetText( SecondsToTime(fTotalSeconds) );
|
||||
|
||||
|
||||
@@ -459,7 +459,7 @@ void SongManager::InitCoursesFromDisk()
|
||||
{
|
||||
Course course;
|
||||
course.LoadFromCRSFile( "Courses\\" + saCourseFiles[i], m_pSongs );
|
||||
if( course.m_iStages > 0 )
|
||||
if( course.GetNumStages() > 0 )
|
||||
m_aOniCourses.push_back( course );
|
||||
}
|
||||
|
||||
@@ -480,7 +480,7 @@ void SongManager::InitCoursesFromDisk()
|
||||
Course course;
|
||||
course.CreateEndlessCourseFromGroupAndDifficulty( sGroupName, dc, apGroupSongs );
|
||||
|
||||
if( course.m_iStages > 0 )
|
||||
if( course.GetNumStages() > 0 )
|
||||
m_aEndlessCourses.push_back( course );
|
||||
}
|
||||
}
|
||||
@@ -498,7 +498,7 @@ void SongManager::InitCoursesFromDisk()
|
||||
{
|
||||
Course course;
|
||||
course.LoadFromCRSFile( saCoursePaths[i], m_pSongs );
|
||||
if( course.m_iStages > 0 )
|
||||
if( course.GetNumStages() > 0 )
|
||||
m_aExtraCourses.push_back( course );
|
||||
}
|
||||
}
|
||||
@@ -520,7 +520,7 @@ bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, CString sPreferredG
|
||||
|
||||
Course course;
|
||||
course.LoadFromCRSFile( sCoursePath, m_pSongs );
|
||||
if( course.m_iStages <= 0 ) return false;
|
||||
if( course.GetNumStages() <= 0 ) return false;
|
||||
|
||||
pSongOut = course.GetSong(0);
|
||||
pNotesOut = course.GetNotesForStage( 0 );
|
||||
|
||||
Reference in New Issue
Block a user