More loops here.

This commit is contained in:
Jason Felds
2013-05-01 23:17:51 -04:00
parent 66ee0769cc
commit bf2f771fd1
+26 -20
View File
@@ -94,13 +94,19 @@ ScreenDebugOverlay::~ScreenDebugOverlay()
{ {
this->RemoveAllChildren(); this->RemoveAllChildren();
FOREACH( BitmapText*, m_vptextPages, p ) for (BitmapText *p : m_vptextPages)
SAFE_DELETE( *p ); {
FOREACH( BitmapText*, m_vptextButton, p ) SAFE_DELETE(p);
SAFE_DELETE( *p ); }
for (BitmapText *p : m_vptextButton)
{
SAFE_DELETE(p);
}
m_vptextButton.clear(); m_vptextButton.clear();
FOREACH( BitmapText*, m_vptextFunction, p ) for (BitmapText *p : m_vptextFunction)
SAFE_DELETE( *p ); {
SAFE_DELETE(p);
}
m_vptextFunction.clear(); m_vptextFunction.clear();
} }
@@ -215,12 +221,12 @@ void ScreenDebugOverlay::Init()
map<RString,int> iNextDebugButton; map<RString,int> iNextDebugButton;
int iNextGameplayButton = 0; int iNextGameplayButton = 0;
FOREACH( IDebugLine*, *g_pvpSubscribers, p ) for (IDebugLine *p : *g_pvpSubscribers)
{ {
RString sPageName = (*p)->GetPageName(); RString sPageName = p->GetPageName();
DeviceInput di; DeviceInput di;
switch( (*p)->GetType() ) switch( p->GetType() )
{ {
case IDebugLine::all_screens: case IDebugLine::all_screens:
di = g_Mappings.debugButton[iNextDebugButton[sPageName]++]; di = g_Mappings.debugButton[iNextDebugButton[sPageName]++];
@@ -229,7 +235,7 @@ void ScreenDebugOverlay::Init()
di = g_Mappings.gameplayButton[iNextGameplayButton++]; di = g_Mappings.gameplayButton[iNextGameplayButton++];
break; break;
} }
(*p)->m_Button = di; p->m_Button = di;
if( find(m_asPages.begin(), m_asPages.end(), sPageName) == m_asPages.end() ) if( find(m_asPages.begin(), m_asPages.end(), sPageName) == m_asPages.end() )
m_asPages.push_back( sPageName ); m_asPages.push_back( sPageName );
@@ -883,35 +889,35 @@ static void FillProfileStats( Profile *pProfile )
PREFSMAN->m_iMaxHighScoresPerListForPlayer.Get(); PREFSMAN->m_iMaxHighScoresPerListForPlayer.Get();
vector<Song*> vpAllSongs = SONGMAN->GetAllSongs(); vector<Song*> vpAllSongs = SONGMAN->GetAllSongs();
FOREACH( Song*, vpAllSongs, pSong ) for (Song const *pSong : vpAllSongs)
{ {
vector<Steps*> vpAllSteps = (*pSong)->GetAllSteps(); vector<Steps*> vpAllSteps = pSong->GetAllSteps();
FOREACH( Steps*, vpAllSteps, pSteps ) for (Steps const *pSteps : vpAllSteps)
{ {
if( rand() % 5 ) if( rand() % 5 )
pProfile->IncrementStepsPlayCount( *pSong, *pSteps ); pProfile->IncrementStepsPlayCount( pSong, pSteps );
for( int i=0; i<iCount; i++ ) for( int i=0; i<iCount; i++ )
{ {
int iIndex = 0; int iIndex = 0;
pProfile->AddStepsHighScore( *pSong, *pSteps, MakeRandomHighScore(fPercentDP), iIndex ); pProfile->AddStepsHighScore( pSong, pSteps, MakeRandomHighScore(fPercentDP), iIndex );
} }
} }
} }
vector<Course*> vpAllCourses; vector<Course*> vpAllCourses;
SONGMAN->GetAllCourses( vpAllCourses, true ); SONGMAN->GetAllCourses( vpAllCourses, true );
FOREACH( Course*, vpAllCourses, pCourse ) for (Course const *pCourse : vpAllCourses)
{ {
vector<Trail*> vpAllTrails; vector<Trail*> vpAllTrails;
(*pCourse)->GetAllTrails( vpAllTrails ); pCourse->GetAllTrails( vpAllTrails );
FOREACH( Trail*, vpAllTrails, pTrail ) for (Trail const *pTrail : vpAllTrails)
{ {
if( rand() % 5 ) if( rand() % 5 )
pProfile->IncrementCoursePlayCount( *pCourse, *pTrail ); pProfile->IncrementCoursePlayCount( pCourse, pTrail );
for( int i=0; i<iCount; i++ ) for( int i=0; i<iCount; i++ )
{ {
int iIndex = 0; int iIndex = 0;
pProfile->AddCourseHighScore( *pCourse, *pTrail, MakeRandomHighScore(fPercentDP), iIndex ); pProfile->AddCourseHighScore( pCourse, pTrail, MakeRandomHighScore(fPercentDP), iIndex );
} }
} }
} }