Remove global "using namespace std;" declarations, use "std::" prefixes on all std elements
Fix whitespace changes
This commit is contained in:
committed by
Martin Natano
parent
f0680a29fc
commit
0cba3579de
+45
-45
@@ -91,7 +91,7 @@ void OptionRowHandler::GetIconTextAndGameCommand( int iFirstSelection, RString &
|
||||
gcOut.Init();
|
||||
}
|
||||
|
||||
void OptionRowHandlerUtil::SelectExactlyOne( int iSelection, vector<bool> &vbSelectedOut )
|
||||
void OptionRowHandlerUtil::SelectExactlyOne( int iSelection, std::vector<bool> &vbSelectedOut )
|
||||
{
|
||||
ASSERT_M( iSelection >= 0 && iSelection < (int) vbSelectedOut.size(),
|
||||
ssprintf("%d/%u",iSelection, unsigned(vbSelectedOut.size())) );
|
||||
@@ -99,7 +99,7 @@ void OptionRowHandlerUtil::SelectExactlyOne( int iSelection, vector<bool> &vbSel
|
||||
vbSelectedOut[i] = i==iSelection;
|
||||
}
|
||||
|
||||
int OptionRowHandlerUtil::GetOneSelection( const vector<bool> &vbSelected )
|
||||
int OptionRowHandlerUtil::GetOneSelection( const std::vector<bool> &vbSelected )
|
||||
{
|
||||
int iRet = -1;
|
||||
for( unsigned i=0; i<vbSelected.size(); i++ )
|
||||
@@ -132,10 +132,10 @@ static LocalizedString OFF ( "OptionRowHandler", "Off" );
|
||||
class OptionRowHandlerList : public OptionRowHandler
|
||||
{
|
||||
public:
|
||||
vector<GameCommand> m_aListEntries;
|
||||
std::vector<GameCommand> m_aListEntries;
|
||||
GameCommand m_Default;
|
||||
bool m_bUseModNameForIcon;
|
||||
vector<RString> m_vsBroadcastOnExport;
|
||||
std::vector<RString> m_vsBroadcastOnExport;
|
||||
|
||||
OptionRowHandlerList() { Init(); }
|
||||
virtual void Init()
|
||||
@@ -244,11 +244,11 @@ public:
|
||||
}
|
||||
return true;
|
||||
}
|
||||
void ImportOption( OptionRow *pRow, const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
|
||||
void ImportOption( OptionRow *pRow, const std::vector<PlayerNumber> &vpns, std::vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
|
||||
{
|
||||
for (PlayerNumber const &p : vpns)
|
||||
{
|
||||
vector<bool> &vbSelOut = vbSelectedOut[p];
|
||||
std::vector<bool> &vbSelOut = vbSelectedOut[p];
|
||||
|
||||
bool bUseFallbackOption = true;
|
||||
|
||||
@@ -309,11 +309,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
int ExportOption( const vector<PlayerNumber> &vpns, const vector<bool> vbSelected[NUM_PLAYERS] ) const
|
||||
int ExportOption( const std::vector<PlayerNumber> &vpns, const std::vector<bool> vbSelected[NUM_PLAYERS] ) const
|
||||
{
|
||||
for (PlayerNumber const &p : vpns)
|
||||
{
|
||||
const vector<bool> &vbSel = vbSelected[p];
|
||||
const std::vector<bool> &vbSel = vbSelected[p];
|
||||
|
||||
m_Default.Apply( p );
|
||||
for( unsigned i=0; i<vbSel.size(); i++ )
|
||||
@@ -356,15 +356,15 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
static void SortNoteSkins( vector<RString> &asSkinNames )
|
||||
static void SortNoteSkins( std::vector<RString> &asSkinNames )
|
||||
{
|
||||
set<RString> setSkinNames;
|
||||
std::set<RString> setSkinNames;
|
||||
setSkinNames.insert( asSkinNames.begin(), asSkinNames.end() );
|
||||
|
||||
vector<RString> asSorted;
|
||||
std::vector<RString> asSorted;
|
||||
split( NOTE_SKIN_SORT_ORDER, ",", asSorted );
|
||||
|
||||
set<RString> setUnusedSkinNames( setSkinNames );
|
||||
std::set<RString> setUnusedSkinNames( setSkinNames );
|
||||
asSkinNames.clear();
|
||||
|
||||
for (RString const &sSkin : asSorted)
|
||||
@@ -386,7 +386,7 @@ class OptionRowHandlerListNoteSkins : public OptionRowHandlerList
|
||||
m_Def.m_bOneChoiceForAllPlayers = false;
|
||||
m_Def.m_bAllowThemeItems = false; // we theme the text ourself
|
||||
|
||||
vector<RString> arraySkinNames;
|
||||
std::vector<RString> arraySkinNames;
|
||||
NOTESKIN->GetNoteSkinNames( arraySkinNames );
|
||||
SortNoteSkins( arraySkinNames );
|
||||
|
||||
@@ -438,7 +438,7 @@ class OptionRowHandlerListSteps : public OptionRowHandlerList
|
||||
m_Def.m_bOneChoiceForAllPlayers = (bool)PREFSMAN->m_bLockCourseDifficulties;
|
||||
m_Def.m_layoutType = StringToLayoutType( STEPS_ROW_LAYOUT_TYPE );
|
||||
|
||||
vector<Trail*> vTrails;
|
||||
std::vector<Trail*> vTrails;
|
||||
GAMESTATE->m_pCurCourse->GetTrails( vTrails, GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StepsType );
|
||||
for( unsigned i=0; i<vTrails.size(); i++ )
|
||||
{
|
||||
@@ -456,7 +456,7 @@ class OptionRowHandlerListSteps : public OptionRowHandlerList
|
||||
{
|
||||
m_Def.m_layoutType = StringToLayoutType( STEPS_ROW_LAYOUT_TYPE );
|
||||
|
||||
vector<Steps*> vpSteps;
|
||||
std::vector<Steps*> vpSteps;
|
||||
Song *pSong = GAMESTATE->m_pCurSong;
|
||||
SongUtil::GetSteps( pSong, vpSteps, GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StepsType );
|
||||
StepsUtil::RemoveLockedSteps( pSong, vpSteps );
|
||||
@@ -517,8 +517,8 @@ public:
|
||||
BroadcastOnChangePtr<Steps> *m_ppStepsToFill;
|
||||
BroadcastOnChange<Difficulty> *m_pDifficultyToFill;
|
||||
const BroadcastOnChange<StepsType> *m_pst;
|
||||
vector<Steps*> m_vSteps;
|
||||
vector<Difficulty> m_vDifficulties;
|
||||
std::vector<Steps*> m_vSteps;
|
||||
std::vector<Difficulty> m_vDifficulties;
|
||||
|
||||
OptionRowHandlerSteps() { Init(); }
|
||||
void Init()
|
||||
@@ -618,16 +618,16 @@ public:
|
||||
m_ppStepsToFill->Set( m_vSteps[0] );
|
||||
return true;
|
||||
}
|
||||
virtual void ImportOption( OptionRow *pRow, const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
|
||||
virtual void ImportOption( OptionRow *pRow, const std::vector<PlayerNumber> &vpns, std::vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
|
||||
{
|
||||
for (PlayerNumber const &p : vpns)
|
||||
{
|
||||
vector<bool> &vbSelOut = vbSelectedOut[p];
|
||||
std::vector<bool> &vbSelOut = vbSelectedOut[p];
|
||||
|
||||
ASSERT( m_vSteps.size() == vbSelOut.size() );
|
||||
|
||||
// look for matching steps
|
||||
vector<Steps*>::const_iterator iter = find( m_vSteps.begin(), m_vSteps.end(), m_ppStepsToFill->Get() );
|
||||
std::vector<Steps*>::const_iterator iter = find( m_vSteps.begin(), m_vSteps.end(), m_ppStepsToFill->Get() );
|
||||
if( iter != m_vSteps.end() )
|
||||
{
|
||||
unsigned i = iter - m_vSteps.begin();
|
||||
@@ -639,14 +639,14 @@ public:
|
||||
if( m_pDifficultyToFill )
|
||||
{
|
||||
// use the old style for now.
|
||||
for (vector<Difficulty>::const_iterator d = m_vDifficulties.begin(); d != m_vDifficulties.end(); ++d)
|
||||
for (std::vector<Difficulty>::const_iterator d = m_vDifficulties.begin(); d != m_vDifficulties.end(); ++d)
|
||||
{
|
||||
unsigned i = d - m_vDifficulties.begin();
|
||||
if( *d == GAMESTATE->m_PreferredDifficulty[p] )
|
||||
{
|
||||
vbSelOut[i] = true;
|
||||
matched= true;
|
||||
vector<PlayerNumber> v;
|
||||
std::vector<PlayerNumber> v;
|
||||
v.push_back( p );
|
||||
ExportOption( v, vbSelectedOut ); // current steps changed
|
||||
break;
|
||||
@@ -660,11 +660,11 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual int ExportOption( const vector<PlayerNumber> &vpns, const vector<bool> vbSelected[NUM_PLAYERS] ) const
|
||||
virtual int ExportOption( const std::vector<PlayerNumber> &vpns, const std::vector<bool> vbSelected[NUM_PLAYERS] ) const
|
||||
{
|
||||
for (PlayerNumber const &p : vpns)
|
||||
{
|
||||
const vector<bool> &vbSel = vbSelected[p];
|
||||
const std::vector<bool> &vbSel = vbSelected[p];
|
||||
|
||||
int index = OptionRowHandlerUtil::GetOneSelection( vbSel );
|
||||
Difficulty dc = m_vDifficulties[index];
|
||||
@@ -695,7 +695,7 @@ class OptionRowHandlerListCharacters: public OptionRowHandlerList
|
||||
m_aListEntries.push_back( mc );
|
||||
}
|
||||
|
||||
vector<Character*> vpCharacters;
|
||||
std::vector<Character*> vpCharacters;
|
||||
CHARMAN->GetCharacters( vpCharacters );
|
||||
for( unsigned i=0; i<vpCharacters.size(); i++ )
|
||||
{
|
||||
@@ -720,7 +720,7 @@ class OptionRowHandlerListStyles: public OptionRowHandlerList
|
||||
m_Def.m_sName = "Style";
|
||||
m_Def.m_bAllowThemeItems = false; // we theme the text ourself
|
||||
|
||||
vector<const Style*> vStyles;
|
||||
std::vector<const Style*> vStyles;
|
||||
GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vStyles );
|
||||
ASSERT( vStyles.size() != 0 );
|
||||
for (Style const *s : vStyles)
|
||||
@@ -745,7 +745,7 @@ class OptionRowHandlerListGroups: public OptionRowHandlerList
|
||||
m_Def.m_sName = "Group";
|
||||
m_Default.m_sSongGroup = GROUP_ALL;
|
||||
|
||||
vector<RString> vSongGroups;
|
||||
std::vector<RString> vSongGroups;
|
||||
SONGMAN->GetSongGroupNames( vSongGroups );
|
||||
ASSERT( vSongGroups.size() != 0 );
|
||||
|
||||
@@ -803,7 +803,7 @@ class OptionRowHandlerListSongsInCurrentSongGroup: public OptionRowHandlerList
|
||||
{
|
||||
virtual bool LoadInternal( const Commands & )
|
||||
{
|
||||
const vector<Song*> &vpSongs = SONGMAN->GetSongs( GAMESTATE->m_sPreferredSongGroup );
|
||||
const std::vector<Song*> &vpSongs = SONGMAN->GetSongs( GAMESTATE->m_sPreferredSongGroup );
|
||||
|
||||
if( GAMESTATE->m_pCurSong == nullptr )
|
||||
GAMESTATE->m_pCurSong.Set( vpSongs[0] );
|
||||
@@ -1161,7 +1161,7 @@ public:
|
||||
return effect;
|
||||
}
|
||||
|
||||
virtual void ImportOption( OptionRow *pRow, const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
|
||||
virtual void ImportOption( OptionRow *pRow, const std::vector<PlayerNumber> &vpns, std::vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
|
||||
{
|
||||
if(!m_TableIsSane)
|
||||
{
|
||||
@@ -1173,7 +1173,7 @@ public:
|
||||
|
||||
for (PlayerNumber const &p : vpns)
|
||||
{
|
||||
vector<bool> &vbSelOut = vbSelectedOut[p];
|
||||
std::vector<bool> &vbSelOut = vbSelectedOut[p];
|
||||
|
||||
/* Evaluate the LoadSelections(self,array,pn) function, where
|
||||
* array is a table representing vbSelectedOut. */
|
||||
@@ -1218,7 +1218,7 @@ public:
|
||||
|
||||
LUA->Release(L);
|
||||
}
|
||||
virtual int ExportOption( const vector<PlayerNumber> &vpns, const vector<bool> vbSelected[NUM_PLAYERS] ) const
|
||||
virtual int ExportOption( const std::vector<PlayerNumber> &vpns, const std::vector<bool> vbSelected[NUM_PLAYERS] ) const
|
||||
{
|
||||
if(!m_TableIsSane)
|
||||
{
|
||||
@@ -1231,12 +1231,12 @@ public:
|
||||
int effects = 0;
|
||||
for (PlayerNumber const &p : vpns)
|
||||
{
|
||||
const vector<bool> &vbSel = vbSelected[p];
|
||||
const std::vector<bool> &vbSel = vbSelected[p];
|
||||
|
||||
/* Evaluate SaveSelections(self,array,pn) function, where array is
|
||||
* a table representing vbSelectedOut. */
|
||||
|
||||
vector<bool> vbSelectedCopy = vbSel;
|
||||
std::vector<bool> vbSelectedCopy = vbSel;
|
||||
|
||||
// Create the vbSelectedOut table.
|
||||
LuaHelpers::CreateTableFromArrayB( L, vbSelectedCopy );
|
||||
@@ -1361,23 +1361,23 @@ public:
|
||||
m_Def.m_sName = m_pOpt->name;
|
||||
return true;
|
||||
}
|
||||
virtual void ImportOption( OptionRow *, const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
|
||||
virtual void ImportOption( OptionRow *, const std::vector<PlayerNumber> &vpns, std::vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
|
||||
{
|
||||
for (PlayerNumber const &p : vpns)
|
||||
{
|
||||
vector<bool> &vbSelOut = vbSelectedOut[p];
|
||||
std::vector<bool> &vbSelOut = vbSelectedOut[p];
|
||||
|
||||
int iSelection = m_pOpt->Get();
|
||||
OptionRowHandlerUtil::SelectExactlyOne( iSelection, vbSelOut );
|
||||
}
|
||||
}
|
||||
virtual int ExportOption( const vector<PlayerNumber> &vpns, const vector<bool> vbSelected[NUM_PLAYERS] ) const
|
||||
virtual int ExportOption( const std::vector<PlayerNumber> &vpns, const std::vector<bool> vbSelected[NUM_PLAYERS] ) const
|
||||
{
|
||||
bool bChanged = false;
|
||||
|
||||
for (PlayerNumber const &p : vpns)
|
||||
{
|
||||
const vector<bool> &vbSel = vbSelected[p];
|
||||
const std::vector<bool> &vbSel = vbSelected[p];
|
||||
|
||||
int iSel = OptionRowHandlerUtil::GetOneSelection(vbSel);
|
||||
|
||||
@@ -1403,7 +1403,7 @@ class OptionRowHandlerStepsType : public OptionRowHandler
|
||||
{
|
||||
public:
|
||||
BroadcastOnChange<StepsType> *m_pstToFill;
|
||||
vector<StepsType> m_vStepsTypesToShow;
|
||||
std::vector<StepsType> m_vStepsTypesToShow;
|
||||
|
||||
OptionRowHandlerStepsType() { Init(); }
|
||||
void Init()
|
||||
@@ -1458,16 +1458,16 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void ImportOption( OptionRow *pRow, const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
|
||||
virtual void ImportOption( OptionRow *pRow, const std::vector<PlayerNumber> &vpns, std::vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
|
||||
{
|
||||
for (PlayerNumber const &p : vpns)
|
||||
{
|
||||
vector<bool> &vbSelOut = vbSelectedOut[p];
|
||||
std::vector<bool> &vbSelOut = vbSelectedOut[p];
|
||||
|
||||
if( GAMESTATE->m_pCurSteps[0] )
|
||||
{
|
||||
StepsType st = GAMESTATE->m_pCurSteps[0]->m_StepsType;
|
||||
vector<StepsType>::const_iterator iter = find( m_vStepsTypesToShow.begin(), m_vStepsTypesToShow.end(), st );
|
||||
std::vector<StepsType>::const_iterator iter = find( m_vStepsTypesToShow.begin(), m_vStepsTypesToShow.end(), st );
|
||||
if( iter != m_vStepsTypesToShow.end() )
|
||||
{
|
||||
unsigned i = iter - m_vStepsTypesToShow.begin();
|
||||
@@ -1478,11 +1478,11 @@ public:
|
||||
vbSelOut[0] = true;
|
||||
}
|
||||
}
|
||||
virtual int ExportOption( const vector<PlayerNumber> &vpns, const vector<bool> vbSelected[NUM_PLAYERS] ) const
|
||||
virtual int ExportOption( const std::vector<PlayerNumber> &vpns, const std::vector<bool> vbSelected[NUM_PLAYERS] ) const
|
||||
{
|
||||
for (PlayerNumber const &p : vpns)
|
||||
{
|
||||
const vector<bool> &vbSel = vbSelected[p];
|
||||
const std::vector<bool> &vbSel = vbSelected[p];
|
||||
|
||||
int index = OptionRowHandlerUtil::GetOneSelection( vbSel );
|
||||
m_pstToFill->Set( m_vStepsTypesToShow[index] );
|
||||
@@ -1520,10 +1520,10 @@ public:
|
||||
m_Def.m_vsChoices.push_back( "" );
|
||||
return true;
|
||||
}
|
||||
virtual void ImportOption( OptionRow *pRow, const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
|
||||
virtual void ImportOption( OptionRow *pRow, const std::vector<PlayerNumber> &vpns, std::vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
|
||||
{
|
||||
}
|
||||
virtual int ExportOption( const vector<PlayerNumber> &vpns, const vector<bool> vbSelected[NUM_PLAYERS] ) const
|
||||
virtual int ExportOption( const std::vector<PlayerNumber> &vpns, const std::vector<bool> vbSelected[NUM_PLAYERS] ) const
|
||||
{
|
||||
if( vbSelected[PLAYER_1][0] || vbSelected[PLAYER_2][0] )
|
||||
m_gc.ApplyToAllPlayers();
|
||||
|
||||
Reference in New Issue
Block a user