[Orxonox-commit 6259] r10916 - in code/branches/cpp11_v2/src: libraries/core libraries/core/class libraries/core/command libraries/core/commandline libraries/core/config libraries/core/input libraries/core/module libraries/core/object libraries/core/singleton libraries/network libraries/network/synchronisable libraries/tools libraries/util libraries/util/output modules/docking modules/gametypes modules/jump modules/mini4dgame modules/notifications modules/objects modules/objects/eventsystem modules/objects/triggers modules/overlays/hud modules/overlays/stats modules/pickup modules/pickup/items modules/pong modules/questsystem modules/questsystem/effects modules/tetris modules/towerdefense orxonox orxonox/collisionshapes orxonox/controllers orxonox/gamestates orxonox/gametypes orxonox/interfaces orxonox/items orxonox/overlays orxonox/sound orxonox/weaponsystem orxonox/worldentities orxonox/worldentities/pawns
landauf at orxonox.net
landauf at orxonox.net
Wed Dec 2 23:22:03 CET 2015
Author: landauf
Date: 2015-12-02 23:22:03 +0100 (Wed, 02 Dec 2015)
New Revision: 10916
Modified:
code/branches/cpp11_v2/src/libraries/core/BaseObject.cc
code/branches/cpp11_v2/src/libraries/core/ClassTreeMask.cc
code/branches/cpp11_v2/src/libraries/core/Core.cc
code/branches/cpp11_v2/src/libraries/core/CoreStaticInitializationHandler.cc
code/branches/cpp11_v2/src/libraries/core/Game.cc
code/branches/cpp11_v2/src/libraries/core/Language.cc
code/branches/cpp11_v2/src/libraries/core/Loader.cc
code/branches/cpp11_v2/src/libraries/core/LuaState.cc
code/branches/cpp11_v2/src/libraries/core/Namespace.cc
code/branches/cpp11_v2/src/libraries/core/NamespaceNode.cc
code/branches/cpp11_v2/src/libraries/core/Resource.cc
code/branches/cpp11_v2/src/libraries/core/class/Identifier.cc
code/branches/cpp11_v2/src/libraries/core/class/Identifier.h
code/branches/cpp11_v2/src/libraries/core/class/IdentifierManager.cc
code/branches/cpp11_v2/src/libraries/core/command/ArgumentCompletionFunctions.cc
code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.cc
code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommand.cc
code/branches/cpp11_v2/src/libraries/core/command/Shell.cc
code/branches/cpp11_v2/src/libraries/core/command/TclThreadList.h
code/branches/cpp11_v2/src/libraries/core/command/TclThreadManager.cc
code/branches/cpp11_v2/src/libraries/core/commandline/CommandLineParser.cc
code/branches/cpp11_v2/src/libraries/core/config/ConfigFile.cc
code/branches/cpp11_v2/src/libraries/core/config/ConfigFileManager.cc
code/branches/cpp11_v2/src/libraries/core/config/ConfigFileSection.cc
code/branches/cpp11_v2/src/libraries/core/config/ConfigValueContainer.h
code/branches/cpp11_v2/src/libraries/core/input/Button.cc
code/branches/cpp11_v2/src/libraries/core/input/InputBuffer.cc
code/branches/cpp11_v2/src/libraries/core/input/InputDevice.h
code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc
code/branches/cpp11_v2/src/libraries/core/input/JoyStick.cc
code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.cc
code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.h
code/branches/cpp11_v2/src/libraries/core/input/Mouse.cc
code/branches/cpp11_v2/src/libraries/core/module/DynLibManager.cc
code/branches/cpp11_v2/src/libraries/core/module/ModuleInstance.cc
code/branches/cpp11_v2/src/libraries/core/module/PluginManager.cc
code/branches/cpp11_v2/src/libraries/core/module/StaticInitializationManager.cc
code/branches/cpp11_v2/src/libraries/core/object/Context.cc
code/branches/cpp11_v2/src/libraries/core/object/Listable.cc
code/branches/cpp11_v2/src/libraries/core/object/ObjectListBase.cc
code/branches/cpp11_v2/src/libraries/core/singleton/ScopeManager.cc
code/branches/cpp11_v2/src/libraries/network/FunctionCall.cc
code/branches/cpp11_v2/src/libraries/network/Host.cc
code/branches/cpp11_v2/src/libraries/network/synchronisable/Synchronisable.cc
code/branches/cpp11_v2/src/libraries/tools/DebugDrawer.cc
code/branches/cpp11_v2/src/libraries/tools/IcoSphere.cc
code/branches/cpp11_v2/src/libraries/tools/Shader.cc
code/branches/cpp11_v2/src/libraries/util/DisplayStringConversions.h
code/branches/cpp11_v2/src/libraries/util/Serialise.h
code/branches/cpp11_v2/src/libraries/util/SignalHandler.cc
code/branches/cpp11_v2/src/libraries/util/SmallObjectAllocator.cc
code/branches/cpp11_v2/src/libraries/util/StringUtils.cc
code/branches/cpp11_v2/src/libraries/util/output/BaseWriter.cc
code/branches/cpp11_v2/src/libraries/util/output/MemoryWriter.cc
code/branches/cpp11_v2/src/libraries/util/output/OutputListener.cc
code/branches/cpp11_v2/src/libraries/util/output/OutputManager.cc
code/branches/cpp11_v2/src/libraries/util/output/SubcontextOutputListener.cc
code/branches/cpp11_v2/src/modules/docking/Dock.cc
code/branches/cpp11_v2/src/modules/docking/DockingAnimation.cc
code/branches/cpp11_v2/src/modules/docking/DockingEffect.cc
code/branches/cpp11_v2/src/modules/gametypes/RaceCheckPoint.cc
code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceController.cc
code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceManager.cc
code/branches/cpp11_v2/src/modules/jump/Jump.cc
code/branches/cpp11_v2/src/modules/mini4dgame/Mini4Dgame.cc
code/branches/cpp11_v2/src/modules/notifications/NotificationManager.cc
code/branches/cpp11_v2/src/modules/notifications/NotificationQueue.cc
code/branches/cpp11_v2/src/modules/objects/Attacher.cc
code/branches/cpp11_v2/src/modules/objects/Script.cc
code/branches/cpp11_v2/src/modules/objects/SpaceBoundaries.cc
code/branches/cpp11_v2/src/modules/objects/eventsystem/EventDispatcher.cc
code/branches/cpp11_v2/src/modules/objects/eventsystem/EventFilter.cc
code/branches/cpp11_v2/src/modules/objects/triggers/DistanceMultiTrigger.cc
code/branches/cpp11_v2/src/modules/objects/triggers/DistanceTrigger.cc
code/branches/cpp11_v2/src/modules/objects/triggers/MultiTrigger.cc
code/branches/cpp11_v2/src/modules/objects/triggers/Trigger.cc
code/branches/cpp11_v2/src/modules/overlays/hud/ChatOverlay.cc
code/branches/cpp11_v2/src/modules/overlays/hud/HUDNavigation.cc
code/branches/cpp11_v2/src/modules/overlays/hud/HUDRadar.cc
code/branches/cpp11_v2/src/modules/overlays/stats/Scoreboard.cc
code/branches/cpp11_v2/src/modules/pickup/PickupCollection.cc
code/branches/cpp11_v2/src/modules/pickup/PickupManager.cc
code/branches/cpp11_v2/src/modules/pickup/items/MetaPickup.cc
code/branches/cpp11_v2/src/modules/pong/Pong.cc
code/branches/cpp11_v2/src/modules/pong/PongAI.cc
code/branches/cpp11_v2/src/modules/questsystem/GlobalQuest.cc
code/branches/cpp11_v2/src/modules/questsystem/Quest.cc
code/branches/cpp11_v2/src/modules/questsystem/QuestEffect.cc
code/branches/cpp11_v2/src/modules/questsystem/QuestEffectBeacon.cc
code/branches/cpp11_v2/src/modules/questsystem/QuestListener.cc
code/branches/cpp11_v2/src/modules/questsystem/QuestManager.cc
code/branches/cpp11_v2/src/modules/questsystem/effects/AddReward.cc
code/branches/cpp11_v2/src/modules/tetris/Tetris.cc
code/branches/cpp11_v2/src/modules/tetris/TetrisBrick.cc
code/branches/cpp11_v2/src/modules/towerdefense/TowerDefense.cc
code/branches/cpp11_v2/src/orxonox/Level.cc
code/branches/cpp11_v2/src/orxonox/LevelInfo.cc
code/branches/cpp11_v2/src/orxonox/LevelManager.cc
code/branches/cpp11_v2/src/orxonox/Scene.cc
code/branches/cpp11_v2/src/orxonox/collisionshapes/CompoundCollisionShape.cc
code/branches/cpp11_v2/src/orxonox/controllers/ArtificialController.cc
code/branches/cpp11_v2/src/orxonox/controllers/FormationController.cc
code/branches/cpp11_v2/src/orxonox/controllers/WaypointController.cc
code/branches/cpp11_v2/src/orxonox/gamestates/GSLevel.cc
code/branches/cpp11_v2/src/orxonox/gametypes/Dynamicmatch.cc
code/branches/cpp11_v2/src/orxonox/gametypes/Gametype.cc
code/branches/cpp11_v2/src/orxonox/gametypes/LastManStanding.cc
code/branches/cpp11_v2/src/orxonox/gametypes/LastTeamStanding.cc
code/branches/cpp11_v2/src/orxonox/gametypes/TeamBaseMatch.cc
code/branches/cpp11_v2/src/orxonox/gametypes/TeamDeathmatch.cc
code/branches/cpp11_v2/src/orxonox/gametypes/TeamGametype.cc
code/branches/cpp11_v2/src/orxonox/gametypes/UnderAttack.cc
code/branches/cpp11_v2/src/orxonox/interfaces/PickupCarrier.cc
code/branches/cpp11_v2/src/orxonox/interfaces/Pickupable.cc
code/branches/cpp11_v2/src/orxonox/items/MultiStateEngine.cc
code/branches/cpp11_v2/src/orxonox/items/ShipPart.cc
code/branches/cpp11_v2/src/orxonox/overlays/OverlayGroup.cc
code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc
code/branches/cpp11_v2/src/orxonox/sound/SoundStreamer.cc
code/branches/cpp11_v2/src/orxonox/weaponsystem/Munition.cc
code/branches/cpp11_v2/src/orxonox/weaponsystem/Weapon.cc
code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponPack.cc
code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponSet.cc
code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponSystem.cc
code/branches/cpp11_v2/src/orxonox/worldentities/ControllableEntity.cc
code/branches/cpp11_v2/src/orxonox/worldentities/EffectContainer.cc
code/branches/cpp11_v2/src/orxonox/worldentities/WorldEntity.cc
code/branches/cpp11_v2/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
code/branches/cpp11_v2/src/orxonox/worldentities/pawns/SpaceShip.cc
code/branches/cpp11_v2/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc
Log:
use actual types instead of 'auto'. only exception is for complicated template types, e.g. when iterating over a map
Modified: code/branches/cpp11_v2/src/libraries/core/BaseObject.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/BaseObject.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/BaseObject.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -233,10 +233,10 @@
Template* BaseObject::getTemplate(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->templates_)
+ for (Template* temp : this->templates_)
{
if (i == index)
- return (elem);
+ return temp;
i++;
}
return nullptr;
@@ -268,13 +268,13 @@
BaseObject* BaseObject::getEventSource(unsigned int index, const std::string& state) const
{
unsigned int i = 0;
- for (const auto & elem : this->eventSources_)
+ for (const auto& mapEntry : this->eventSources_)
{
- if (elem.second != state)
+ if (mapEntry.second != state)
continue;
if (i == index)
- return elem.first;
+ return mapEntry.first;
++i;
}
return nullptr;
@@ -295,10 +295,10 @@
BaseObject* BaseObject::getEventListener(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->eventListenersXML_)
+ for (BaseObject* listener : this->eventListenersXML_)
{
if (i == index)
- return elem;
+ return listener;
++i;
}
return nullptr;
@@ -357,10 +357,10 @@
{
Event event(activate, originator, name);
- for (const auto & elem : this->eventListeners_)
+ for (BaseObject* listener : this->eventListeners_)
{
- event.statename_ = (elem)->eventSources_[this];
- (elem)->processEvent(event);
+ event.statename_ = listener->eventSources_[this];
+ listener->processEvent(event);
}
}
@@ -369,8 +369,8 @@
*/
void BaseObject::fireEvent(Event& event)
{
- for (const auto & elem : this->eventListeners_)
- (elem)->processEvent(event);
+ for (BaseObject* listener : this->eventListeners_)
+ listener->processEvent(event);
}
/**
@@ -473,10 +473,8 @@
}
// iterate through all states and get the event sources
- for (auto & statename : eventnames)
+ for (const std::string& statename : eventnames)
{
-
-
// if the event state is already known, continue with the next state
orxonox::EventState* eventstate = object->getEventState(statename);
if (eventstate)
Modified: code/branches/cpp11_v2/src/libraries/core/ClassTreeMask.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/ClassTreeMask.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/ClassTreeMask.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -292,10 +292,10 @@
else
{
// No it's not: Search for classes inheriting from the given class and add the rules for them
- for (const auto & elem : subclass->getDirectChildren())
- if ((elem)->isA(this->root_->getClass()))
- if (overwrite || (!this->nodeExists(elem))) // If we don't want to overwrite, only add nodes that don't already exist
- this->add(this->root_, elem, bInclude, overwrite);
+ for (const Identifier* directChild : subclass->getDirectChildren())
+ if (directChild->isA(this->root_->getClass()))
+ if (overwrite || (!this->nodeExists(directChild))) // If we don't want to overwrite, only add nodes that don't already exist
+ this->add(this->root_, directChild, bInclude, overwrite);
}
// Clean the rule-tree
@@ -324,12 +324,12 @@
else if (subclass->isA(node->getClass()))
{
// Search for an already existing node, containing the subclass we want to add
- for (auto & elem : node->subnodes_)
+ for (ClassTreeMaskNode* subnode : node->subnodes_)
{
- if (subclass->isA((elem)->getClass()))
+ if (subclass->isA(subnode->getClass()))
{
// We've found an existing node -> delegate the work with a recursive function-call and return
- this->add(elem, subclass, bInclude, overwrite);
+ this->add(subnode, subclass, bInclude, overwrite);
return;
}
}
@@ -391,8 +391,8 @@
{
if (!subclass)
return;
- for (const auto & elem : subclass->getDirectChildren())
- this->add(elem, this->isIncluded(elem), false, false);
+ for (const Identifier* directChild : subclass->getDirectChildren())
+ this->add(directChild, this->isIncluded(directChild), false, false);
this->add(subclass, bInclude, false, clean);
}
@@ -434,9 +434,9 @@
return node->isIncluded();
// Go through the list of subnodes and look for a node containing the searched subclass and delegate the request by a recursive function-call.
- for (auto & elem : node->subnodes_)
- if (subclass->isA((elem)->getClass()))
- return isIncluded(elem, subclass);
+ for (ClassTreeMaskNode* subnode : node->subnodes_)
+ if (subclass->isA(subnode->getClass()))
+ return isIncluded(subnode, subclass);
// There is no subnode containing our class -> the rule of the current node takes in effect
return node->isIncluded();
@@ -956,8 +956,8 @@
// Now add all directChildren which don't have subnodes on their own to the subclass-list
// The bool is "false", meaning they have no subnodes and therefore need no further checks
if (node->isIncluded())
- for (const auto & elem : directChildren)
- this->subclasses_.insert(this->subclasses_.end(), std::pair<const Identifier*, bool>(elem, false));
+ for (const Identifier* directChild : directChildren)
+ this->subclasses_.insert(this->subclasses_.end(), std::pair<const Identifier*, bool>(directChild, false));
}
}
}
Modified: code/branches/cpp11_v2/src/libraries/core/Core.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/Core.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/Core.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -278,7 +278,7 @@
orxout(internal_info) << "Loading modules:" << endl;
const std::vector<std::string>& modulePaths = ApplicationPaths::getInstance().getModulePaths();
- for (const auto & modulePath : modulePaths)
+ for (const std::string& modulePath : modulePaths)
{
ModuleInstance* module = new ModuleInstance(modulePath);
this->loadModule(module);
@@ -308,9 +308,8 @@
void Core::unloadModules()
{
- for (auto module : this->modules_)
+ for (ModuleInstance* module : this->modules_)
{
-
this->unloadModule(module);
delete module;
}
Modified: code/branches/cpp11_v2/src/libraries/core/CoreStaticInitializationHandler.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/CoreStaticInitializationHandler.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/CoreStaticInitializationHandler.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -98,38 +98,38 @@
// collect all identifiers that are about to be unloaded
std::set<Identifier*> identifiers;
const std::set<StaticallyInitializedInstance*>& instances = module->getInstances(StaticInitialization::IDENTIFIER);
- for (const auto & instance : instances)
+ for (StaticallyInitializedInstance* instance : instances)
identifiers.insert(&static_cast<StaticallyInitializedIdentifier*>(instance)->getIdentifier());
// destroy objects. some objects may survive this at first because they still have strong pointers pointing at them. this is
// ok as long as those strong pointers are held by objects that are also about to be destroyed in the same loop. this means
// that objects within one module may reference each other by strong pointers. but it is not allowed that objects from another
// module (which is not unloaded) uses strong pointers to point at objects inside the unloaded module. this will lead to a crash.
- for (const auto & identifier : identifiers)
- (identifier)->destroyObjects();
+ for (Identifier* identifier : identifiers)
+ identifier->destroyObjects();
// check if all objects were really destroyed. this is not the case if an object is referenced by a strong pointer from another
// module (or if two objects inside this module reference each other). this will lead to a crash and must be fixed (e.g. by
// changing object dependencies; or by changing the logic that allows modules to be unloaded).
- for (const auto & identifier : identifiers)
+ for (Identifier* identifier : identifiers)
{
ObjectListBase* objectList = Context::getRootContext()->getObjectList(identifier);
if (objectList->size() > 0)
{
- orxout(internal_error) << "There are still " << objectList->size() << " objects of type " << (identifier)->getName()
+ orxout(internal_error) << "There are still " << objectList->size() << " objects of type " << identifier->getName()
<< " after unloading the Identifier. This may lead to a crash" << endl;
}
}
// destroy object-lists in all contexts
- for (const auto & identifier : identifiers)
+ for (Identifier* identifier : identifiers)
{
// only do this if the Identifier is not a Context itself; otherwise we delete the list we're iterating over
- if (!(identifier)->isExactlyA(Class(Context)))
+ if (!identifier->isExactlyA(Class(Context)))
{
// iterate over all contexts
for (ObjectList<Context>::iterator it_context = ObjectList<Context>::begin(); it_context != ObjectList<Context>::end(); ++it_context)
- it_context->destroyObjectList((identifier));
+ it_context->destroyObjectList(identifier);
}
}
}
Modified: code/branches/cpp11_v2/src/libraries/core/Game.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/Game.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/Game.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -611,8 +611,8 @@
}
// Check if graphics is still required
bool graphicsRequired = false;
- for (auto & elem : loadedStates_)
- graphicsRequired |= elem->getInfo().bGraphicsMode;
+ for (const std::shared_ptr<GameState>& state : loadedStates_)
+ graphicsRequired |= state->getInfo().bGraphicsMode;
if (!graphicsRequired)
this->unloadGraphics(!this->bAbort_); // if abort is false, that means the game is still running while unloading graphics. in this case we load a graphics manager without renderer (to keep all necessary ogre instances alive)
this->bChangingState_ = false;
Modified: code/branches/cpp11_v2/src/libraries/core/Language.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/Language.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/Language.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -106,8 +106,8 @@
*/
Language::~Language()
{
- for (auto & elem : this->languageEntries_)
- delete (elem.second);
+ for (auto& mapEntry : this->languageEntries_)
+ delete (mapEntry.second);
}
/**
@@ -318,9 +318,9 @@
}
// Iterate through the list an write the lines into the file
- for (const auto & elem : this->languageEntries_)
+ for (const auto& mapEntry : this->languageEntries_)
{
- file << elem.second->getLabel() << '=' << elem.second->getDefault() << endl;
+ file << mapEntry.second->getLabel() << '=' << mapEntry.second->getDefault() << endl;
}
file.close();
Modified: code/branches/cpp11_v2/src/libraries/core/Loader.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/Loader.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/Loader.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -164,9 +164,9 @@
std::vector<std::pair<std::string, size_t>> linesources = lineTrace->at(line - 1);
std::ostringstream message;
message << "Possible sources of error:" << endl;
- for (auto & linesource : linesources)
+ for (const std::pair<std::string, size_t>& pair : linesources)
{
- message << linesource.first << ", Line " << linesource.second << endl;
+ message << pair.first << ", Line " << pair.second << endl;
}
orxout(user_error, context::loader) << message.str() << endl;
}
@@ -260,9 +260,9 @@
// check whether on every opening <?lua tag a closing ?> tag follows
{
bool expectedValue = true;
- for (auto & luaTag : luaTags)
+ for (auto& mapEntry : luaTags)
{
- if (luaTag.second == expectedValue)
+ if (mapEntry.second == expectedValue)
expectedValue = !expectedValue;
else
{
Modified: code/branches/cpp11_v2/src/libraries/core/LuaState.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/LuaState.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/LuaState.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -325,9 +325,9 @@
/*static*/ bool LuaState::addToluaInterface(int (*function)(lua_State*), const std::string& name)
{
- for (const auto & interface : getToluaInterfaces())
+ for (const auto& mapEntry : getToluaInterfaces())
{
- if (interface.first == name || interface.second == function)
+ if (mapEntry.first == name || mapEntry.second == function)
{
orxout(internal_warning, context::lua) << "Trying to add a Tolua interface with the same name or function." << endl;
return true;
@@ -336,7 +336,7 @@
getToluaInterfaces()[name] = function;
// Open interface in all LuaStates
- for (const auto & state : getInstances())
+ for (LuaState* state : getInstances())
(*function)(state->luaState_);
// Return dummy bool
@@ -353,7 +353,7 @@
}
// Close interface in all LuaStates
- for (const auto & state : getInstances())
+ for (LuaState* state : getInstances())
{
lua_pushnil(state->luaState_);
lua_setglobal(state->luaState_, it->first.c_str());
@@ -368,16 +368,16 @@
/*static*/ void LuaState::openToluaInterfaces(lua_State* state)
{
- for (const auto & interface : getToluaInterfaces())
- (interface.second)(state);
+ for (const auto& mapEntry : getToluaInterfaces())
+ (mapEntry.second)(state);
}
/*static*/ void LuaState::closeToluaInterfaces(lua_State* state)
{
- for (const auto & interface : getToluaInterfaces())
+ for (const auto& mapEntry : getToluaInterfaces())
{
lua_pushnil(state);
- lua_setglobal(state, interface.first.c_str());
+ lua_setglobal(state, mapEntry.first.c_str());
}
}
Modified: code/branches/cpp11_v2/src/libraries/core/Namespace.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/Namespace.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/Namespace.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -52,8 +52,8 @@
Namespace::~Namespace()
{
if (this->bRoot_)
- for (auto & elem : this->representingNamespaces_)
- delete elem;
+ for (NamespaceNode* node : this->representingNamespaces_)
+ delete node;
}
void Namespace::XMLPort(Element& xmlelement, XMLPort::Mode mode)
@@ -79,9 +79,9 @@
{
for (unsigned int i = 0; i < tokens.size(); i++)
{
- for (auto & elem : this->getNamespace()->representingNamespaces_)
+ for (NamespaceNode* node : this->getNamespace()->representingNamespaces_)
{
- std::set<NamespaceNode*> temp = elem->getNodeRelative(tokens[i]);
+ std::set<NamespaceNode*> temp = node->getNodeRelative(tokens[i]);
this->representingNamespaces_.insert(temp.begin(), temp.end());
}
}
@@ -92,10 +92,10 @@
if (this->bAutogeneratedFileRootNamespace_)
{
- for (auto & elem : this->representingNamespaces_)
+ for (NamespaceNode* node : this->representingNamespaces_)
{
- elem->setRoot(true);
- elem->setHidden(true);
+ node->setRoot(true);
+ node->setHidden(true);
}
}
@@ -113,11 +113,11 @@
bool Namespace::includes(const Namespace* ns) const
{
- for (const auto & elem1 : this->representingNamespaces_)
+ for (NamespaceNode* node1 : this->representingNamespaces_)
{
- for (const auto & elem2 : ns->representingNamespaces_)
+ for (NamespaceNode* node2 : ns->representingNamespaces_)
{
- if (elem1->includes(elem2))
+ if (node1->includes(node2))
{
if (this->operator_ == "or")
return true;
@@ -148,12 +148,12 @@
std::string output;
int i = 0;
- for (const auto & elem : this->representingNamespaces_)
+ for (NamespaceNode* node : this->representingNamespaces_)
{
if (i > 0)
output += " / ";
- output += elem->toString();
+ output += node->toString();
i++;
}
@@ -165,12 +165,12 @@
std::string output;
int i = 0;
- for (const auto & elem : this->representingNamespaces_)
+ for (NamespaceNode* node : this->representingNamespaces_)
{
if (i > 0)
output += '\n';
- output += elem->toString(indentation);
+ output += node->toString(indentation);
i++;
}
Modified: code/branches/cpp11_v2/src/libraries/core/NamespaceNode.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/NamespaceNode.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/NamespaceNode.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -102,11 +102,11 @@
{
bool bFoundMatchingNamespace = false;
- for (auto & elem : this->subnodes_)
+ for (auto& mapEntry : this->subnodes_)
{
- if (elem.first.find(firstPart) == (elem.first.size() - firstPart.size()))
+ if (mapEntry.first.find(firstPart) == (mapEntry.first.size() - firstPart.size()))
{
- std::set<NamespaceNode*> temp2 = elem.second->getNodeRelative(secondPart);
+ std::set<NamespaceNode*> temp2 = mapEntry.second->getNodeRelative(secondPart);
nodes.insert(temp2.begin(), temp2.end());
bFoundMatchingNamespace = true;
}
@@ -131,8 +131,8 @@
}
else
{
- for (const auto & elem : this->subnodes_)
- if (elem.second->includes(ns))
+ for (const auto& mapEntry : this->subnodes_)
+ if (mapEntry.second->includes(ns))
return true;
}
@@ -166,8 +166,8 @@
{
std::string output = (indentation + this->name_ + '\n');
- for (const auto & elem : this->subnodes_)
- output += elem.second->toString(indentation + " ");
+ for (const auto& mapEntry : this->subnodes_)
+ output += mapEntry.second->toString(indentation + " ");
return output;
}
Modified: code/branches/cpp11_v2/src/libraries/core/Resource.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/Resource.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/Resource.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -57,7 +57,7 @@
{
DataStreamListPtr resources(new Ogre::DataStreamList());
const Ogre::StringVector& groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups();
- for (const auto & group : groups)
+ for (const std::string& group : groups)
{
DataStreamListPtr temp = Ogre::ResourceGroupManager::getSingleton().openResources(pattern, group);
resources->insert(resources->end(), temp->begin(), temp->end());
@@ -120,7 +120,7 @@
{
StringVectorPtr resourceNames(new Ogre::StringVector());
const Ogre::StringVector& groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups();
- for (const auto & group : groups)
+ for (const std::string& group : groups)
{
StringVectorPtr temp = Ogre::ResourceGroupManager::getSingleton().findResourceNames(group, pattern);
resourceNames->insert(resourceNames->end(), temp->begin(), temp->end());
Modified: code/branches/cpp11_v2/src/libraries/core/class/Identifier.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/class/Identifier.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/class/Identifier.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -86,17 +86,17 @@
const_cast<Identifier*>(*it)->children_.erase(this);
for (std::list<const Identifier*>::const_iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
const_cast<Identifier*>(*it)->directChildren_.erase(this);
- for (const auto & elem : this->children_)
- const_cast<Identifier*>(elem)->parents_.remove(this);
- for (const auto & elem : this->directChildren_)
- const_cast<Identifier*>(elem)->directParents_.remove(this);
+ for (const Identifier* child : this->children_)
+ const_cast<Identifier*>(child)->parents_.remove(this);
+ for (const Identifier* directChild : this->directChildren_)
+ const_cast<Identifier*>(directChild)->directParents_.remove(this);
- for (auto & elem : this->configValues_)
- delete (elem.second);
- for (auto & elem : this->xmlportParamContainers_)
- delete (elem.second);
- for (auto & elem : this->xmlportObjectContainers_)
- delete (elem.second);
+ for (auto& mapEntry : this->configValues_)
+ delete (mapEntry.second);
+ for (auto& mapEntry : this->xmlportParamContainers_)
+ delete (mapEntry.second);
+ for (auto& mapEntry : this->xmlportObjectContainers_)
+ delete (mapEntry.second);
}
@@ -156,9 +156,9 @@
if (this->directParents_.empty())
{
- for (const auto & elem : initializationTrace)
- if (elem != this)
- this->parents_.push_back(elem);
+ for (const Identifier* identifier : initializationTrace)
+ if (identifier != this)
+ this->parents_.push_back(identifier);
}
else
orxout(internal_error) << "Trying to add parents to " << this->getName() << " after it was already initialized with manual calls to inheritsFrom<Class>()." << endl;
@@ -260,22 +260,22 @@
std::list<const Identifier*> expectedIdentifierTrace;
// if any parent class is virtual, it will be instantiated first, so we need to add them first.
- for (const auto & elem : this->parents_)
+ for (const Identifier* parent : this->parents_)
{
- if ((elem)->isVirtualBase())
+ if (parent->isVirtualBase())
{
- for (std::list<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(elem)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(elem)->parents_.end(); ++it_parent_parent)
+ for (std::list<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(parent)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(parent)->parents_.end(); ++it_parent_parent)
this->addIfNotExists(expectedIdentifierTrace, *it_parent_parent);
- this->addIfNotExists(expectedIdentifierTrace, elem);
+ this->addIfNotExists(expectedIdentifierTrace, parent);
}
}
// now all direct parents get created recursively. already added identifiers (e.g. virtual base classes) are not added again.
- for (const auto & elem : this->directParents_)
+ for (const Identifier* directParent : this->directParents_)
{
- for (std::list<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(elem)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(elem)->parents_.end(); ++it_parent_parent)
+ for (std::list<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(directParent)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(directParent)->parents_.end(); ++it_parent_parent)
this->addIfNotExists(expectedIdentifierTrace, *it_parent_parent);
- this->addIfNotExists(expectedIdentifierTrace, elem);
+ this->addIfNotExists(expectedIdentifierTrace, directParent);
}
// check if the expected trace matches the actual trace (which was defined by creating a sample instance)
@@ -284,8 +284,8 @@
orxout(internal_warning) << this->getName() << " has an unexpected initialization trace:" << endl;
orxout(internal_warning) << " Actual trace (after creating a sample instance):" << endl << " ";
- for (const auto & elem : this->parents_)
- orxout(internal_warning) << " " << (elem)->getName();
+ for (const Identifier* parent : this->parents_)
+ orxout(internal_warning) << " " << parent->getName();
orxout(internal_warning) << endl;
orxout(internal_warning) << " Expected trace (according to class hierarchy definitions):" << endl << " ";
@@ -294,8 +294,8 @@
orxout(internal_warning) << endl;
orxout(internal_warning) << " Direct parents (according to class hierarchy definitions):" << endl << " ";
- for (const auto & elem : this->directParents_)
- orxout(internal_warning) << " " << (elem)->getName();
+ for (const Identifier* directParent : this->directParents_)
+ orxout(internal_warning) << " " << directParent->getName();
orxout(internal_warning) << endl;
}
}
Modified: code/branches/cpp11_v2/src/libraries/core/class/Identifier.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/class/Identifier.h 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/class/Identifier.h 2015-12-02 22:22:03 UTC (rev 10916)
@@ -461,8 +461,8 @@
this->setConfigValues(*it, *it);
if (updateChildren)
- for (const auto & elem : this->getChildren())
- (elem)->updateConfigValues(false);
+ for (const Identifier* child : this->getChildren())
+ child->updateConfigValues(false);
}
template <class T>
Modified: code/branches/cpp11_v2/src/libraries/core/class/IdentifierManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/class/IdentifierManager.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/class/IdentifierManager.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -92,9 +92,8 @@
// iterate over all identifiers, create one instance of each class and initialize the identifiers
{
Context temporaryContext(nullptr);
- for (auto identifier : this->identifiers_)
+ for (Identifier* identifier : this->identifiers_)
{
-
if (identifier->isInitialized())
continue;
@@ -126,8 +125,8 @@
}
// finish the initialization of all identifiers
- for (const auto & initializedIdentifier : initializedIdentifiers)
- (initializedIdentifier)->finishInitialization();
+ for (Identifier* initializedIdentifier : initializedIdentifiers)
+ initializedIdentifier->finishInitialization();
// only check class hierarchy in dev mode because it's an expensive operation and it requires a developer to fix detected problems anyway.
if (!Core::exists() || Core::getInstance().getConfig()->inDevMode())
@@ -143,28 +142,28 @@
void IdentifierManager::verifyClassHierarchy(const std::set<Identifier*>& initializedIdentifiers)
{
// check if there are any uninitialized identifiers remaining
- for (const auto & elem : this->identifiers_)
- if (!(elem)->isInitialized())
- orxout(internal_error) << "Identifier was registered late and is not initialized: " << (elem)->getName() << " / " << (elem)->getTypeInfo().name() << endl;
+ for (Identifier* identifier : this->identifiers_)
+ if (!identifier->isInitialized())
+ orxout(internal_error) << "Identifier was registered late and is not initialized: " << identifier->getName() << " / " << identifier->getTypeInfo().name() << endl;
// for all initialized identifiers, check if a sample instance behaves as expected according to the class hierarchy
Context temporaryContext(nullptr);
- for (const auto & initializedIdentifier : initializedIdentifiers)
+ for (Identifier* initializedIdentifier : initializedIdentifiers)
{
- if (!(initializedIdentifier)->hasFactory())
+ if (!initializedIdentifier->hasFactory())
continue;
- Identifiable* temp = (initializedIdentifier)->fabricate(&temporaryContext);
+ Identifiable* temp = initializedIdentifier->fabricate(&temporaryContext);
- for (const auto & elem : this->identifiers_)
+ for (Identifier* identifier : this->identifiers_)
{
- bool isA_AccordingToRtti = (elem)->canDynamicCastObjectToIdentifierClass(temp);
- bool isA_AccordingToClassHierarchy = temp->isA((elem));
+ bool isA_AccordingToRtti = identifier->canDynamicCastObjectToIdentifierClass(temp);
+ bool isA_AccordingToClassHierarchy = temp->isA(identifier);
if (isA_AccordingToRtti != isA_AccordingToClassHierarchy)
{
- orxout(internal_error) << "Class hierarchy does not match RTTI: Class hierarchy claims that " << (initializedIdentifier)->getName() <<
- (isA_AccordingToClassHierarchy ? " is a " : " is not a ") << (elem)->getName() << " but RTTI says the opposite." << endl;
+ orxout(internal_error) << "Class hierarchy does not match RTTI: Class hierarchy claims that " << initializedIdentifier->getName() <<
+ (isA_AccordingToClassHierarchy ? " is a " : " is not a ") << identifier->getName() << " but RTTI says the opposite." << endl;
}
}
@@ -183,8 +182,8 @@
void IdentifierManager::destroyClassHierarchy()
{
orxout(internal_status) << "Destroy class-hierarchy" << endl;
- for (const auto & elem : this->identifiers_)
- (elem)->reset();
+ for (Identifier* identifier : this->identifiers_)
+ identifier->reset();
}
/**
@@ -259,9 +258,9 @@
Identifier* IdentifierManager::getIdentifierByTypeInfo(const std::type_info& typeInfo)
{
// TODO: use std::type_index and a map to find identifiers by type_info (only with c++11)
- for (const auto & elem : this->identifiers_)
- if ((elem)->getTypeInfo() == typeInfo)
- return (elem);
+ for (Identifier* identifer : this->identifiers_)
+ if (identifer->getTypeInfo() == typeInfo)
+ return identifer;
return nullptr;
}
Modified: code/branches/cpp11_v2/src/libraries/core/command/ArgumentCompletionFunctions.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/ArgumentCompletionFunctions.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/command/ArgumentCompletionFunctions.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -76,8 +76,8 @@
*/
bool groupIsVisible(const std::map<std::string, ConsoleCommand*>& group, bool bOnlyShowHidden)
{
- for (const auto & elem : group)
- if (elem.second->isActive() && elem.second->hasAccess() && (!elem.second->isHidden())^bOnlyShowHidden)
+ for (const auto& mapEntry : group)
+ if (mapEntry.second->isActive() && mapEntry.second->hasAccess() && (!mapEntry.second->isHidden())^bOnlyShowHidden)
return true;
return false;
@@ -99,9 +99,9 @@
// get all the groups that are visible (except the shortcut group "")
const std::map<std::string, std::map<std::string, ConsoleCommand*>>& commands = ConsoleCommandManager::getInstance().getCommands();
- for (const auto & command : commands)
- if (groupIsVisible(command.second, bOnlyShowHidden) && command.first != "" && (fragmentLC == "" || getLowercase(command.first).find(fragmentLC) == 0))
- groupList.push_back(ArgumentCompletionListElement(command.first, getLowercase(command.first)));
+ for (const auto& mapEntry : commands)
+ if (groupIsVisible(mapEntry.second, bOnlyShowHidden) && mapEntry.first != "" && (fragmentLC == "" || getLowercase(mapEntry.first).find(fragmentLC) == 0))
+ groupList.push_back(ArgumentCompletionListElement(mapEntry.first, getLowercase(mapEntry.first)));
// now add all shortcuts (in group "")
std::map<std::string, std::map<std::string, ConsoleCommand*>>::const_iterator it_group = commands.find("");
@@ -112,9 +112,9 @@
groupList.push_back(ArgumentCompletionListElement("", "", "\n"));
// add the shortcuts
- for (const auto & elem : it_group->second)
- if (elem.second->isActive() && elem.second->hasAccess() && (!elem.second->isHidden())^bOnlyShowHidden && (fragmentLC == "" || getLowercase(elem.first).find(fragmentLC) == 0))
- groupList.push_back(ArgumentCompletionListElement(elem.first, getLowercase(elem.first)));
+ for (const auto& mapEntry : it_group->second)
+ if (mapEntry.second->isActive() && mapEntry.second->hasAccess() && (!mapEntry.second->isHidden())^bOnlyShowHidden && (fragmentLC == "" || getLowercase(mapEntry.first).find(fragmentLC) == 0))
+ groupList.push_back(ArgumentCompletionListElement(mapEntry.first, getLowercase(mapEntry.first)));
}
// if no shortcut was added, remove the line-break again
@@ -145,9 +145,9 @@
// add all commands in the group to the list
if (it_group != ConsoleCommandManager::getInstance().getCommands().end())
{
- for (const auto & elem : it_group->second)
- if (elem.second->isActive() && elem.second->hasAccess() && (!elem.second->isHidden())^bOnlyShowHidden)
- commandList.push_back(ArgumentCompletionListElement(elem.first, getLowercase(elem.first)));
+ for (const auto& mapEntry : it_group->second)
+ if (mapEntry.second->isActive() && mapEntry.second->hasAccess() && (!mapEntry.second->isHidden())^bOnlyShowHidden)
+ commandList.push_back(ArgumentCompletionListElement(mapEntry.first, getLowercase(mapEntry.first)));
}
return commandList;
@@ -280,7 +280,7 @@
ArgumentCompletionList sectionList;
const std::set<std::string>& names = SettingsConfigFile::getInstance().getSectionNames();
- for (const auto & name : names)
+ for (const std::string& name : names)
sectionList.push_back(ArgumentCompletionListElement(name, getLowercase(name)));
return sectionList;
Modified: code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -305,8 +305,8 @@
{
// the user typed 1-2 arguments, check what he tried to type and print a suitable error
std::string groupLC = getLowercase(this->getToken(0));
- for (const auto & elem : ConsoleCommandManager::getInstance().getCommandsLC())
- if (elem.first == groupLC)
+ for (const auto& mapEntry : ConsoleCommandManager::getInstance().getCommandsLC())
+ if (mapEntry.first == groupLC)
return std::string("Error: There is no command in group \"") + this->getToken(0) + "\" starting with \"" + this->getToken(1) + "\".";
return std::string("Error: There is no command starting with \"") + this->getToken(0) + "\".";
@@ -327,13 +327,13 @@
unsigned int nearestDistance = (unsigned int)-1;
// iterate through all groups and their commands and calculate the distance to the current command. keep the best.
- for (const auto & elem : ConsoleCommandManager::getInstance().getCommandsLC())
+ for (const auto& mapEntry : ConsoleCommandManager::getInstance().getCommandsLC())
{
- if (elem.first != "")
+ if (mapEntry.first != "")
{
- for (std::map<std::string, ConsoleCommand*>::const_iterator it_name = elem.second.begin(); it_name != elem.second.end(); ++it_name)
+ for (std::map<std::string, ConsoleCommand*>::const_iterator it_name = mapEntry.second.begin(); it_name != mapEntry.second.end(); ++it_name)
{
- std::string command = elem.first + " " + it_name->first;
+ std::string command = mapEntry.first + " " + it_name->first;
unsigned int distance = getLevenshteinDistance(command, token0_LC + " " + token1_LC);
if (distance < nearestDistance)
{
@@ -348,9 +348,9 @@
std::map<std::string, std::map<std::string, ConsoleCommand*>>::const_iterator it_group = ConsoleCommandManager::getInstance().getCommandsLC().find("");
if (it_group != ConsoleCommandManager::getInstance().getCommandsLC().end())
{
- for (const auto & elem : it_group->second)
+ for (const auto& mapEntry : it_group->second)
{
- std::string command = elem.first;
+ std::string command = mapEntry.first;
unsigned int distance = getLevenshteinDistance(command, token0_LC);
if (distance < nearestDistance)
{
@@ -428,8 +428,8 @@
/* static */ size_t CommandEvaluation::getSize(const ArgumentCompletionList& list)
{
size_t count = 0;
- for (const auto & elem : list)
- if (elem.getComparable() != "")
+ for (const ArgumentCompletionListElement& element : list)
+ if (element.getComparable() != "")
++count;
return count;
}
@@ -494,15 +494,15 @@
else if (CommandEvaluation::getSize(list) == 1)
{
// only one (non-empty) value in the list - search it and return it
- for (const auto & elem : list)
+ for (const ArgumentCompletionListElement& element : list)
{
- if (elem.getComparable() != "")
+ if (element.getComparable() != "")
{
// arguments that have a separate string to be displayed need a little more care - just return them without modification. add a space character to the others.
- if (elem.hasDisplay())
- return (elem.getString());
+ if (element.hasDisplay())
+ return (element.getString());
else
- return (elem.getString() + ' ');
+ return (element.getString() + ' ');
}
}
@@ -516,10 +516,10 @@
{
char tempComparable = '\0';
char temp = '\0';
- for (const auto & elem : list)
+ for (const ArgumentCompletionListElement& element : list)
{
- const std::string& argumentComparable = elem.getComparable();
- const std::string& argument = elem.getString();
+ const std::string& argumentComparable = element.getComparable();
+ const std::string& argument = element.getString();
// ignore empty arguments
if (argumentComparable == "")
@@ -559,12 +559,12 @@
/* static */ std::string CommandEvaluation::dump(const ArgumentCompletionList& list)
{
std::string output;
- for (const auto & elem : list)
+ for (const ArgumentCompletionListElement& element : list)
{
- output += elem.getDisplay();
+ output += element.getDisplay();
// add a space character between two elements for all non-empty arguments
- if (elem.getComparable() != "")
+ if (element.getComparable() != "")
output += ' ';
}
return output;
Modified: code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommand.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommand.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommand.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -74,8 +74,8 @@
this->baseName_ = name;
this->baseFunctor_ = executor->getFunctor();
- for (auto & elem : this->argumentCompleter_)
- elem = nullptr;
+ for (ArgumentCompleter*& completer : this->argumentCompleter_)
+ completer = nullptr;
this->keybindMode_ = KeybindMode::OnPress;
this->inputConfiguredParam_ = -1;
Modified: code/branches/cpp11_v2/src/libraries/core/command/Shell.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/Shell.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/command/Shell.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -257,7 +257,7 @@
std::vector<std::string> lines;
vectorize(text, '\n', &lines);
- for (auto & line : lines)
+ for (const std::string& line : lines)
this->addLine(line, type);
}
Modified: code/branches/cpp11_v2/src/libraries/core/command/TclThreadList.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/TclThreadList.h 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/command/TclThreadList.h 2015-12-02 22:22:03 UTC (rev 10916)
@@ -261,8 +261,8 @@
{
boost::shared_lock<boost::shared_mutex> lock(this->mutex_);
- for (const auto & elem : this->list_)
- if (elem == value)
+ for (const T& element : this->list_)
+ if (element == value)
return true;
return false;
Modified: code/branches/cpp11_v2/src/libraries/core/command/TclThreadManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/TclThreadManager.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/command/TclThreadManager.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -550,9 +550,9 @@
boost::shared_lock<boost::shared_mutex> lock(*this->interpreterBundlesMutex_);
std::list<unsigned int> threads;
- for (const auto & elem : this->interpreterBundles_)
- if (elem.first > 0 && elem.first <= this->numInterpreterBundles_) // only list autonumbered interpreters (created with create()) - exclude the default interpreter 0 and all manually numbered interpreters)
- threads.push_back(elem.first);
+ for (const auto& mapEntry : this->interpreterBundles_)
+ if (mapEntry.first > 0 && mapEntry.first <= this->numInterpreterBundles_) // only list autonumbered interpreters (created with create()) - exclude the default interpreter 0 and all manually numbered interpreters)
+ threads.push_back(mapEntry.first);
return threads;
}
Modified: code/branches/cpp11_v2/src/libraries/core/commandline/CommandLineParser.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/commandline/CommandLineParser.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/commandline/CommandLineParser.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -123,7 +123,7 @@
std::string name;
std::string shortcut;
std::string value;
- for (auto & argument : arguments)
+ for (const std::string& argument : arguments)
{
if (argument.size() != 0)
{
Modified: code/branches/cpp11_v2/src/libraries/core/config/ConfigFile.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/config/ConfigFile.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/config/ConfigFile.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -233,11 +233,11 @@
return;
}
- for (const auto & elem : this->sections_)
+ for (ConfigFileSection* section : this->sections_)
{
- file << (elem)->getFileEntry() << endl;
+ file << section->getFileEntry() << endl;
- for (std::list<ConfigFileEntry*>::const_iterator it_entries = (elem)->getEntriesBegin(); it_entries != (elem)->getEntriesEnd(); ++it_entries)
+ for (std::list<ConfigFileEntry*>::const_iterator it_entries = section->getEntriesBegin(); it_entries != section->getEntriesEnd(); ++it_entries)
file << (*it_entries)->getFileEntry() << endl;
file << endl;
@@ -277,26 +277,26 @@
/**
@brief Returns a pointer to the section with given name (or nullptr if the section doesn't exist).
*/
- ConfigFileSection* ConfigFile::getSection(const std::string& section) const
+ ConfigFileSection* ConfigFile::getSection(const std::string& sectionName) const
{
- for (const auto & elem : this->sections_)
- if ((elem)->getName() == section)
- return (elem);
+ for (ConfigFileSection* section : this->sections_)
+ if (section->getName() == sectionName)
+ return section;
return nullptr;
}
/**
@brief Returns a pointer to the section with given name. If it doesn't exist, the section is created.
*/
- ConfigFileSection* ConfigFile::getOrCreateSection(const std::string& section)
+ ConfigFileSection* ConfigFile::getOrCreateSection(const std::string& sectionName)
{
- for (auto & elem : this->sections_)
- if ((elem)->getName() == section)
- return (elem);
+ for (ConfigFileSection* section : this->sections_)
+ if (section->getName() == sectionName)
+ return section;
this->bUpdated_ = true;
- return (*this->sections_.insert(this->sections_.end(), new ConfigFileSection(section)));
+ return (*this->sections_.insert(this->sections_.end(), new ConfigFileSection(sectionName)));
}
/**
@@ -306,12 +306,12 @@
{
bool sectionsUpdated = false;
- for (auto & elem : this->sections_)
+ for (ConfigFileSection* section : this->sections_)
{
- if ((elem)->bUpdated_)
+ if (section->bUpdated_)
{
sectionsUpdated = true;
- (elem)->bUpdated_ = false;
+ section->bUpdated_ = false;
}
}
Modified: code/branches/cpp11_v2/src/libraries/core/config/ConfigFileManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/config/ConfigFileManager.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/config/ConfigFileManager.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -52,9 +52,9 @@
/// Destructor: Deletes the config files.
ConfigFileManager::~ConfigFileManager()
{
- for (const auto & elem : this->configFiles_)
- if (elem)
- delete (elem);
+ for (ConfigFile* configFile : this->configFiles_)
+ if (configFile)
+ delete configFile;
}
/// Defines the file-name for the config file of a given type (settings, calibration, etc.).
Modified: code/branches/cpp11_v2/src/libraries/core/config/ConfigFileSection.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/config/ConfigFileSection.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/config/ConfigFileSection.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -79,10 +79,10 @@
unsigned int ConfigFileSection::getVectorSize(const std::string& name) const
{
unsigned int size = 0;
- for (const auto & elem : this->entries_)
- if ((elem)->getName() == name)
- if ((elem)->getIndex() >= size)
- size = (elem)->getIndex() + 1;
+ for (ConfigFileEntry* entry : this->entries_)
+ if (entry->getName() == name)
+ if (entry->getIndex() >= size)
+ size = entry->getIndex() + 1;
return size;
}
@@ -104,10 +104,10 @@
*/
ConfigFileEntry* ConfigFileSection::getEntry(const std::string& name) const
{
- for (const auto & elem : this->entries_)
+ for (ConfigFileEntry* entry : this->entries_)
{
- if ((elem)->getName() == name)
- return elem;
+ if (entry->getName() == name)
+ return entry;
}
return nullptr;
}
@@ -120,10 +120,10 @@
*/
ConfigFileEntry* ConfigFileSection::getEntry(const std::string& name, unsigned int index) const
{
- for (const auto & elem : this->entries_)
+ for (ConfigFileEntry* entry : this->entries_)
{
- if (((elem)->getName() == name) && ((elem)->getIndex() == index))
- return elem;
+ if ((entry->getName() == name) && (entry->getIndex() == index))
+ return entry;
}
return nullptr;
}
Modified: code/branches/cpp11_v2/src/libraries/core/config/ConfigValueContainer.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/config/ConfigValueContainer.h 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/config/ConfigValueContainer.h 2015-12-02 22:22:03 UTC (rev 10916)
@@ -129,8 +129,8 @@
this->init(type, identifier, sectionname, varname);
this->value_ = V();
- for (auto & elem : defvalue)
- this->valueVector_.push_back(MultiType(elem));
+ for (const D& defvalueElement : defvalue)
+ this->valueVector_.push_back(MultiType(defvalueElement));
this->initVector();
}
@@ -182,8 +182,8 @@
std::vector<T> temp = *value;
value->clear();
- for (auto & elem : this->valueVector_)
- value->push_back(elem);
+ for (const MultiType& vectorEntry : this->valueVector_)
+ value->push_back(vectorEntry);
if (value->size() != temp.size())
{
@@ -210,8 +210,8 @@
else
{
value->clear();
- for (auto & elem : this->valueVector_)
- value->push_back(elem);
+ for (const MultiType& vectorEntry : this->valueVector_)
+ value->push_back(vectorEntry);
}
return *this;
}
Modified: code/branches/cpp11_v2/src/libraries/core/input/Button.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/Button.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/input/Button.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -195,13 +195,13 @@
cmd->scale_ = paramModifier;
// add command to the buffer if not yet existing
- for (auto & elem : *paramCommandBuffer_)
+ for (BufferedParamCommand* command : *paramCommandBuffer_)
{
- if (elem->evaluation_.getConsoleCommand()
+ if (command->evaluation_.getConsoleCommand()
== eval.getConsoleCommand())
{
// already in list
- cmd->paramCommand_ = elem;
+ cmd->paramCommand_ = command;
break;
}
}
Modified: code/branches/cpp11_v2/src/libraries/core/input/InputBuffer.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/InputBuffer.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/input/InputBuffer.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -109,12 +109,12 @@
void InputBuffer::insert(const std::string& input, bool update)
{
- for (auto & elem : input)
+ for (const char& inputChar : input)
{
- this->insert(elem, false);
+ this->insert(inputChar, false);
if (update)
- this->updated(elem, false);
+ this->updated(inputChar, false);
}
if (update)
@@ -169,19 +169,19 @@
void InputBuffer::updated()
{
- for (auto & elem : this->listeners_)
+ for (BaseInputBufferListenerTuple* listener : this->listeners_)
{
- if ((elem)->bListenToAllChanges_)
- (elem)->callFunction();
+ if (listener->bListenToAllChanges_)
+ listener->callFunction();
}
}
void InputBuffer::updated(const char& update, bool bSingleInput)
{
- for (auto & elem : this->listeners_)
+ for (BaseInputBufferListenerTuple* listener : this->listeners_)
{
- if ((!(elem)->trueKeyFalseChar_) && ((elem)->bListenToAllChanges_ || ((elem)->char_ == update)) && (!(elem)->bOnlySingleInput_ || bSingleInput))
- (elem)->callFunction();
+ if ((!listener->trueKeyFalseChar_) && (listener->bListenToAllChanges_ || (listener->char_ == update)) && (!listener->bOnlySingleInput_ || bSingleInput))
+ listener->callFunction();
}
}
@@ -200,10 +200,10 @@
if (evt.isModifierDown(KeyboardModifier::Alt) && evt.getKeyCode() == KeyCode::Tab)
return;
- for (auto & elem : this->listeners_)
+ for (BaseInputBufferListenerTuple* listener : this->listeners_)
{
- if ((elem)->trueKeyFalseChar_ && ((elem)->key_ == evt.getKeyCode()))
- (elem)->callFunction();
+ if (listener->trueKeyFalseChar_ && (listener->key_ == evt.getKeyCode()))
+ listener->callFunction();
}
if (evt.isModifierDown(KeyboardModifier::Ctrl))
Modified: code/branches/cpp11_v2/src/libraries/core/input/InputDevice.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/InputDevice.h 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/input/InputDevice.h 2015-12-02 22:22:03 UTC (rev 10916)
@@ -157,14 +157,14 @@
oisDevice_->capture();
// Call all the states with the held button event
- for (auto & button : pressedButtons_)
- for (auto & state : inputStates_)
+ for (ButtonType& button : pressedButtons_)
+ for (InputState* state : inputStates_)
state->template buttonEvent<ButtonEvent::THold, typename Traits::ButtonTypeParam>(
this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
// Call states with device update events
- for (auto & elem : inputStates_)
- elem->update(time.getDeltaTime(), this->getDeviceID());
+ for (InputState* state : inputStates_)
+ state->update(time.getDeltaTime(), this->getDeviceID());
static_cast<DeviceClass*>(this)->updateImpl(time);
}
@@ -195,8 +195,8 @@
return; // Button already pressed
// Call states
- for (auto & elem : inputStates_)
- elem->template buttonEvent<ButtonEvent::TPress, typename Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
+ for (InputState* state : inputStates_)
+ state->template buttonEvent<ButtonEvent::TPress, typename Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
}
//! Common code for all button released events (updates pressed buttons list and calls the input states)
@@ -217,8 +217,8 @@
return; // We ignore release strokes when the press was not captured
// Call states
- for (auto & elem : inputStates_)
- elem->template buttonEvent<ButtonEvent::TRelease, typename Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
+ for (InputState* state : inputStates_)
+ state->template buttonEvent<ButtonEvent::TRelease, typename Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
}
//! Managed pointer to the OIS device
Modified: code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -372,11 +372,11 @@
// check whether a state has changed its EMPTY situation
bool bUpdateRequired = false;
- for (auto & elem : activeStates_)
+ for (auto& mapEntry : activeStates_)
{
- if (elem.second->hasExpired())
+ if (mapEntry.second->hasExpired())
{
- elem.second->resetExpiration();
+ mapEntry.second->resetExpiration();
bUpdateRequired = true;
}
}
@@ -390,8 +390,8 @@
device->update(time);
// Collect function calls for the update
- for (auto & elem : activeStatesTicked_)
- elem->update(time.getDeltaTime());
+ for (InputState* state : activeStatesTicked_)
+ state->update(time.getDeltaTime());
// Execute all cached function calls in order
// Why so complicated? The problem is that an InputHandler could trigger
@@ -400,8 +400,8 @@
// violations.
// If we delay the calls, then OIS and and the InputStates are not anymore
// in the call stack and can therefore be edited.
- for (auto & elem : this->callBuffer_)
- elem();
+ for (auto& function : this->callBuffer_)
+ function();
this->callBuffer_.clear();
}
@@ -436,15 +436,15 @@
// See that we only update each InputState once for each device
// Using an std::set to avoid duplicates
std::set<InputState*> tempSet;
- for (auto & elem : devices_)
- if (elem != nullptr)
- for (unsigned int iState = 0; iState < elem->getStateListRef().size(); ++iState)
- tempSet.insert(elem->getStateListRef()[iState]);
+ for (InputDevice* device : devices_)
+ if (device != nullptr)
+ for (unsigned int iState = 0; iState < device->getStateListRef().size(); ++iState)
+ tempSet.insert(device->getStateListRef()[iState]);
// Copy the content of the std::set back to the actual vector
activeStatesTicked_.clear();
- for (const auto & elem : tempSet)
- activeStatesTicked_.push_back(elem);
+ for (InputState* state : tempSet)
+ activeStatesTicked_.push_back(state);
// Check whether we have to change the mouse mode
tribool requestedMode = dontcare;
Modified: code/branches/cpp11_v2/src/libraries/core/input/JoyStick.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/JoyStick.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/input/JoyStick.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -185,8 +185,8 @@
//! Resets the pov states
void JoyStick::clearBuffersImpl()
{
- for (auto & elem : povStates_)
- elem = 0;
+ for (int& state : povStates_)
+ state = 0;
}
//! Generic method to forward axis events
Modified: code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -152,9 +152,9 @@
void KeyBinder::buttonThresholdChanged()
{
- for (auto & elem : allHalfAxes_)
- if (!elem->bButtonThresholdUser_)
- elem->buttonThreshold_ = this->buttonThreshold_;
+ for (HalfAxis* halfAxis : allHalfAxes_)
+ if (!halfAxis->bButtonThresholdUser_)
+ halfAxis->buttonThreshold_ = this->buttonThreshold_;
}
void KeyBinder::JoyStickQuantityChanged(const std::vector<JoyStick*>& joyStickList)
@@ -382,8 +382,8 @@
for (std::map<std::string, Button*>::const_iterator it = allButtons_.begin(); it != allButtons_.end(); ++it)
it->second->clear();
- for (auto & elem : paramCommandBuffer_)
- delete elem;
+ for (BufferedParamCommand* command : paramCommandBuffer_)
+ delete command;
paramCommandBuffer_.clear();
}
@@ -393,9 +393,9 @@
void KeyBinder::changeMode(ConsoleCommand* command, KeybindMode::Value new_mode)
{
// iterate over all buttons
- for (const auto & elem : this->allButtons_)
+ for (const auto& mapEntry : this->allButtons_)
{
- Button* button = elem.second;
+ Button* button = mapEntry.second;
// iterate over all modes
for (int mode_index = 0; mode_index < 3; ++mode_index)
@@ -464,8 +464,8 @@
this->mousePosition_[0] = 0.0f;
this->mousePosition_[1] = 0.0f;
- for (auto & elem : mouseAxes_)
- elem.reset();
+ for (HalfAxis& axis : mouseAxes_)
+ axis.reset();
}
void KeyBinder::mouseUpdated(float dt)
@@ -504,7 +504,7 @@
deriveTime_ += dt;
}
- for (auto & elem : mouseAxes_)
+ for (HalfAxis& axis : mouseAxes_)
{
// Why dividing relative value by dt? The reason lies in the simple fact, that when you
// press a button that has relative movement, that value has to be multiplied by dt to be
@@ -514,10 +514,10 @@
if (dt != 0.0f)
{
// just ignore if dt == 0.0 because we have multiplied by 0.0 anyway..
- elem.relVal_ /= dt;
+ axis.relVal_ /= dt;
}
- tickHalfAxis(elem);
+ tickHalfAxis(axis);
}
}
Modified: code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.h 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.h 2015-12-02 22:22:03 UTC (rev 10916)
@@ -225,15 +225,15 @@
inline void KeyBinder::allDevicesUpdated(float dt)
{
// execute all buffered bindings (additional parameter)
- for (auto & elem : paramCommandBuffer_)
+ for (BufferedParamCommand* command : paramCommandBuffer_)
{
- elem->rel_ *= dt;
- elem->execute();
+ command->rel_ *= dt;
+ command->execute();
}
// always reset the relative movement of the mouse
- for (auto & elem : mouseAxes_)
- elem.relVal_ = 0.0f;
+ for (HalfAxis& axis : mouseAxes_)
+ axis.relVal_ = 0.0f;
}
}// tolua_export
Modified: code/branches/cpp11_v2/src/libraries/core/input/Mouse.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/Mouse.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/input/Mouse.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -81,15 +81,15 @@
IntVector2 abs(e.state.X.abs, e.state.Y.abs);
IntVector2 rel(e.state.X.rel, e.state.Y.rel);
IntVector2 clippingSize(e.state.width, e.state.height);
- for (auto & elem : inputStates_)
- elem->mouseMoved(abs, rel, clippingSize);
+ for (InputState* state : inputStates_)
+ state->mouseMoved(abs, rel, clippingSize);
}
// check for mouse scrolled event
if (e.state.Z.rel != 0)
{
- for (auto & elem : inputStates_)
- elem->mouseScrolled(e.state.Z.abs, e.state.Z.rel);
+ for (InputState* state : inputStates_)
+ state->mouseScrolled(e.state.Z.abs, e.state.Z.rel);
}
return true;
Modified: code/branches/cpp11_v2/src/libraries/core/module/DynLibManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/module/DynLibManager.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/module/DynLibManager.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -74,10 +74,10 @@
DynLibManager::~DynLibManager()
{
// Unload & delete resources in turn
- for (auto & elem : mLibList)
+ for (auto& mapEntry : mLibList)
{
- elem.second->unload();
- delete elem.second;
+ mapEntry.second->unload();
+ delete mapEntry.second;
}
// Empty the list
Modified: code/branches/cpp11_v2/src/libraries/core/module/ModuleInstance.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/module/ModuleInstance.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/module/ModuleInstance.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -58,8 +58,8 @@
void ModuleInstance::loadAllStaticallyInitializedInstances(StaticInitialization::Type type)
{
const std::set<StaticallyInitializedInstance*>& instances = this->staticallyInitializedInstancesByType_[type];
- for (const auto & instance : instances)
- (instance)->load();
+ for (StaticallyInitializedInstance* instance : instances)
+ instance->load();
}
void ModuleInstance::unloadAllStaticallyInitializedInstances(StaticInitialization::Type type)
@@ -74,8 +74,8 @@
{
std::map<StaticInitialization::Type, std::set<StaticallyInitializedInstance*>> copy(this->staticallyInitializedInstancesByType_);
this->staticallyInitializedInstancesByType_.clear();
- for (auto & elem : copy)
- for (std::set<StaticallyInitializedInstance*>::iterator it2 = elem.second.begin(); it2 != elem.second.end(); ++it2)
+ for (auto& mapEntry : copy)
+ for (std::set<StaticallyInitializedInstance*>::iterator it2 = mapEntry.second.begin(); it2 != mapEntry.second.end(); ++it2)
delete (*it2);
}
Modified: code/branches/cpp11_v2/src/libraries/core/module/PluginManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/module/PluginManager.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/module/PluginManager.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -58,19 +58,18 @@
ModifyConsoleCommand("PluginManager", __CC_PluginManager_load_name).setObject(nullptr);
ModifyConsoleCommand("PluginManager", __CC_PluginManager_unload_name).setObject(nullptr);
- for (auto & elem : this->references_)
- delete elem.second;
- for (auto & elem : this->plugins_)
- delete elem.second;
+ for (auto& mapEntry : this->references_)
+ delete mapEntry.second;
+ for (auto& mapEntry : this->plugins_)
+ delete mapEntry.second;
}
void PluginManager::findPlugins()
{
const std::vector<std::string>& pluginPaths = ApplicationPaths::getInstance().getPluginPaths();
- for (auto libraryName : pluginPaths)
+ for (const std::string& libraryName : pluginPaths)
{
std::string name;
-
std::string filename = libraryName + + specialConfig::pluginExtension;
std::ifstream infile(filename.c_str());
if (infile >> name)
Modified: code/branches/cpp11_v2/src/libraries/core/module/StaticInitializationManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/module/StaticInitializationManager.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/module/StaticInitializationManager.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -49,8 +49,8 @@
void StaticInitializationManager::loadModule(ModuleInstance* module)
{
// attention: loading a module may add new handlers to the list
- for (auto & elem : this->handlers_)
- (elem)->loadModule(module);
+ for (StaticInitializationHandler* handler : this->handlers_)
+ handler->loadModule(module);
}
void StaticInitializationManager::unloadModule(ModuleInstance* module)
Modified: code/branches/cpp11_v2/src/libraries/core/object/Context.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/object/Context.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/object/Context.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -69,8 +69,8 @@
{
// unregister context from object lists before object lists are destroyed
this->unregisterObject();
- for (auto & elem : this->objectLists_)
- delete elem;
+ for (ObjectListBase* objectList : this->objectLists_)
+ delete objectList;
}
/*static*/ void Context::setRootContext(Context* context)
Modified: code/branches/cpp11_v2/src/libraries/core/object/Listable.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/object/Listable.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/object/Listable.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -75,8 +75,8 @@
*/
void Listable::unregisterObject()
{
- for (auto & elem : this->elements_)
- Listable::deleteObjectListElement(elem);
+ for (ObjectListBaseElement* element : this->elements_)
+ Listable::deleteObjectListElement(element);
this->elements_.clear();
}
@@ -90,10 +90,10 @@
std::vector<ObjectListBaseElement*> copy = this->elements_;
this->elements_.clear();
- for (auto & elem : copy)
+ for (ObjectListBaseElement* element : copy)
{
- elem->changeContext(this->context_, context);
- Listable::deleteObjectListElement(elem);
+ element->changeContext(this->context_, context);
+ Listable::deleteObjectListElement(element);
}
this->context_ = context;
Modified: code/branches/cpp11_v2/src/libraries/core/object/ObjectListBase.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/object/ObjectListBase.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/object/ObjectListBase.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -91,8 +91,8 @@
*/
void ObjectListBase::notifyRemovalListeners(ObjectListBaseElement* element) const
{
- for (const auto & elem : this->listeners_)
- (elem)->removedElement(element);
+ for (ObjectListElementRemovalListener* listener : this->listeners_)
+ listener->removedElement(element);
}
/**
Modified: code/branches/cpp11_v2/src/libraries/core/singleton/ScopeManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/singleton/ScopeManager.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/core/singleton/ScopeManager.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -72,14 +72,14 @@
void ScopeManager::activateListenersForScope(ScopeID::Value scope)
{
- for (const auto & elem : this->listeners_[scope])
- this->activateListener(elem);
+ for (ScopeListener* listener : this->listeners_[scope])
+ this->activateListener(listener);
}
void ScopeManager::deactivateListenersForScope(ScopeID::Value scope)
{
- for (const auto & elem : this->listeners_[scope])
- this->deactivateListener(elem);
+ for (ScopeListener* listener : this->listeners_[scope])
+ this->deactivateListener(listener);
}
void ScopeManager::activateListener(ScopeListener* listener)
Modified: code/branches/cpp11_v2/src/libraries/network/FunctionCall.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/network/FunctionCall.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/network/FunctionCall.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -130,9 +130,9 @@
*(uint32_t*)(mem+sizeof(uint32_t)) = this->nrOfArguments_;
*(uint32_t*)(mem+2*sizeof(uint32_t)) = this->objectID_;
mem += 3*sizeof(uint32_t);
- for(auto & elem : this->arguments_)
+ for(const MultiType& argument : this->arguments_)
{
- elem.exportData( mem );
+ argument.exportData( mem );
}
}
Modified: code/branches/cpp11_v2/src/libraries/network/Host.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/network/Host.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/network/Host.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -79,11 +79,11 @@
*/
void Host::addPacket(ENetPacket *packet, int clientID, uint8_t channelID)
{
- for(auto & instances_ : instances_s)
+ for(Host* host : instances_s)
{
- if( (instances_)->isActive() )
+ if( host->isActive() )
{
- (instances_)->queuePacket(packet, clientID, channelID);
+ host->queuePacket(packet, clientID, channelID);
}
}
}
@@ -96,9 +96,9 @@
*/
void Host::sendChat(const std::string& message, unsigned int sourceID, unsigned int targetID)
{
- for(auto & instances_ : instances_s)
- if( (instances_)->isActive() )
- (instances_)->doSendChat(message, sourceID, targetID);
+ for(Host* host : instances_s)
+ if( host->isActive() )
+ host->doSendChat(message, sourceID, targetID);
}
/**
@@ -113,11 +113,11 @@
bool Host::isServer()
{
- for (auto & instances_ : instances_s)
+ for (Host* host : instances_s)
{
- if( (instances_)->isActive() )
+ if( host->isActive() )
{
- if( (instances_)->isServer_() )
+ if( host->isServer_() )
return true;
}
}
Modified: code/branches/cpp11_v2/src/libraries/network/synchronisable/Synchronisable.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/network/synchronisable/Synchronisable.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/network/synchronisable/Synchronisable.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -87,8 +87,8 @@
deletedObjects_.push(objectID_);
}
// delete all Synchronisable Variables from syncList_ ( which are also in stringList_ )
- for(auto & elem : syncList_)
- delete (elem);
+ for(SynchronisableVariableBase* variable : syncList_)
+ delete variable;
syncList_.clear();
stringList_.clear();
std::map<uint32_t, Synchronisable*>::iterator it2;
Modified: code/branches/cpp11_v2/src/libraries/tools/DebugDrawer.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/tools/DebugDrawer.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/tools/DebugDrawer.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -391,13 +391,13 @@
{
manualObject->estimateVertexCount(lineVertices.size());
manualObject->estimateIndexCount(lineIndices.size());
- for (auto & elem : lineVertices)
+ for (const VertexPair& pair : lineVertices)
{
- manualObject->position(elem.first);
- manualObject->colour(elem.second);
+ manualObject->position(pair.first);
+ manualObject->colour(pair.second);
}
- for (auto & elem : lineIndices)
- manualObject->index(elem);
+ for (int lineIndex : lineIndices)
+ manualObject->index(lineIndex);
}
else
manualObject->index(0); // this is necessary to avoid crashes with ogre 1.7 if there's a light source in the level
@@ -408,13 +408,13 @@
{
manualObject->estimateVertexCount(triangleVertices.size());
manualObject->estimateIndexCount(triangleIndices.size());
- for (auto & elem : triangleVertices)
+ for (const VertexPair& pair : triangleVertices)
{
- manualObject->position(elem.first);
- manualObject->colour(elem.second.r, elem.second.g, elem.second.b, fillAlpha);
+ manualObject->position(pair.first);
+ manualObject->colour(pair.second.r, pair.second.g, pair.second.b, fillAlpha);
}
- for (auto & elem : triangleIndices)
- manualObject->index(elem);
+ for (int triangleIndex : triangleIndices)
+ manualObject->index(triangleIndex);
}
else
manualObject->index(0); // this is necessary to avoid crashes with ogre 1.7 if there's a light source in the level
Modified: code/branches/cpp11_v2/src/libraries/tools/IcoSphere.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/tools/IcoSphere.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/tools/IcoSphere.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -115,9 +115,8 @@
{
std::list<TriangleIndices> faces2;
- for (auto f : faces)
+ for (const TriangleIndices& f : faces)
{
-
int a = getMiddlePoint(f.v1, f.v2);
int b = getMiddlePoint(f.v2, f.v3);
int c = getMiddlePoint(f.v3, f.v1);
@@ -193,20 +192,20 @@
void IcoSphere::addToLineIndices(int baseIndex, std::list<int>* target) const
{
- for (const auto & elem : lineIndices)
+ for (const LineIndices& line : lineIndices)
{
- target->push_back(baseIndex + (elem).v1);
- target->push_back(baseIndex + (elem).v2);
+ target->push_back(baseIndex + line.v1);
+ target->push_back(baseIndex + line.v2);
}
}
void IcoSphere::addToTriangleIndices(int baseIndex, std::list<int>* target) const
{
- for (const auto & elem : faces)
+ for (const TriangleIndices& triangle : faces)
{
- target->push_back(baseIndex + (elem).v1);
- target->push_back(baseIndex + (elem).v2);
- target->push_back(baseIndex + (elem).v3);
+ target->push_back(baseIndex + triangle.v1);
+ target->push_back(baseIndex + triangle.v2);
+ target->push_back(baseIndex + triangle.v3);
}
}
@@ -216,8 +215,8 @@
transform.setTrans(position);
transform.setScale(Ogre::Vector3(scale, scale, scale));
- for (auto & elem : vertices)
- target->push_back(VertexPair(transform * elem, colour));
+ for (const Ogre::Vector3& vertex : vertices)
+ target->push_back(VertexPair(transform * vertex, colour));
return vertices.size();
}
Modified: code/branches/cpp11_v2/src/libraries/tools/Shader.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/tools/Shader.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/tools/Shader.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -196,25 +196,25 @@
void Shader::notifyMaterialRender(Ogre::uint32 pass_id, Ogre::MaterialPtr& materialPtr)
{
// iterate through the list of parameters
- for (auto & elem : this->parameters_)
+ for (const ParameterContainer& parameter : this->parameters_)
{
- Ogre::Technique* techniquePtr = materialPtr->getTechnique(elem.technique_);
+ Ogre::Technique* techniquePtr = materialPtr->getTechnique(parameter.technique_);
if (techniquePtr)
{
- Ogre::Pass* passPtr = techniquePtr->getPass(elem.pass_);
+ Ogre::Pass* passPtr = techniquePtr->getPass(parameter.pass_);
if (passPtr)
{
// change the value of the parameter depending on its type
- if (elem.value_.isType<int>())
- passPtr->getFragmentProgramParameters()->setNamedConstant(elem.parameter_, elem.value_.get<int>());
- else if (elem.value_.isType<float>())
- passPtr->getFragmentProgramParameters()->setNamedConstant(elem.parameter_, elem.value_.get<float>());
+ if (parameter.value_.isType<int>())
+ passPtr->getFragmentProgramParameters()->setNamedConstant(parameter.parameter_, parameter.value_.get<int>());
+ else if (parameter.value_.isType<float>())
+ passPtr->getFragmentProgramParameters()->setNamedConstant(parameter.parameter_, parameter.value_.get<float>());
}
else
- orxout(internal_warning) << "No pass " << elem.pass_ << " in technique " << elem.technique_ << " in compositor \"" << this->compositorName_ << "\" or pass has no shader." << endl;
+ orxout(internal_warning) << "No pass " << parameter.pass_ << " in technique " << parameter.technique_ << " in compositor \"" << this->compositorName_ << "\" or pass has no shader." << endl;
}
else
- orxout(internal_warning) << "No technique " << elem.technique_ << " in compositor \"" << this->compositorName_ << "\" or technique has no pass with shader." << endl;
+ orxout(internal_warning) << "No technique " << parameter.technique_ << " in compositor \"" << this->compositorName_ << "\" or technique has no pass with shader." << endl;
}
this->parameters_.clear();
}
@@ -227,7 +227,7 @@
if (Ogre::Root::getSingletonPtr())
{
const Ogre::Root::PluginInstanceList& plugins = Ogre::Root::getSingleton().getInstalledPlugins();
- for (auto & plugin : plugins)
+ for (Ogre::Plugin* plugin : plugins)
if (plugin->getName() == "Cg Program Manager")
return true;
}
Modified: code/branches/cpp11_v2/src/libraries/util/DisplayStringConversions.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/util/DisplayStringConversions.h 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/util/DisplayStringConversions.h 2015-12-02 22:22:03 UTC (rev 10916)
@@ -50,9 +50,9 @@
inline static bool convert(Ogre::DisplayString* output, const std::string& input)
{
Ogre::UTFString::code_point cp;
- for (auto & elem : input)
+ for (const char& character : input)
{
- cp = elem;
+ cp = character;
cp &= 0xFF;
output->append(1, cp);
}
Modified: code/branches/cpp11_v2/src/libraries/util/Serialise.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/util/Serialise.h 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/util/Serialise.h 2015-12-02 22:22:03 UTC (rev 10916)
@@ -671,8 +671,8 @@
template <class T> inline uint32_t returnSize( const std::set<T>& variable )
{
uint32_t tempsize = sizeof(uint32_t); // for the number of entries
- for(const auto & elem : *((std::set<T>*)(&variable)))
- tempsize += returnSize( elem );
+ for(const T& element : *((std::set<T>*)(&variable)))
+ tempsize += returnSize( element );
return tempsize;
}
Modified: code/branches/cpp11_v2/src/libraries/util/SignalHandler.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/util/SignalHandler.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/util/SignalHandler.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -80,9 +80,9 @@
*/
void SignalHandler::dontCatch()
{
- for (auto & elem : sigRecList)
+ for (const SignalRec& sigRec : sigRecList)
{
- signal( elem.signal, elem.handler );
+ signal( sigRec.signal, sigRec.handler );
}
sigRecList.clear();
@@ -132,9 +132,9 @@
exit(EXIT_FAILURE);
}
- for (auto & elem : SignalHandler::getInstance().callbackList)
+ for (const SignalCallbackRec& callback : SignalHandler::getInstance().callbackList)
{
- (*(elem.cb))( elem.someData );
+ (*(callback.cb))( callback.someData );
}
Modified: code/branches/cpp11_v2/src/libraries/util/SmallObjectAllocator.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/util/SmallObjectAllocator.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/util/SmallObjectAllocator.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -52,8 +52,8 @@
*/
SmallObjectAllocator::~SmallObjectAllocator()
{
- for (auto & elem : this->blocks_)
- delete[] elem;
+ for (char* block : this->blocks_)
+ delete[] block;
}
/**
Modified: code/branches/cpp11_v2/src/libraries/util/StringUtils.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/util/StringUtils.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/util/StringUtils.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -261,9 +261,9 @@
{
std::string output(str.size() * 2, ' ');
size_t i = 0;
- for (auto & elem : str)
+ for (const char& character : str)
{
- switch (elem)
+ switch (character)
{
case '\\': output[i] = '\\'; output[i + 1] = '\\'; break;
case '\n': output[i] = '\\'; output[i + 1] = 'n'; break;
@@ -275,7 +275,7 @@
case '\a': output[i] = '\\'; output[i + 1] = 'a'; break;
case '"': output[i] = '\\'; output[i + 1] = '"'; break;
case '\0': output[i] = '\\'; output[i + 1] = '0'; break;
- default : output[i] = elem; ++i; continue;
+ default : output[i] = character; ++i; continue;
}
i += 2;
}
@@ -335,9 +335,9 @@
/// Replaces each char between A and Z with its lowercase equivalent.
void lowercase(std::string* str)
{
- for (auto & elem : *str)
+ for (char& character : *str)
{
- elem = static_cast<char>(tolower(elem));
+ character = static_cast<char>(tolower(character));
}
}
@@ -352,9 +352,9 @@
/// Replaces each char between a and z with its uppercase equivalent.
void uppercase(std::string* str)
{
- for (auto & elem : *str)
+ for (char& character : *str)
{
- elem = static_cast<char>(toupper(elem));
+ character = static_cast<char>(toupper(character));
}
}
@@ -459,11 +459,11 @@
size_t replaceCharacters(std::string& str, char target, char replacement)
{
size_t j = 0;
- for (auto & elem : str)
+ for (char& character : str)
{
- if (elem == target)
+ if (character == target)
{
- elem = replacement;
+ character = replacement;
++j;
}
}
Modified: code/branches/cpp11_v2/src/libraries/util/output/BaseWriter.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/util/output/BaseWriter.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/util/output/BaseWriter.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -115,10 +115,8 @@
std::set<const OutputContextContainer*> sub_contexts;
// iterate over all strings in the config-vector
- for (auto & full_name : this->configurableAdditionalContexts_)
+ for (const std::string& full_name : this->configurableAdditionalContexts_)
{
-
-
// split the name into main-name and sub-name (if given; otherwise sub-name remains empty). both names are separated by ::
std::string name = full_name;
std::string subname;
Modified: code/branches/cpp11_v2/src/libraries/util/output/MemoryWriter.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/util/output/MemoryWriter.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/util/output/MemoryWriter.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -64,9 +64,8 @@
*/
void MemoryWriter::resendOutput(OutputListener* listener) const
{
- for (auto & message : this->messages_)
+ for (const Message& message : this->messages_)
{
-
listener->unfilteredOutput(message.level, *message.context, message.lines);
}
}
Modified: code/branches/cpp11_v2/src/libraries/util/output/OutputListener.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/util/output/OutputListener.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/util/output/OutputListener.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -110,8 +110,8 @@
{
this->levelMask_ = mask;
- for (auto & elem : this->listeners_)
- elem->updatedLevelMask(this);
+ for (AdditionalContextListener* listener : this->listeners_)
+ listener->updatedLevelMask(this);
}
/**
@@ -141,8 +141,8 @@
{
this->additionalContextsLevelMask_ = mask;
- for (auto & elem : this->listeners_)
- elem->updatedAdditionalContextsLevelMask(this);
+ for (AdditionalContextListener* listener : this->listeners_)
+ listener->updatedAdditionalContextsLevelMask(this);
}
/**
@@ -152,8 +152,8 @@
{
this->additionalContextsMask_ = mask;
- for (auto & elem : this->listeners_)
- elem->updatedAdditionalContextsMask(this);
+ for (AdditionalContextListener* listener : this->listeners_)
+ listener->updatedAdditionalContextsMask(this);
}
/**
Modified: code/branches/cpp11_v2/src/libraries/util/output/OutputManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/util/output/OutputManager.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/util/output/OutputManager.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -130,8 +130,8 @@
std::vector<std::string> lines;
vectorize(message, '\n', &lines);
- for (auto & elem : this->listeners_)
- elem->unfilteredOutput(level, context, lines);
+ for (OutputListener* listener : this->listeners_)
+ listener->unfilteredOutput(level, context, lines);
}
/**
@@ -177,8 +177,8 @@
void OutputManager::updateCombinedLevelMask()
{
int mask = 0;
- for (auto & elem : this->listeners_)
- mask |= elem->getLevelMask();
+ for (OutputListener* listener : this->listeners_)
+ mask |= listener->getLevelMask();
this->combinedLevelMask_ = static_cast<OutputLevel>(mask);
}
@@ -188,8 +188,8 @@
void OutputManager::updateCombinedAdditionalContextsLevelMask()
{
int mask = 0;
- for (auto & elem : this->listeners_)
- mask |= elem->getAdditionalContextsLevelMask();
+ for (OutputListener* listener : this->listeners_)
+ mask |= listener->getAdditionalContextsLevelMask();
this->combinedAdditionalContextsLevelMask_ = static_cast<OutputLevel>(mask);
}
@@ -199,8 +199,8 @@
void OutputManager::updateCombinedAdditionalContextsMask()
{
this->combinedAdditionalContextsMask_ = 0;
- for (auto & elem : this->listeners_)
- this->combinedAdditionalContextsMask_ |= elem->getAdditionalContextsMask();
+ for (OutputListener* listener : this->listeners_)
+ this->combinedAdditionalContextsMask_ |= listener->getAdditionalContextsMask();
}
/**
Modified: code/branches/cpp11_v2/src/libraries/util/output/SubcontextOutputListener.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/util/output/SubcontextOutputListener.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/libraries/util/output/SubcontextOutputListener.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -78,10 +78,10 @@
this->subcontexts_.clear();
// compose the mask of subcontexts and build the set of sub-context-IDs
- for (const auto & subcontext : subcontexts)
+ for (const OutputContextContainer* subcontext : subcontexts)
{
- this->subcontextsCheckMask_ |= (subcontext)->mask;
- this->subcontexts_.insert((subcontext)->sub_id);
+ this->subcontextsCheckMask_ |= subcontext->mask;
+ this->subcontexts_.insert(subcontext->sub_id);
}
OutputListener::setAdditionalContextsMask(this->subcontextsCheckMask_ | this->subcontextsNoCheckMask_);
Modified: code/branches/cpp11_v2/src/modules/docking/Dock.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/docking/Dock.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/docking/Dock.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -326,10 +326,10 @@
const DockingEffect* Dock::getEffect(unsigned int i) const
{
- for (const auto & elem : this->effects_)
+ for (DockingEffect* effect : this->effects_)
{
if(i == 0)
- return elem;
+ return effect;
i--;
}
return nullptr;
@@ -345,10 +345,10 @@
const DockingAnimation* Dock::getAnimation(unsigned int i) const
{
- for (const auto & elem : this->animations_)
+ for (DockingAnimation* animation : this->animations_)
{
if(i == 0)
- return elem;
+ return animation;
i--;
}
return nullptr;
Modified: code/branches/cpp11_v2/src/modules/docking/DockingAnimation.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/docking/DockingAnimation.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/docking/DockingAnimation.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -56,12 +56,12 @@
{
bool check = true;
- for (auto & animations_animation : animations)
+ for (DockingAnimation* animation : animations)
{
if(dock)
- check &= (animations_animation)->docking(player);
+ check &= animation->docking(player);
else
- check &= (animations_animation)->release(player);
+ check &= animation->release(player);
}
return check;
Modified: code/branches/cpp11_v2/src/modules/docking/DockingEffect.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/docking/DockingEffect.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/docking/DockingEffect.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -52,12 +52,12 @@
{
bool check = true;
- for (auto & effects_effect : effects)
+ for (DockingEffect* effect : effects)
{
if (dock)
- check &= (effects_effect)->docking(player);
+ check &= effect->docking(player);
else
- check &= (effects_effect)->release(player);
+ check &= effect->release(player);
}
return check;
Modified: code/branches/cpp11_v2/src/modules/gametypes/RaceCheckPoint.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/gametypes/RaceCheckPoint.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/gametypes/RaceCheckPoint.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -145,13 +145,13 @@
Vector3 RaceCheckPoint::getNextCheckpointsAsVector3()
{
Vector3 checkpoints(-1,-1,-1); int count=0;
- for (const auto & elem : nextCheckpoints_)
+ for (int nextCheckpoint : nextCheckpoints_)
{
switch (count)
{
- case 0: checkpoints.x = static_cast<Ogre::Real>(elem); break;
- case 1: checkpoints.y = static_cast<Ogre::Real>(elem); break;
- case 2: checkpoints.z = static_cast<Ogre::Real>(elem); break;
+ case 0: checkpoints.x = static_cast<Ogre::Real>(nextCheckpoint); break;
+ case 1: checkpoints.y = static_cast<Ogre::Real>(nextCheckpoint); break;
+ case 2: checkpoints.z = static_cast<Ogre::Real>(nextCheckpoint); break;
}
++count;
}
Modified: code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceController.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceController.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceController.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -153,18 +153,18 @@
std::vector<RaceCheckPoint*> SpaceRaceController::findStaticCheckpoints(RaceCheckPoint* currentCheckpoint, const std::vector<RaceCheckPoint*>& allCheckpoints)
{
std::map<RaceCheckPoint*, int> zaehler; // counts how many times the checkpoint was reached (for simulation)
- for (auto & allCheckpoint : allCheckpoints)
+ for (RaceCheckPoint* checkpoint : allCheckpoints)
{
- zaehler.insert(std::pair<RaceCheckPoint*, int>(allCheckpoint,0));
+ zaehler.insert(std::pair<RaceCheckPoint*, int>(checkpoint,0));
}
int maxWays = rekSimulationCheckpointsReached(currentCheckpoint, zaehler);
std::vector<RaceCheckPoint*> returnVec;
- for (auto & elem : zaehler)
+ for (auto& mapEntry : zaehler)
{
- if (elem.second == maxWays)
+ if (mapEntry.second == maxWays)
{
- returnVec.push_back(elem.first);
+ returnVec.push_back(mapEntry.first);
}
}
return returnVec;
@@ -225,9 +225,9 @@
RaceCheckPoint* minNextRaceCheckPoint = nullptr;
// find the next checkpoint with the minimal distance
- for (auto elem : raceCheckpoint->getNextCheckpoints())
+ for (int checkpointIndex : raceCheckpoint->getNextCheckpoints())
{
- RaceCheckPoint* nextRaceCheckPoint = findCheckpoint(elem);
+ RaceCheckPoint* nextRaceCheckPoint = findCheckpoint(checkpointIndex);
float distance = recCalculateDistance(nextRaceCheckPoint, this->getControllableEntity()->getPosition());
if (distance < minDistance || minNextRaceCheckPoint == nullptr)
@@ -288,9 +288,9 @@
RaceCheckPoint* SpaceRaceController::findCheckpoint(int index) const
{
- for (auto & elem : this->checkpoints_)
- if (elem->getCheckpointIndex() == index)
- return elem;
+ for (RaceCheckPoint* checkpoint : this->checkpoints_)
+ if (checkpoint->getCheckpointIndex() == index)
+ return checkpoint;
return nullptr;
}
@@ -413,11 +413,11 @@
btVector3 positionObject;
btScalar radiusObject;
- for (const auto & allObject : allObjects)
+ for (StaticEntity* object : allObjects)
{
- for (int everyShape=0; (allObject)->getAttachedCollisionShape(everyShape) != nullptr; everyShape++)
+ for (int everyShape=0; object->getAttachedCollisionShape(everyShape) != nullptr; everyShape++)
{
- btCollisionShape* currentShape = (allObject)->getAttachedCollisionShape(everyShape)->getCollisionShape();
+ btCollisionShape* currentShape = object->getAttachedCollisionShape(everyShape)->getCollisionShape();
if(currentShape == nullptr)
continue;
Modified: code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceManager.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceManager.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceManager.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -53,8 +53,8 @@
SpaceRaceManager::~SpaceRaceManager()
{
- for (auto & elem : this->checkpoints_)
- elem->destroy();
+ for (RaceCheckPoint* checkpoint : this->checkpoints_)
+ checkpoint->destroy();
}
void SpaceRaceManager::XMLPort(Element& xmlelement, XMLPort::Mode mode)
@@ -76,13 +76,13 @@
this->firstcheckpointvisible_ = true;
}
- for (auto & elem : players_)
+ for (auto& mapEntry : players_)
{
- for (auto & _i : this->checkpoints_)
+ for (RaceCheckPoint* checkpoint : this->checkpoints_)
{
- if (_i->playerWasHere(elem.first)){
- this->checkpointReached(_i, elem.first /*this->checkpoints_[i]->getPlayer()*/);
+ if (checkpoint->playerWasHere(mapEntry.first)){
+ this->checkpointReached(checkpoint, mapEntry.first /*this->checkpoints_[i]->getPlayer()*/);
}
}
}
@@ -112,9 +112,9 @@
*/
RaceCheckPoint* SpaceRaceManager::findCheckpoint(int index) const
{
- for (auto & elem : this->checkpoints_)
- if (elem->getCheckpointIndex() == index)
- return elem;
+ for (RaceCheckPoint* checkpoint : this->checkpoints_)
+ if (checkpoint->getCheckpointIndex() == index)
+ return checkpoint;
return nullptr;
}
@@ -124,7 +124,7 @@
{
// the player already visited an old checkpoint; see which checkpoints are possible now
const std::set<int>& possibleCheckpoints = oldCheckpoint->getNextCheckpoints();
- for (const auto & possibleCheckpoint : possibleCheckpoints)
+ for (int possibleCheckpoint : possibleCheckpoints)
if (this->findCheckpoint(possibleCheckpoint) == newCheckpoint)
return true;
return false;
@@ -178,8 +178,8 @@
if (oldCheckpoint)
{
const std::set<int>& oldVisible = oldCheckpoint->getNextCheckpoints();
- for (const auto & elem : oldVisible)
- this->findCheckpoint(elem)->setRadarVisibility(false);
+ for (int checkpointIndex : oldVisible)
+ this->findCheckpoint(checkpointIndex)->setRadarVisibility(false);
}
if (newCheckpoint)
@@ -187,8 +187,8 @@
newCheckpoint->setRadarVisibility(false);
const std::set<int>& newVisible = newCheckpoint->getNextCheckpoints();
- for (const auto & elem : newVisible)
- this->findCheckpoint(elem)->setRadarVisibility(true);
+ for (int checkpointIndex : newVisible)
+ this->findCheckpoint(checkpointIndex)->setRadarVisibility(true);
}
}
}
Modified: code/branches/cpp11_v2/src/modules/jump/Jump.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/jump/Jump.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/jump/Jump.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -632,12 +632,12 @@
} matrix[numI][numJ];
- for (auto & elem : matrix)
+ for (int i = 0; i < numI; ++i)
{
for (int j = 0; j < numJ; ++j)
{
- elem[j].type = PLATFORM_EMPTY;
- elem[j].done = false;
+ matrix[i][j].type = PLATFORM_EMPTY;
+ matrix[i][j].done = false;
}
}
PlatformType platformtype1;
@@ -794,19 +794,19 @@
}
// Fill matrix with selected platform types
- for (auto & elem : matrix)
+ for (int i = 0; i < numI; ++ i)
{
for (int j = 0; j < numJ; ++ j)
{
if (rand()%3 == 0)
{
- elem[j].type = platformtype1;
+ matrix[i][j].type = platformtype1;
}
else
{
- elem[j].type = platformtype2;
+ matrix[i][j].type = platformtype2;
}
- elem[j].done = false;
+ matrix[i][j].done = false;
}
}
Modified: code/branches/cpp11_v2/src/modules/mini4dgame/Mini4Dgame.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/mini4dgame/Mini4Dgame.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/mini4dgame/Mini4Dgame.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -154,13 +154,13 @@
void Mini4Dgame::spawnPlayersIfRequested()
{
// first spawn human players to assign always the left bat to the player in singleplayer
- for (auto & elem : this->players_)
- if (elem.first->isHumanPlayer() && (elem.first->isReadyToSpawn() || this->bForceSpawn_))
- this->spawnPlayer(elem.first);
+ for (auto& mapEntry : this->players_)
+ if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
+ this->spawnPlayer(mapEntry.first);
// now spawn bots
- for (auto & elem : this->players_)
- if (!elem.first->isHumanPlayer() && (elem.first->isReadyToSpawn() || this->bForceSpawn_))
- this->spawnPlayer(elem.first);
+ for (auto& mapEntry : this->players_)
+ if (!mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
+ this->spawnPlayer(mapEntry.first);
}
/**
Modified: code/branches/cpp11_v2/src/modules/notifications/NotificationManager.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/notifications/NotificationManager.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/notifications/NotificationManager.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -68,8 +68,8 @@
NotificationManager::~NotificationManager()
{
// Destroys all Notifications.
- for(auto & elem : this->allNotificationsList_)
- elem.second->destroy();
+ for(auto& mapEntry : this->allNotificationsList_)
+ mapEntry.second->destroy();
this->allNotificationsList_.clear();
orxout(internal_info, context::notifications) << "NotificationManager destroyed." << endl;
@@ -151,12 +151,12 @@
bool all = (sender == NotificationListener::ALL);
bool executed = false;
// Clear all NotificationQueues that have the input sender as target.
- for(auto & elem : this->queues_) // Iterate through all NotificationQueues.
+ for(auto& mapEntry : this->queues_) // Iterate through all NotificationQueues.
{
- const std::set<std::string>& set = elem.second->getTargetsSet();
+ const std::set<std::string>& set = mapEntry.second->getTargetsSet();
// If either the sender is 'all', the NotificationQueue has as target all or the NotificationQueue has the input sender as a target.
if(all || set.find(NotificationListener::ALL) != set.end() || set.find(sender) != set.end())
- executed = elem.second->tidy() || executed;
+ executed = mapEntry.second->tidy() || executed;
}
return executed;
@@ -186,16 +186,16 @@
bool all = (notification->getSender() == NotificationListener::ALL);
// Insert the Notification in all NotificationQueues that have its sender as target.
- for(auto & elem : this->queues_) // Iterate through all NotificationQueues.
+ for(auto& mapEntry : this->queues_) // Iterate through all NotificationQueues.
{
- const std::set<std::string>& set = elem.second->getTargetsSet();
+ const std::set<std::string>& set = mapEntry.second->getTargetsSet();
bool bAll = set.find(NotificationListener::ALL) != set.end();
// If either the Notification has as sender 'all', the NotificationQueue displays all Notifications or the NotificationQueue has the sender of the Notification as target.
if(all || bAll || set.find(notification->getSender()) != set.end())
{
if(!bAll)
- this->notificationLists_[elem.second->getName()]->insert(std::pair<std::time_t, Notification*>(time, notification)); // Insert the Notification in the notifications list of the current NotificationQueue.
- elem.second->update(notification, time); // Update the NotificationQueue.
+ this->notificationLists_[mapEntry.second->getName()]->insert(std::pair<std::time_t, Notification*>(time, notification)); // Insert the Notification in the notifications list of the current NotificationQueue.
+ mapEntry.second->update(notification, time); // Update the NotificationQueue.
}
}
@@ -344,10 +344,10 @@
}
// Iterate through all Notifications to determine whether any of them should belong to the newly registered NotificationQueue.
- for(auto & elem : this->allNotificationsList_)
+ for(auto& mapEntry : this->allNotificationsList_)
{
- if(!bAll && set.find(elem.second->getSender()) != set.end()) // Checks whether the listener has the sender of the current Notification as target.
- map->insert(std::pair<std::time_t, Notification*>(elem.first, elem.second));
+ if(!bAll && set.find(mapEntry.second->getSender()) != set.end()) // Checks whether the listener has the sender of the current Notification as target.
+ map->insert(std::pair<std::time_t, Notification*>(mapEntry.first, mapEntry.second));
}
queue->update(); // Update the queue.
Modified: code/branches/cpp11_v2/src/modules/notifications/NotificationQueue.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/notifications/NotificationQueue.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/notifications/NotificationQueue.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -205,10 +205,10 @@
if(!notifications->empty())
{
// Add all Notifications that have been created after this NotificationQueue was created.
- for(auto & notification : *notifications)
+ for(auto& mapEntry : *notifications)
{
- if(notification.first >= this->creationTime_)
- this->push(notification.second, notification.first);
+ if(mapEntry.first >= this->creationTime_)
+ this->push(mapEntry.second, mapEntry.first);
}
}
@@ -335,8 +335,8 @@
orxout(verbose, context::notifications) << "Clearing NotificationQueue " << this->getName() << "." << endl;
this->ordering_.clear();
// Delete all NotificationContainers in the list.
- for(auto & elem : this->notifications_)
- delete elem;
+ for(NotificationContainer* notification : this->notifications_)
+ delete notification;
this->notifications_.clear();
this->size_ = 0;
@@ -425,13 +425,13 @@
std::stringstream stream;
bool first = true;
// Iterate through the set of targets.
- for(const auto & elem : this->targets_)
+ for(const std::string& target : this->targets_)
{
if(!first)
stream << ", ";
else
first = false;
- stream << elem;
+ stream << target;
}
return *(new std::string(stream.str()));
Modified: code/branches/cpp11_v2/src/modules/objects/Attacher.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/objects/Attacher.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/objects/Attacher.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -60,16 +60,16 @@
{
SUPER(Attacher, changedActivity);
- for (auto & elem : this->objects_)
- (elem)->setActive(this->isActive());
+ for (WorldEntity* object : this->objects_)
+ object->setActive(this->isActive());
}
void Attacher::changedVisibility()
{
SUPER(Attacher, changedVisibility);
- for (auto & elem : this->objects_)
- (elem)->setVisible(this->isVisible());
+ for (WorldEntity* object : this->objects_)
+ object->setVisible(this->isVisible());
}
void Attacher::addObject(WorldEntity* object)
@@ -82,10 +82,10 @@
WorldEntity* Attacher::getObject(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->objects_)
+ for (WorldEntity* object : this->objects_)
{
if (i == index)
- return (elem);
+ return object;
++i;
}
Modified: code/branches/cpp11_v2/src/modules/objects/Script.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/objects/Script.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/objects/Script.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -195,9 +195,9 @@
if(this->isForAll())
{
const std::map<unsigned int, PlayerInfo*> clients = PlayerManager::getInstance().getClients();
- for(const auto & client : clients)
+ for(const auto& mapEntry : clients)
{
- callStaticNetworkFunction(&Script::executeHelper, client.first, this->getCode(), this->getMode(), this->getNeedsGraphics());
+ callStaticNetworkFunction(&Script::executeHelper, mapEntry.first, this->getCode(), this->getMode(), this->getNeedsGraphics());
if(this->times_ != Script::INF) // Decrement the number of remaining executions.
{
this->remainingExecutions_--;
Modified: code/branches/cpp11_v2/src/modules/objects/SpaceBoundaries.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/objects/SpaceBoundaries.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/objects/SpaceBoundaries.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -58,11 +58,11 @@
{
this->pawnsIn_.clear();
- for(auto & elem : this->billboards_)
+ for(BillboardAdministration& billboard : this->billboards_)
{
- if( elem.billy != nullptr)
+ if( billboard.billy != nullptr)
{
- delete elem.billy;
+ delete billboard.billy;
}
}
this->billboards_.clear();
@@ -137,10 +137,10 @@
void SpaceBoundaries::removeAllBillboards()
{
- for(auto & elem : this->billboards_)
+ for(BillboardAdministration& billboard : this->billboards_)
{
- elem.usedYet = false;
- elem.billy->setVisible(false);
+ billboard.usedYet = false;
+ billboard.billy->setVisible(false);
}
}
@@ -207,9 +207,8 @@
float distance;
bool humanItem;
- for(auto currentPawn : pawnsIn_)
+ for(Pawn* currentPawn : pawnsIn_)
{
-
if( currentPawn && currentPawn->getNode() )
{
distance = this->computeDistance(currentPawn);
Modified: code/branches/cpp11_v2/src/modules/objects/eventsystem/EventDispatcher.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/objects/eventsystem/EventDispatcher.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/objects/eventsystem/EventDispatcher.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -44,8 +44,8 @@
EventDispatcher::~EventDispatcher()
{
if (this->isInitialized())
- for (auto & elem : this->targets_)
- (elem)->destroy();
+ for (BaseObject* target : this->targets_)
+ target->destroy();
}
void EventDispatcher::XMLPort(Element& xmlelement, XMLPort::Mode mode)
@@ -60,8 +60,8 @@
void EventDispatcher::processEvent(Event& event)
{
- for (auto & elem : this->targets_)
- (elem)->processEvent(event);
+ for (BaseObject* target : this->targets_)
+ target->processEvent(event);
}
void EventDispatcher::addTarget(BaseObject* target)
@@ -72,10 +72,10 @@
BaseObject* EventDispatcher::getTarget(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->targets_)
+ for (BaseObject* target : this->targets_)
{
if (i == index)
- return (elem);
+ return target;
++i;
}
return nullptr;
Modified: code/branches/cpp11_v2/src/modules/objects/eventsystem/EventFilter.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/objects/eventsystem/EventFilter.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/objects/eventsystem/EventFilter.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -95,10 +95,10 @@
BaseObject* EventFilter::getFilterSource(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->sources_)
+ for (BaseObject* source : this->sources_)
{
if (i == index)
- return (elem);
+ return source;
++i;
}
return nullptr;
@@ -112,10 +112,10 @@
EventName* EventFilter::getEventName(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->names_)
+ for (EventName* name : this->names_)
{
if (i == index)
- return (elem);
+ return name;
++i;
}
return nullptr;
Modified: code/branches/cpp11_v2/src/modules/objects/triggers/DistanceMultiTrigger.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/objects/triggers/DistanceMultiTrigger.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/objects/triggers/DistanceMultiTrigger.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -157,11 +157,11 @@
if(this->beaconMode_ == distanceMultiTriggerBeaconMode::exclude)
{
- const std::set<WorldEntity*> attached = entity->getAttachedObjects();
+ const std::set<WorldEntity*> attachedObjects = entity->getAttachedObjects();
bool found = false;
- for(const auto & elem : attached)
+ for(WorldEntity* attachedObject : attachedObjects)
{
- if((elem)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(elem)->getName() == this->targetName_)
+ if(attachedObject->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(attachedObject)->getName() == this->targetName_)
{
found = true;
break;
Modified: code/branches/cpp11_v2/src/modules/objects/triggers/DistanceTrigger.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/objects/triggers/DistanceTrigger.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/objects/triggers/DistanceTrigger.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -179,11 +179,11 @@
if(this->beaconMode_ == distanceTriggerBeaconMode::exclude)
{
- const std::set<WorldEntity*> attached = entity->getAttachedObjects();
+ const std::set<WorldEntity*> attachedObjects = entity->getAttachedObjects();
bool found = false;
- for(const auto & elem : attached)
+ for(WorldEntity* attachedObject : attachedObjects)
{
- if((elem)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(elem)->getName() == this->targetName_)
+ if(attachedObject->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(attachedObject)->getName() == this->targetName_)
{
found = true;
break;
Modified: code/branches/cpp11_v2/src/modules/objects/triggers/MultiTrigger.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/objects/triggers/MultiTrigger.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/objects/triggers/MultiTrigger.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -503,9 +503,8 @@
*/
bool MultiTrigger::checkAnd(BaseObject* triggerer)
{
- for(auto trigger : this->children_)
+ for(TriggerBase* trigger : this->children_)
{
-
if(trigger->isMultiTrigger())
{
if(!static_cast<MultiTrigger*>(trigger)->isActive(triggerer))
@@ -530,9 +529,8 @@
*/
bool MultiTrigger::checkOr(BaseObject* triggerer)
{
- for(auto trigger : this->children_)
+ for(TriggerBase* trigger : this->children_)
{
-
if(trigger->isMultiTrigger())
{
if(static_cast<MultiTrigger*>(trigger)->isActive(triggerer))
@@ -558,9 +556,8 @@
bool MultiTrigger::checkXor(BaseObject* triggerer)
{
bool triggered = false;
- for(auto trigger : this->children_)
+ for(TriggerBase* trigger : this->children_)
{
-
if(triggered)
{
if(trigger->isMultiTrigger())
Modified: code/branches/cpp11_v2/src/modules/objects/triggers/Trigger.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/objects/triggers/Trigger.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/objects/triggers/Trigger.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -233,9 +233,9 @@
bool Trigger::checkAnd()
{
// Iterate over all sub-triggers.
- for (const auto & elem : this->children_)
+ for (TriggerBase* child : this->children_)
{
- if (!(elem)->isActive())
+ if (!child->isActive())
return false;
}
return true;
@@ -251,9 +251,9 @@
bool Trigger::checkOr()
{
// Iterate over all sub-triggers.
- for (const auto & elem : this->children_)
+ for (TriggerBase* child : this->children_)
{
- if ((elem)->isActive())
+ if (child->isActive())
return true;
}
return false;
@@ -269,11 +269,11 @@
bool Trigger::checkXor()
{
bool test = false;
- for (const auto & elem : this->children_)
+ for (TriggerBase* child : this->children_)
{
- if (test && (elem)->isActive())
+ if (test && child->isActive())
return false;
- if ((elem)->isActive())
+ if (child->isActive())
test = true;
}
return test;
Modified: code/branches/cpp11_v2/src/modules/overlays/hud/ChatOverlay.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/overlays/hud/ChatOverlay.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/overlays/hud/ChatOverlay.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -57,8 +57,8 @@
ChatOverlay::~ChatOverlay()
{
- for (const auto & elem : this->timers_)
- delete (elem);
+ for (Timer* timer : this->timers_)
+ delete timer;
}
void ChatOverlay::setConfigValues()
@@ -91,9 +91,9 @@
{
this->text_->setCaption("");
- for (auto & elem : this->messages_)
+ for (const Ogre::DisplayString& message : this->messages_)
{
- this->text_->setCaption(this->text_->getCaption() + "\n" + (elem));
+ this->text_->setCaption(this->text_->getCaption() + "\n" + message);
}
}
}
Modified: code/branches/cpp11_v2/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/overlays/hud/HUDNavigation.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/overlays/hud/HUDNavigation.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -130,10 +130,10 @@
return;
}
this->fontName_ = font;
- for (auto & elem : this->activeObjectList_)
+ for (auto& mapEntry : this->activeObjectList_)
{
- if (elem.second.text_ != nullptr)
- elem.second.text_->setFontName(this->fontName_);
+ if (mapEntry.second.text_ != nullptr)
+ mapEntry.second.text_->setFontName(this->fontName_);
}
}
@@ -150,10 +150,10 @@
return;
}
this->textSize_ = size;
- for (auto & elem : this->activeObjectList_)
+ for (auto& mapEntry : this->activeObjectList_)
{
- if (elem.second.text_)
- elem.second.text_->setCharHeight(size);
+ if (mapEntry.second.text_)
+ mapEntry.second.text_->setCharHeight(size);
}
}
@@ -185,8 +185,8 @@
return;
const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
- for (auto & elem : this->sortedObjectList_)
- elem.second = (int)((elem.first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f);
+ for (std::pair<RadarViewable*, unsigned int>& pair : this->sortedObjectList_)
+ pair.second = (int)((pair.first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f);
this->sortedObjectList_.sort(compareDistance);
@@ -530,18 +530,18 @@
float xScale = this->getActualSize().x;
float yScale = this->getActualSize().y;
- for (auto & elem : this->activeObjectList_)
+ for (auto& mapEntry : this->activeObjectList_)
{
- if (elem.second.health_ != nullptr)
- elem.second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
- if (elem.second.healthLevel_ != nullptr)
- elem.second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);
- if (elem.second.panel_ != nullptr)
- elem.second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
- if (elem.second.text_ != nullptr)
- elem.second.text_->setCharHeight(this->textSize_ * yScale);
- if (elem.second.target_ != nullptr)
- elem.second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale);
+ if (mapEntry.second.health_ != nullptr)
+ mapEntry.second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
+ if (mapEntry.second.healthLevel_ != nullptr)
+ mapEntry.second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);
+ if (mapEntry.second.panel_ != nullptr)
+ mapEntry.second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
+ if (mapEntry.second.text_ != nullptr)
+ mapEntry.second.text_->setCharHeight(this->textSize_ * yScale);
+ if (mapEntry.second.target_ != nullptr)
+ mapEntry.second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale);
}
}
@@ -669,9 +669,9 @@
void HUDNavigation::changedOwner()
{
const std::set<RadarViewable*>& respawnObjects = this->getOwner()->getScene()->getRadar()->getRadarObjects();
- for (const auto & respawnObject : respawnObjects)
+ for (RadarViewable* respawnObject : respawnObjects)
{
- if (!(respawnObject)->isHumanShip_)
+ if (!respawnObject->isHumanShip_)
this->addObject(respawnObject);
}
}
Modified: code/branches/cpp11_v2/src/modules/overlays/hud/HUDRadar.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/overlays/hud/HUDRadar.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/overlays/hud/HUDRadar.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -91,9 +91,9 @@
Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->map3DFront_);
Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->map3DBack_);
- for (auto & elem : this->radarObjects_)
+ for (auto& mapEntry : this->radarObjects_)
{
- Ogre::OverlayManager::getSingleton().destroyOverlayElement(elem.second);
+ Ogre::OverlayManager::getSingleton().destroyOverlayElement(mapEntry.second);
}
}
}
Modified: code/branches/cpp11_v2/src/modules/overlays/stats/Scoreboard.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/overlays/stats/Scoreboard.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/overlays/stats/Scoreboard.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -59,8 +59,8 @@
{
SUPER(Scoreboard, changedVisibility);
- for (auto & elem : this->lines_)
- elem->changedVisibility();
+ for (CreateLines* line : this->lines_)
+ line->changedVisibility();
}
/**
@@ -93,11 +93,11 @@
// update board
unsigned int index = 0;
- for (const auto & elem : playerList)
+ for (const auto& mapEntry : playerList)
{
- this->lines_[index]->setPlayerName(multi_cast<std::string>(elem.first->getName()));
- this->lines_[index]->setScore(multi_cast<std::string>(elem.second.frags_));
- this->lines_[index]->setDeaths(multi_cast<std::string>(elem.second.killed_));
+ this->lines_[index]->setPlayerName(multi_cast<std::string>(mapEntry.first->getName()));
+ this->lines_[index]->setScore(multi_cast<std::string>(mapEntry.second.frags_));
+ this->lines_[index]->setDeaths(multi_cast<std::string>(mapEntry.second.killed_));
index++;
}
Modified: code/branches/cpp11_v2/src/modules/pickup/PickupCollection.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/pickup/PickupCollection.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/pickup/PickupCollection.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -67,10 +67,10 @@
PickupCollection::~PickupCollection()
{
// Destroy all Pickupables constructing this PickupCollection.
- for(auto & elem : this->pickups_)
+ for(CollectiblePickup* pickup : this->pickups_)
{
- (elem)->wasRemovedFromCollection();
- (elem)->destroy();
+ pickup->wasRemovedFromCollection();
+ pickup->destroy();
}
this->pickups_.clear();
}
@@ -98,8 +98,8 @@
this->processingUsed_ = true;
// Change used for all Pickupables this PickupCollection consists of.
- for(auto & elem : this->pickups_)
- (elem)->setUsed(this->isUsed());
+ for(CollectiblePickup* pickup : this->pickups_)
+ pickup->setUsed(this->isUsed());
this->processingUsed_ = false;
@@ -118,11 +118,11 @@
size_t numPickupsEnabled = 0;
size_t numPickupsInUse = 0;
- for(auto & elem : this->pickups_)
+ for(CollectiblePickup* pickup : this->pickups_)
{
- if ((elem)->isEnabled())
+ if (pickup->isEnabled())
++numPickupsEnabled;
- if ((elem)->isUsed())
+ if (pickup->isUsed())
++numPickupsInUse;
}
@@ -145,12 +145,12 @@
SUPER(PickupCollection, changedCarrier);
// Change the PickupCarrier for all Pickupables this PickupCollection consists of.
- for(auto & elem : this->pickups_)
+ for(CollectiblePickup* pickup : this->pickups_)
{
if(this->getCarrier() == nullptr)
- (elem)->setCarrier(nullptr);
+ pickup->setCarrier(nullptr);
else
- (elem)->setCarrier(this->getCarrier()->getTarget(elem));
+ pickup->setCarrier(this->getCarrier()->getTarget(pickup));
}
}
@@ -185,9 +185,9 @@
// If at least all the enabled pickups of this PickupCollection are no longer picked up.
bool isOnePickupEnabledAndPickedUp = false;
- for(auto & elem : this->pickups_)
+ for(CollectiblePickup* pickup : this->pickups_)
{
- if ((elem)->isEnabled() && (elem)->isPickedUp())
+ if (pickup->isEnabled() && pickup->isPickedUp())
{
isOnePickupEnabledAndPickedUp = true;
break;
@@ -207,9 +207,9 @@
*/
bool PickupCollection::isTarget(const PickupCarrier* carrier) const
{
- for(const auto & elem : this->pickups_)
+ for(CollectiblePickup* pickup : this->pickups_)
{
- if(!carrier->isTarget(elem))
+ if(!carrier->isTarget(pickup))
return false;
}
Modified: code/branches/cpp11_v2/src/modules/pickup/PickupManager.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/pickup/PickupManager.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/pickup/PickupManager.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -90,8 +90,8 @@
this->representations_.clear();
// Destroying all the PickupInventoryContainers that are still there.
- for(auto & elem : this->pickupInventoryContainers_)
- delete elem.second;
+ for(auto& mapEntry : this->pickupInventoryContainers_)
+ delete mapEntry.second;
this->pickupInventoryContainers_.clear();
// Destroying all the WeakPointers that are still there.
Modified: code/branches/cpp11_v2/src/modules/pickup/items/MetaPickup.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/pickup/items/MetaPickup.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/pickup/items/MetaPickup.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -117,9 +117,8 @@
}
std::set<Pickupable*> pickups = carrier->getPickups();
// Iterate over all Pickupables of the PickupCarrier.
- for(auto pickup : pickups)
+ for(Pickupable* pickup : pickups)
{
-
if(pickup == nullptr || pickup == this)
continue;
Modified: code/branches/cpp11_v2/src/modules/pong/Pong.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/pong/Pong.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/pong/Pong.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -144,12 +144,12 @@
this->ball_->setBatLength(this->center_->getBatLength());
// If one of the bats is missing, create it. Apply the template for the bats as specified in the centerpoint.
- for (auto & elem : this->bat_)
+ for (WeakPtr<orxonox::PongBat>& bat : this->bat_)
{
- if (elem == nullptr)
+ if (bat == nullptr)
{
- elem = new PongBat(this->center_->getContext());
- elem->addTemplate(this->center_->getBattemplate());
+ bat = new PongBat(this->center_->getContext());
+ bat->addTemplate(this->center_->getBattemplate());
}
}
@@ -210,13 +210,13 @@
void Pong::spawnPlayersIfRequested()
{
// first spawn human players to assign always the left bat to the player in singleplayer
- for (auto & elem : this->players_)
- if (elem.first->isHumanPlayer() && (elem.first->isReadyToSpawn() || this->bForceSpawn_))
- this->spawnPlayer(elem.first);
+ for (auto& mapEntry : this->players_)
+ if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
+ this->spawnPlayer(mapEntry.first);
// now spawn bots
- for (auto & elem : this->players_)
- if (!elem.first->isHumanPlayer() && (elem.first->isReadyToSpawn() || this->bForceSpawn_))
- this->spawnPlayer(elem.first);
+ for (auto& mapEntry : this->players_)
+ if (!mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
+ this->spawnPlayer(mapEntry.first);
}
/**
Modified: code/branches/cpp11_v2/src/modules/pong/PongAI.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/pong/PongAI.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/pong/PongAI.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -76,8 +76,8 @@
*/
PongAI::~PongAI()
{
- for (auto & elem : this->reactionTimers_)
- elem.first->destroy();
+ for (std::pair<Timer*, char>& pair : this->reactionTimers_)
+ pair.first->destroy();
}
/**
Modified: code/branches/cpp11_v2/src/modules/questsystem/GlobalQuest.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/questsystem/GlobalQuest.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/questsystem/GlobalQuest.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -93,8 +93,8 @@
Quest::fail(player);
// Iterate through all players possessing this Quest.
- for(const auto & elem : players_)
- QuestEffect::invokeEffects(elem, this->getFailEffectList());
+ for(PlayerInfo* questPlayer : players_)
+ QuestEffect::invokeEffects(questPlayer, this->getFailEffectList());
return true;
}
@@ -118,8 +118,8 @@
}
// Iterate through all players possessing the Quest.
- for(const auto & elem : players_)
- QuestEffect::invokeEffects(elem, this->getCompleteEffectList());
+ for(PlayerInfo* questPlayer : players_)
+ QuestEffect::invokeEffects(questPlayer, this->getCompleteEffectList());
Quest::complete(player);
@@ -241,10 +241,10 @@
const QuestEffect* GlobalQuest::getRewardEffects(unsigned int index) const
{
int i = index;
- for (const auto & elem : this->rewards_)
+ for (QuestEffect* reward : this->rewards_)
{
if(i == 0)
- return elem;
+ return reward;
i--;
}
Modified: code/branches/cpp11_v2/src/modules/questsystem/Quest.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/questsystem/Quest.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/questsystem/Quest.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -189,10 +189,10 @@
int i = index;
// Iterate through all subquests.
- for (const auto & elem : this->subQuests_)
+ for (Quest* quest : this->subQuests_)
{
if(i == 0) // We're counting down...
- return elem;
+ return quest;
i--;
}
@@ -213,10 +213,10 @@
int i = index;
// Iterate through all QuestHints.
- for (const auto & elem : this->hints_)
+ for (QuestHint* hint : this->hints_)
{
if(i == 0) // We're counting down...
- return elem;
+ return hint;
i--;
}
@@ -236,10 +236,10 @@
int i = index;
// Iterate through all fail QuestEffects.
- for (const auto & elem : this->failEffects_)
+ for (QuestEffect* effect : this->failEffects_)
{
if(i == 0) // We're counting down...
- return elem;
+ return effect;
i--;
}
@@ -259,10 +259,10 @@
int i = index;
// Iterate through all complete QuestEffects.
- for (const auto & elem : this->completeEffects_)
+ for (QuestEffect* effect : this->completeEffects_)
{
if(i == 0) // We're counting down...
- return elem;
+ return effect;
i--;
}
Modified: code/branches/cpp11_v2/src/modules/questsystem/QuestEffect.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/questsystem/QuestEffect.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/questsystem/QuestEffect.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -73,8 +73,8 @@
orxout(verbose, context::quests) << "Invoking QuestEffects on player: " << player << " ." << endl;
- for (auto & effects_effect : effects)
- temp = temp && (effects_effect)->invoke(player);
+ for (QuestEffect* effect : effects)
+ temp = temp && effect->invoke(player);
return temp;
}
Modified: code/branches/cpp11_v2/src/modules/questsystem/QuestEffectBeacon.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/questsystem/QuestEffectBeacon.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/questsystem/QuestEffectBeacon.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -235,10 +235,10 @@
const QuestEffect* QuestEffectBeacon::getEffect(unsigned int index) const
{
int i = index;
- for (const auto & elem : this->effects_)
+ for (QuestEffect* effect : this->effects_)
{
if(i == 0)
- return elem;
+ return effect;
i--;
}
Modified: code/branches/cpp11_v2/src/modules/questsystem/QuestListener.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/questsystem/QuestListener.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/questsystem/QuestListener.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -96,9 +96,8 @@
*/
/* static */ void QuestListener::advertiseStatusChange(std::list<QuestListener*> & listeners, const std::string & status)
{
- for (auto listener : listeners) // Iterate through all QuestListeners
+ for (QuestListener* listener : listeners) // Iterate through all QuestListeners
{
-
if(listener->getMode() == status || listener->getMode() == QuestListener::ALL) // Check whether the status change affects the give QuestListener.
listener->execute();
}
Modified: code/branches/cpp11_v2/src/modules/questsystem/QuestManager.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/questsystem/QuestManager.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/questsystem/QuestManager.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -234,9 +234,9 @@
int QuestManager::getNumRootQuests(PlayerInfo* player)
{
int numQuests = 0;
- for(auto & elem : this->questMap_)
+ for(auto& mapEntry : this->questMap_)
{
- if(elem.second->getParentQuest() == nullptr && !elem.second->isInactive(player))
+ if(mapEntry.second->getParentQuest() == nullptr && !mapEntry.second->isInactive(player))
numQuests++;
}
return numQuests;
@@ -254,10 +254,10 @@
*/
Quest* QuestManager::getRootQuest(PlayerInfo* player, int index)
{
- for(auto & elem : this->questMap_)
+ for(auto& mapEntry : this->questMap_)
{
- if(elem.second->getParentQuest() == nullptr && !elem.second->isInactive(player) && index-- == 0)
- return elem.second;
+ if(mapEntry.second->getParentQuest() == nullptr && !mapEntry.second->isInactive(player) && index-- == 0)
+ return mapEntry.second;
}
return nullptr;
}
@@ -279,9 +279,9 @@
std::list<Quest*> quests = quest->getSubQuestList();
int numQuests = 0;
- for(auto & quest : quests)
+ for(Quest* subquest : quests)
{
- if(!(quest)->isInactive(player))
+ if(!subquest->isInactive(player))
numQuests++;
}
return numQuests;
@@ -303,9 +303,9 @@
return this->getRootQuest(player, index);
std::list<Quest*> quests = quest->getSubQuestList();
- for(auto & quest : quests)
+ for(Quest* subquest : quests)
{
- if(!(quest)->isInactive(player) && index-- == 0)
+ if(!subquest->isInactive(player) && index-- == 0)
return quest;
}
return nullptr;
@@ -325,9 +325,9 @@
{
std::list<QuestHint*> hints = quest->getHintsList();
int numHints = 0;
- for(auto & hint : hints)
+ for(QuestHint* hint : hints)
{
- if((hint)->isActive(player))
+ if(hint->isActive(player))
numHints++;
}
return numHints;
@@ -348,9 +348,9 @@
QuestHint* QuestManager::getHints(Quest* quest, PlayerInfo* player, int index)
{
std::list<QuestHint*> hints = quest->getHintsList();
- for(auto & hint : hints)
+ for(QuestHint* hint : hints)
{
- if((hint)->isActive(player) && index-- == 0)
+ if(hint->isActive(player) && index-- == 0)
return hint;
}
return nullptr;
Modified: code/branches/cpp11_v2/src/modules/questsystem/effects/AddReward.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/questsystem/effects/AddReward.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/questsystem/effects/AddReward.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -83,10 +83,10 @@
const Rewardable* AddReward::getRewardables(unsigned int index) const
{
int i = index;
- for (const auto & elem : this->rewards_)
+ for (Rewardable* reward : this->rewards_)
{
if(i == 0)
- return elem;
+ return reward;
i--;
}
return nullptr;
@@ -105,8 +105,8 @@
orxout(verbose_more, context::quests) << "AddReward on player: " << player << " ." << endl;
bool temp = true;
- for (auto & elem : this->rewards_)
- temp = temp && (elem)->reward(player);
+ for (Rewardable* reward : this->rewards_)
+ temp = temp && reward->reward(player);
orxout(verbose, context::quests) << "Rewardable successfully added to player." << player << " ." << endl;
Modified: code/branches/cpp11_v2/src/modules/tetris/Tetris.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/tetris/Tetris.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/tetris/Tetris.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -103,8 +103,8 @@
this->futureBrick_ = nullptr;
}
- for (auto & elem : this->stones_)
- (elem)->destroy();
+ for (TetrisStone* stone : this->stones_)
+ stone->destroy();
this->stones_.clear();
}
@@ -340,9 +340,9 @@
void Tetris::spawnPlayersIfRequested()
{
// Spawn a human player.
- for (auto & elem : this->players_)
- if (elem.first->isHumanPlayer() && (elem.first->isReadyToSpawn() || this->bForceSpawn_))
- this->spawnPlayer(elem.first);
+ for (auto& mapEntry : this->players_)
+ if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
+ this->spawnPlayer(mapEntry.first);
}
bool Tetris::playerLeft(PlayerInfo* player)
@@ -501,10 +501,10 @@
++it;
}
// adjust height of stones above the deleted row //TODO: check if this could be a source of a bug.
- for(auto & elem : this->stones_)
+ for(TetrisStone* stone : this->stones_)
{
- if(static_cast<unsigned int>(((elem)->getPosition().y - 5)/this->center_->getStoneSize()) > row)
- (elem)->setPosition((elem)->getPosition()-Vector3(0,10,0));
+ if(static_cast<unsigned int>((stone->getPosition().y - 5)/this->center_->getStoneSize()) > row)
+ stone->setPosition(stone->getPosition()-Vector3(0,10,0));
}
}
Modified: code/branches/cpp11_v2/src/modules/tetris/TetrisBrick.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/tetris/TetrisBrick.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/tetris/TetrisBrick.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -238,11 +238,11 @@
void TetrisBrick::releaseStones(TetrisCenterpoint* center)
{
assert(this->tetris_);
- for(auto & elem : this->brickStones_)
+ for(TetrisStone* stone : this->brickStones_)
{
- elem->detachFromParent();
- elem->attachToParent(center);
- elem->setPosition(this->getPosition()+this->tetris_->rotateVector(elem->getPosition(),this->rotationCount_ ));
+ stone->detachFromParent();
+ stone->attachToParent(center);
+ stone->setPosition(this->getPosition()+this->tetris_->rotateVector(stone->getPosition(),this->rotationCount_ ));
}
this->brickStones_.clear();
}
Modified: code/branches/cpp11_v2/src/modules/towerdefense/TowerDefense.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/towerdefense/TowerDefense.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/modules/towerdefense/TowerDefense.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -182,10 +182,10 @@
en1->setDirection(Vector3(0,1,0));
en1->lookAt(waypoints_.at(1)->getPosition() + offset_);
- for (auto & elem : waypoints_)
+ for (TowerDefenseField* field : waypoints_)
{
orxonox::WeakPtr<MovableEntity> waypoint = new MovableEntity(this->center_->getContext());
- waypoint->setPosition(elem->getPosition() + offset_);
+ waypoint->setPosition(field->getPosition() + offset_);
controller->addWaypoint(waypoint);
}
}
Modified: code/branches/cpp11_v2/src/orxonox/Level.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/Level.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/Level.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -105,10 +105,10 @@
void Level::networkCallbackTemplatesChanged()
{
- for(const auto & elem : this->networkTemplateNames_)
+ for(const std::string& name : this->networkTemplateNames_)
{
- assert(Template::getTemplate(elem));
- Template::getTemplate(elem)->applyOn(this);
+ assert(Template::getTemplate(name));
+ Template::getTemplate(name)->applyOn(this);
}
}
@@ -134,8 +134,8 @@
// means that e.g. ~Identifiable was not yet called for this object). This means that technically there are still other
// objects alive when ~Level is called. This is the reason why we cannot directly destroy() the Plugins - instead we need
// to call destroyLater() to ensure that no instances from this plugin exist anymore.
- for (auto & elem : this->plugins_)
- (elem)->destroyLater();
+ for (PluginReference* plugin : this->plugins_)
+ plugin->destroyLater();
this->plugins_.clear();
}
@@ -172,10 +172,10 @@
BaseObject* Level::getObject(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->objects_)
+ for (BaseObject* object : this->objects_)
{
if (i == index)
- return (elem);
+ return object;
++i;
}
return nullptr;
Modified: code/branches/cpp11_v2/src/orxonox/LevelInfo.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/LevelInfo.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/LevelInfo.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -105,9 +105,9 @@
void LevelInfoItem::setTags(const std::string& tags)
{
SubString substr = SubString(tags, ",", " "); // Split the string into tags.
- const std::vector<std::string>& strings = substr.getAllStrings();
- for (const auto & strings_it : strings)
- this->addTag(strings_it, false);
+ const std::vector<std::string>& tokens = substr.getAllStrings();
+ for (const std::string& token : tokens)
+ this->addTag(token, false);
this->tagsUpdated();
}
@@ -120,9 +120,9 @@
void LevelInfoItem::setStartingShips(const std::string& ships)
{
SubString substr = SubString(ships, ",", " "); // Split the string into tags.
- const std::vector<std::string>& strings = substr.getAllStrings();
- for(const auto & strings_it : strings)
- this->addStartingShip(strings_it, false);
+ const std::vector<std::string>& tokens = substr.getAllStrings();
+ for(const std::string& token : tokens)
+ this->addStartingShip(token, false);
this->startingshipsUpdated();
}
Modified: code/branches/cpp11_v2/src/orxonox/LevelManager.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/LevelManager.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/LevelManager.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -174,8 +174,8 @@
// Activate the level that is the first in the list of levels whose activity has been requested.
this->levels_.front()->setActive(true);
// Make every player enter the newly activated level.
- for (const auto & elem : PlayerManager::getInstance().getClients())
- this->levels_.front()->playerEntered(elem.second);
+ for (const auto& mapEntry : PlayerManager::getInstance().getClients())
+ this->levels_.front()->playerEntered(mapEntry.second);
}
}
Modified: code/branches/cpp11_v2/src/orxonox/Scene.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/Scene.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/Scene.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -219,10 +219,10 @@
else if (!wantPhysics && hasPhysics())
{
// Remove all WorldEntities and shove them to the queue since they would still like to be in a physical world.
- for (const auto & elem : this->physicalObjects_)
+ for (WorldEntity* object : this->physicalObjects_)
{
- this->physicalWorld_->removeRigidBody((elem)->physicalBody_);
- this->physicalObjectQueue_.insert(elem);
+ this->physicalWorld_->removeRigidBody(object->physicalBody_);
+ this->physicalObjectQueue_.insert(object);
}
this->physicalObjects_.clear();
@@ -254,10 +254,10 @@
if (this->physicalObjectQueue_.size() > 0)
{
// Add all scheduled WorldEntities
- for (const auto & elem : this->physicalObjectQueue_)
+ for (WorldEntity* object : this->physicalObjectQueue_)
{
- this->physicalWorld_->addRigidBody((elem)->physicalBody_);
- this->physicalObjects_.insert(elem);
+ this->physicalWorld_->addRigidBody(object->physicalBody_);
+ this->physicalObjects_.insert(object);
}
this->physicalObjectQueue_.clear();
}
@@ -318,10 +318,10 @@
BaseObject* Scene::getObject(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->objects_)
+ for (BaseObject* object : this->objects_)
{
if (i == index)
- return (elem);
+ return object;
++i;
}
return nullptr;
Modified: code/branches/cpp11_v2/src/orxonox/collisionshapes/CompoundCollisionShape.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/collisionshapes/CompoundCollisionShape.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/collisionshapes/CompoundCollisionShape.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -64,12 +64,12 @@
if (this->isInitialized())
{
// Delete all children
- for (auto & elem : this->attachedShapes_)
+ for (auto& mapEntry : this->attachedShapes_)
{
// make sure that the child doesn't want to detach itself --> speedup because of the missing update
- elem.first->notifyDetached();
- elem.first->destroy();
- if (this->collisionShape_ == elem.second)
+ mapEntry.first->notifyDetached();
+ mapEntry.first->destroy();
+ if (this->collisionShape_ == mapEntry.second)
this->collisionShape_ = nullptr; // don't destroy it twice
}
@@ -245,10 +245,10 @@
CollisionShape* CompoundCollisionShape::getAttachedShape(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->attachedShapes_)
+ for (const auto& mapEntry : this->attachedShapes_)
{
if (i == index)
- return elem.first;
+ return mapEntry.first;
++i;
}
return nullptr;
@@ -265,17 +265,16 @@
std::vector<CollisionShape*> shapes;
// Iterate through all attached CollisionShapes and add them to the list of shapes.
- for(auto & elem : this->attachedShapes_)
- shapes.push_back(elem.first);
+ for(auto& mapEntry : this->attachedShapes_)
+ shapes.push_back(mapEntry.first);
// Delete the compound shape and create a new one.
delete this->compoundShape_;
this->compoundShape_ = new btCompoundShape();
// Re-attach all CollisionShapes.
- for(auto shape : shapes)
+ for(CollisionShape* shape : shapes)
{
-
shape->setScale3D(this->getScale3D());
// Only actually attach if we didn't pick a CompoundCollisionShape with no content.
if (shape->getCollisionShape())
Modified: code/branches/cpp11_v2/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/controllers/ArtificialController.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/controllers/ArtificialController.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -230,10 +230,10 @@
int ArtificialController::getFiremode(std::string name)
{
- for (auto firemode : this->weaponModes_)
+ for (auto& mapEntry : this->weaponModes_)
{
- if (firemode.first == name)
- return firemode.second;
+ if (mapEntry.first == name)
+ return mapEntry.second;
}
return -1;
}
Modified: code/branches/cpp11_v2/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/controllers/FormationController.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/controllers/FormationController.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -439,10 +439,10 @@
{
if(newMaster->slaves_.size() > this->maxFormationSize_) continue;
- for(auto & elem : this->slaves_)
+ for(FormationController* slave : this->slaves_)
{
- (elem)->myMaster_ = newMaster;
- newMaster->slaves_.push_back(elem);
+ slave->myMaster_ = newMaster;
+ newMaster->slaves_.push_back(slave);
}
this->slaves_.clear();
this->state_ = SLAVE;
@@ -485,7 +485,7 @@
bool left=true;
int i = 1;
- for(auto & elem : slaves_)
+ for(FormationController* slave : slaves_)
{
pos = Vector3::ZERO;
if (left)
@@ -496,8 +496,8 @@
i++;
dest+=FORMATION_LENGTH*(orient*WorldEntity::BACK);
}
- (elem)->setTargetOrientation(orient);
- (elem)->setTargetPosition(pos);
+ slave->setTargetOrientation(orient);
+ slave->setTargetPosition(pos);
left=!left;
}
}
@@ -568,10 +568,10 @@
{
if(this->state_ != MASTER) return;
- for(auto & elem : slaves_)
+ for(FormationController* slave : slaves_)
{
- (elem)->state_ = FREE;
- (elem)->myMaster_ = nullptr;
+ slave->state_ = FREE;
+ slave->myMaster_ = nullptr;
}
this->slaves_.clear();
}
@@ -583,12 +583,12 @@
{
if(this->state_ != MASTER) return;
- for(auto & elem : slaves_)
+ for(FormationController* slave : slaves_)
{
- (elem)->state_ = FREE;
- (elem)->forceFreedom();
- (elem)->targetPosition_ = this->targetPosition_;
- (elem)->bShooting_ = true;
+ slave->state_ = FREE;
+ slave->forceFreedom();
+ slave->targetPosition_ = this->targetPosition_;
+ slave->bShooting_ = true;
// (*it)->getControllableEntity()->fire(0);// fire once for fun
}
}
@@ -649,9 +649,9 @@
//add previous master
this->slaves_.push_back(this->myMaster_);
//set this as new master
- for(auto & elem : slaves_)
+ for(FormationController* slave : slaves_)
{
- (elem)->myMaster_=this;
+ slave->myMaster_=this;
}
this->myMaster_=nullptr;
this->state_=MASTER;
@@ -693,11 +693,11 @@
this->formationMode_ = val;
if (this->state_ == MASTER)
{
- for(auto & elem : slaves_)
+ for(FormationController* slave : slaves_)
{
- (elem)->formationMode_ = val;
+ slave->formationMode_ = val;
if (val == ATTACK)
- (elem)->forgetTarget();
+ slave->forgetTarget();
}
}
}
Modified: code/branches/cpp11_v2/src/orxonox/controllers/WaypointController.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/controllers/WaypointController.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/controllers/WaypointController.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -43,10 +43,10 @@
WaypointController::~WaypointController()
{
- for (auto & elem : this->waypoints_)
+ for (WorldEntity* waypoint : this->waypoints_)
{
- if(elem)
- elem->destroy();
+ if(waypoint)
+ waypoint->destroy();
}
}
Modified: code/branches/cpp11_v2/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/gamestates/GSLevel.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/gamestates/GSLevel.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -250,7 +250,7 @@
it->importMementoState(states);
// delete states
- for (auto & state : states)
+ for (GSLevelMementoState* state : states)
delete state;
}
Modified: code/branches/cpp11_v2/src/orxonox/gametypes/Dynamicmatch.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/gametypes/Dynamicmatch.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/gametypes/Dynamicmatch.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -404,11 +404,11 @@
*/
void Dynamicmatch::rewardPig()
{
- for (auto & elem : this->playerParty_) //durch alle Spieler iterieren und alle piggys finden
+ for (auto& mapEntry : this->playerParty_) //durch alle Spieler iterieren und alle piggys finden
{
- if (elem.second==piggy)//Spieler mit der Pig-party frags++
+ if (mapEntry.second==piggy)//Spieler mit der Pig-party frags++
{
- this->playerScored(elem.first);
+ this->playerScored(mapEntry.first);
}
}
}
@@ -421,9 +421,9 @@
pawn->setRadarObjectColour(this->partyColours_[it_player->second]);
std::set<WorldEntity*> pawnAttachments = pawn->getAttachedObjects();
- for (const auto & pawnAttachment : pawnAttachments)
+ for (WorldEntity* pawnAttachment : pawnAttachments)
{
- if ((pawnAttachment)->isA(Class(TeamColourable)))
+ if (pawnAttachment->isA(Class(TeamColourable)))
{
TeamColourable* tc = orxonox_cast<TeamColourable*>(pawnAttachment);
tc->setTeamColour(this->partyColours_[it_player->second]);
@@ -440,13 +440,13 @@
notEnoughPigs=true;
if (tutorial) // Announce selectionphase
{
- for (auto & elem : this->playerParty_)
+ for (auto& mapEntry : this->playerParty_)
{
- if (!elem.first)//in order to catch nullpointer
+ if (!mapEntry.first)//in order to catch nullpointer
continue;
- if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
+ if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
continue;
- this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",elem.first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
+ this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",mapEntry.first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
}
}
}
@@ -455,28 +455,28 @@
notEnoughPigs=false;
if(tutorial&&(!notEnoughKillers)&&(!notEnoughChasers)) //Selection phase over
{
- for (auto & elem : this->playerParty_)
+ for (auto& mapEntry : this->playerParty_)
{
- if (!elem.first)//in order to catch nullpointer
+ if (!mapEntry.first)//in order to catch nullpointer
continue;
- if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
+ if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
continue;
- else if (elem.second==chaser)
+ else if (mapEntry.second==chaser)
{
if (numberOf[killer]>0)
- this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible. Defend yourself against the killers.",elem.first->getClientID(),partyColours_[piggy]);
+ this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible. Defend yourself against the killers.",mapEntry.first->getClientID(),partyColours_[piggy]);
else
- this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible.",elem.first->getClientID(),partyColours_[piggy]);
+ this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible.",mapEntry.first->getClientID(),partyColours_[piggy]);
//this->gtinfo_->sendFadingMessage("You're now a chaser.",it->first->getClientID());
}
- else if (elem.second==piggy)
+ else if (mapEntry.second==piggy)
{
- this->gtinfo_->sendStaticMessage("Either hide or shoot a chaser.",elem.first->getClientID(),partyColours_[chaser]);
+ this->gtinfo_->sendStaticMessage("Either hide or shoot a chaser.",mapEntry.first->getClientID(),partyColours_[chaser]);
//this->gtinfo_->sendFadingMessage("You're now a victim.",it->first->getClientID());
}
- else if (elem.second==killer)
+ else if (mapEntry.second==killer)
{
- this->gtinfo_->sendStaticMessage("Take the chasers down.",elem.first->getClientID(),partyColours_[chaser]);
+ this->gtinfo_->sendStaticMessage("Take the chasers down.",mapEntry.first->getClientID(),partyColours_[chaser]);
//this->gtinfo_->sendFadingMessage("You're now a killer.",it->first->getClientID());
}
}
@@ -489,13 +489,13 @@
notEnoughKillers=true;
if (tutorial) // Announce selectionphase
{
- for (auto & elem : this->playerParty_)
+ for (auto& mapEntry : this->playerParty_)
{
- if (!elem.first)//in order to catch nullpointer
+ if (!mapEntry.first)//in order to catch nullpointer
continue;
- if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
+ if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
continue;
- this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",elem.first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
+ this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",mapEntry.first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
}
}
}
@@ -504,28 +504,28 @@
notEnoughKillers=false;
if(tutorial&&(!notEnoughPigs)&&(!notEnoughChasers)) //Selection phase over
{
- for (auto & elem : this->playerParty_)
+ for (auto& mapEntry : this->playerParty_)
{
- if (!elem.first)
+ if (!mapEntry.first)
continue;
- if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
+ if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
continue;
- else if (elem.second==chaser)
+ else if (mapEntry.second==chaser)
{
if (numberOf[killer]>0)
- this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible. Defend yourself against the killers.",elem.first->getClientID(),partyColours_[piggy]);
+ this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible. Defend yourself against the killers.",mapEntry.first->getClientID(),partyColours_[piggy]);
else
- this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible.",elem.first->getClientID(),partyColours_[piggy]);
+ this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible.",mapEntry.first->getClientID(),partyColours_[piggy]);
//this->gtinfo_->sendFadingMessage("You're now a chaser.",it->first->getClientID());
}
- else if (elem.second==piggy)
+ else if (mapEntry.second==piggy)
{
- this->gtinfo_->sendStaticMessage("Either hide or shoot a chaser.",elem.first->getClientID(),partyColours_[piggy]);
+ this->gtinfo_->sendStaticMessage("Either hide or shoot a chaser.",mapEntry.first->getClientID(),partyColours_[piggy]);
//this->gtinfo_->sendFadingMessage("You're now a victim.",it->first->getClientID());
}
- else if (elem.second==killer)
+ else if (mapEntry.second==killer)
{
- this->gtinfo_->sendStaticMessage("Take the chasers down.",elem.first->getClientID(),partyColours_[piggy]);
+ this->gtinfo_->sendStaticMessage("Take the chasers down.",mapEntry.first->getClientID(),partyColours_[piggy]);
//this->gtinfo_->sendFadingMessage("You're now a killer.",it->first->getClientID());
}
}
@@ -539,13 +539,13 @@
notEnoughChasers=true;
if (tutorial) // Announce selectionphase
{
- for (auto & elem : this->playerParty_)
+ for (auto& mapEntry : this->playerParty_)
{
- if (!elem.first)//in order to catch nullpointer
+ if (!mapEntry.first)//in order to catch nullpointer
continue;
- if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
+ if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
continue;
- this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",elem.first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
+ this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",mapEntry.first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
}
}
}
@@ -554,28 +554,28 @@
notEnoughChasers=false;
if(tutorial&&(!notEnoughPigs)&&(!notEnoughKillers)) //Selection phase over
{
- for (auto & elem : this->playerParty_)
+ for (auto& mapEntry : this->playerParty_)
{
- if (!elem.first)
+ if (!mapEntry.first)
continue;
- if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
+ if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
continue;
- else if (elem.second==chaser)
+ else if (mapEntry.second==chaser)
{
if (numberOf[killer]>0)
- this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible. Defend yourself against the killers.",elem.first->getClientID(),partyColours_[piggy]);
+ this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible. Defend yourself against the killers.",mapEntry.first->getClientID(),partyColours_[piggy]);
else
- this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible.",elem.first->getClientID(),partyColours_[piggy]);
+ this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible.",mapEntry.first->getClientID(),partyColours_[piggy]);
//this->gtinfo_->sendFadingMessage("You're now a chaser.",it->first->getClientID());
}
- else if (elem.second==piggy)
+ else if (mapEntry.second==piggy)
{
- this->gtinfo_->sendStaticMessage("Either hide or shoot a chaser.",elem.first->getClientID(),partyColours_[chaser]);
+ this->gtinfo_->sendStaticMessage("Either hide or shoot a chaser.",mapEntry.first->getClientID(),partyColours_[chaser]);
//this->gtinfo_->sendFadingMessage("You're now a victim.",it->first->getClientID());
}
- else if (elem.second==killer)
+ else if (mapEntry.second==killer)
{
- this->gtinfo_->sendStaticMessage("Take the chasers down.",elem.first->getClientID(),partyColours_[chaser]);
+ this->gtinfo_->sendStaticMessage("Take the chasers down.",mapEntry.first->getClientID(),partyColours_[chaser]);
//this->gtinfo_->sendFadingMessage("You're now a killer.",it->first->getClientID());
}
}
@@ -619,11 +619,11 @@
}
else if(tutorial) // Announce selectionphase
{
- for (auto & elem : this->playerParty_)
+ for (auto& mapEntry : this->playerParty_)
{
- if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
+ if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
continue;
- this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",elem.first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
+ this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",mapEntry.first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
}
}
}
@@ -675,10 +675,10 @@
{
unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size())));
unsigned int index = 0;
- for (const auto & teamSpawnPoint : teamSpawnPoints)
+ for (SpawnPoint* teamSpawnPoint : teamSpawnPoints)
{
if (index == randomspawn)
- return (teamSpawnPoint);
+ return teamSpawnPoint;
++index;
}
Modified: code/branches/cpp11_v2/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/gametypes/Gametype.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/gametypes/Gametype.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -138,11 +138,11 @@
if (!this->gtinfo_->hasStarted())
{
- for (auto & elem : this->players_)
+ for (auto& mapEntry : this->players_)
{
// Inform the GametypeInfo that the player is ready to spawn.
- if(elem.first->isHumanPlayer() && elem.first->isReadyToSpawn())
- this->gtinfo_->playerReadyToSpawn(elem.first);
+ if(mapEntry.first->isHumanPlayer() && mapEntry.first->isReadyToSpawn())
+ this->gtinfo_->playerReadyToSpawn(mapEntry.first);
}
this->checkStart();
@@ -168,11 +168,11 @@
this->showMenuTimer_.setTimer(3.0f, true, createExecutor(createFunctor(&Gametype::showMenu, this)));
}
- for (auto & elem : this->players_)
+ for (auto& mapEntry : this->players_)
{
- if (elem.first->getControllableEntity())
+ if (mapEntry.first->getControllableEntity())
{
- ControllableEntity* oldentity = elem.first->getControllableEntity();
+ ControllableEntity* oldentity = mapEntry.first->getControllableEntity();
ControllableEntity* entity = this->defaultControllableEntity_.fabricate(oldentity->getContext());
if (oldentity->getCamera())
@@ -185,10 +185,10 @@
entity->setPosition(oldentity->getWorldPosition());
entity->setOrientation(oldentity->getWorldOrientation());
}
- elem.first->startControl(entity);
+ mapEntry.first->startControl(entity);
}
else
- this->spawnPlayerAsDefaultPawn(elem.first);
+ this->spawnPlayerAsDefaultPawn(mapEntry.first);
}
}
@@ -340,13 +340,13 @@
unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(this->spawnpoints_.size())));
unsigned int index = 0;
std::vector<SpawnPoint*> activeSpawnPoints;
- for (const auto & elem : this->spawnpoints_)
+ for (SpawnPoint* spawnpoint : this->spawnpoints_)
{
if (index == randomspawn)
- fallbackSpawnPoint = (elem);
+ fallbackSpawnPoint = spawnpoint;
- if (elem != nullptr && (elem)->isActive())
- activeSpawnPoints.push_back(elem);
+ if (spawnpoint != nullptr && spawnpoint->isActive())
+ activeSpawnPoints.push_back(spawnpoint);
++index;
}
@@ -365,16 +365,16 @@
void Gametype::assignDefaultPawnsIfNeeded()
{
- for (auto & elem : this->players_)
+ for (auto& mapEntry : this->players_)
{
- if (!elem.first->getControllableEntity())
+ if (!mapEntry.first->getControllableEntity())
{
- elem.second.state_ = PlayerState::Dead;
+ mapEntry.second.state_ = PlayerState::Dead;
- if (!elem.first->isReadyToSpawn() || !this->gtinfo_->hasStarted())
+ if (!mapEntry.first->isReadyToSpawn() || !this->gtinfo_->hasStarted())
{
- this->spawnPlayerAsDefaultPawn(elem.first);
- elem.second.state_ = PlayerState::Dead;
+ this->spawnPlayerAsDefaultPawn(mapEntry.first);
+ mapEntry.second.state_ = PlayerState::Dead;
}
}
}
@@ -403,11 +403,11 @@
{
bool allplayersready = true;
bool hashumanplayers = false;
- for (auto & elem : this->players_)
+ for (auto& mapEntry : this->players_)
{
- if (!elem.first->isReadyToSpawn())
+ if (!mapEntry.first->isReadyToSpawn())
allplayersready = false;
- if (elem.first->isHumanPlayer())
+ if (mapEntry.first->isHumanPlayer())
hashumanplayers = true;
}
@@ -429,19 +429,19 @@
void Gametype::spawnPlayersIfRequested()
{
- for (auto & elem : this->players_)
+ for (auto& mapEntry : this->players_)
{
- if (elem.first->isReadyToSpawn() || this->bForceSpawn_)
- this->spawnPlayer(elem.first);
+ if (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_)
+ this->spawnPlayer(mapEntry.first);
}
}
void Gametype::spawnDeadPlayersIfRequested()
{
- for (auto & elem : this->players_)
- if (elem.second.state_ == PlayerState::Dead)
- if (elem.first->isReadyToSpawn() || this->bForceSpawn_)
- this->spawnPlayer(elem.first);
+ for (auto& mapEntry : this->players_)
+ if (mapEntry.second.state_ == PlayerState::Dead)
+ if (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_)
+ this->spawnPlayer(mapEntry.first);
}
void Gametype::spawnPlayer(PlayerInfo* player)
@@ -537,11 +537,11 @@
GSLevelMementoState* Gametype::exportMementoState()
{
- for (auto & elem : this->players_)
+ for (auto& mapEntry : this->players_)
{
- if (elem.first->isHumanPlayer() && elem.first->getControllableEntity() && elem.first->getControllableEntity()->getCamera())
+ if (mapEntry.first->isHumanPlayer() && mapEntry.first->getControllableEntity() && mapEntry.first->getControllableEntity()->getCamera())
{
- Camera* camera = elem.first->getControllableEntity()->getCamera();
+ Camera* camera = mapEntry.first->getControllableEntity()->getCamera();
GametypeMementoState* state = new GametypeMementoState();
state->cameraPosition_ = camera->getWorldPosition();
@@ -558,9 +558,9 @@
{
// find correct memento state
GametypeMementoState* state = nullptr;
- for (auto & states_i : states)
+ for (GSLevelMementoState* temp : states)
{
- state = dynamic_cast<GametypeMementoState*>(states_i);
+ state = dynamic_cast<GametypeMementoState*>(temp);
if (state)
break;
}
@@ -586,14 +586,14 @@
}
// find correct player and assign default entity with original position & orientation
- for (auto & elem : this->players_)
+ for (auto& mapEntry : this->players_)
{
- if (elem.first->isHumanPlayer())
+ if (mapEntry.first->isHumanPlayer())
{
ControllableEntity* entity = this->defaultControllableEntity_.fabricate(scene->getContext());
entity->setPosition(state->cameraPosition_);
entity->setOrientation(state->cameraOrientation_);
- elem.first->startControl(entity);
+ mapEntry.first->startControl(entity);
break;
}
}
Modified: code/branches/cpp11_v2/src/orxonox/gametypes/LastManStanding.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/gametypes/LastManStanding.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/gametypes/LastManStanding.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -55,13 +55,13 @@
void LastManStanding::spawnDeadPlayersIfRequested()
{
- for (auto & elem : this->players_)
- if (elem.second.state_ == PlayerState::Dead)
+ for (auto& mapEntry : this->players_)
+ if (mapEntry.second.state_ == PlayerState::Dead)
{
- bool alive = (0<playerLives_[elem.first]&&(inGame_[elem.first]));
- if (alive&&(elem.first->isReadyToSpawn() || this->bForceSpawn_))
+ bool alive = (0<playerLives_[mapEntry.first]&&(inGame_[mapEntry.first]));
+ if (alive&&(mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
{
- this->spawnPlayer(elem.first);
+ this->spawnPlayer(mapEntry.first);
}
}
}
@@ -113,12 +113,12 @@
int LastManStanding::getMinLives()
{
int min=lives;
- for (auto & elem : this->playerLives_)
+ for (auto& mapEntry : this->playerLives_)
{
- if (elem.second<=0)
+ if (mapEntry.second<=0)
continue;
- if (elem.second<lives)
- min=elem.second;
+ if (mapEntry.second<lives)
+ min=mapEntry.second;
}
return min;
}
@@ -127,15 +127,15 @@
{
Gametype::end();
- for (auto & elem : this->playerLives_)
+ for (auto& mapEntry : this->playerLives_)
{
- if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
+ if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
continue;
- if (elem.second > 0)
- this->gtinfo_->sendAnnounceMessage("You have won the match!", elem.first->getClientID());
+ if (mapEntry.second > 0)
+ this->gtinfo_->sendAnnounceMessage("You have won the match!", mapEntry.first->getClientID());
else
- this->gtinfo_->sendAnnounceMessage("You have lost the match!", elem.first->getClientID());
+ this->gtinfo_->sendAnnounceMessage("You have lost the match!", mapEntry.first->getClientID());
}
}
@@ -236,41 +236,41 @@
{
this->end();
}
- for (auto & elem : this->timeToAct_)
+ for (auto& mapEntry : this->timeToAct_)
{
- if (playerGetLives(elem.first)<=0)//Players without lives shouldn't be affected by time.
+ if (playerGetLives(mapEntry.first)<=0)//Players without lives shouldn't be affected by time.
continue;
- elem.second-=dt;//Decreases punishment time.
- if (!inGame_[elem.first])//Manages respawn delay - player is forced to respawn after the delaytime is used up.
+ mapEntry.second-=dt;//Decreases punishment time.
+ if (!inGame_[mapEntry.first])//Manages respawn delay - player is forced to respawn after the delaytime is used up.
{
- playerDelayTime_[elem.first]-=dt;
- if (playerDelayTime_[elem.first]<=0)
- this->inGame_[elem.first]=true;
+ playerDelayTime_[mapEntry.first]-=dt;
+ if (playerDelayTime_[mapEntry.first]<=0)
+ this->inGame_[mapEntry.first]=true;
- if (elem.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
+ if (mapEntry.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
continue;
- int output=1+(int)playerDelayTime_[elem.first];
+ int output=1+(int)playerDelayTime_[mapEntry.first];
const std::string& message = "Respawn in " +multi_cast<std::string>(output)+ " seconds." ;//Countdown
- this->gtinfo_->sendFadingMessage(message,elem.first->getClientID());
+ this->gtinfo_->sendFadingMessage(message,mapEntry.first->getClientID());
}
- else if (elem.second<0.0f)
+ else if (mapEntry.second<0.0f)
{
- elem.second=timeRemaining+3.0f;//reset punishment-timer
- if (playerGetLives(elem.first)>0)
+ mapEntry.second=timeRemaining+3.0f;//reset punishment-timer
+ if (playerGetLives(mapEntry.first)>0)
{
- this->punishPlayer(elem.first);
- if (elem.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
+ this->punishPlayer(mapEntry.first);
+ if (mapEntry.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
return;
const std::string& message = ""; // resets Camper-Warning-message
- this->gtinfo_->sendFadingMessage(message,elem.first->getClientID());
+ this->gtinfo_->sendFadingMessage(message,mapEntry.first->getClientID());
}
}
- else if (elem.second<timeRemaining/5)//Warning message
+ else if (mapEntry.second<timeRemaining/5)//Warning message
{
- if (elem.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
+ if (mapEntry.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
continue;
const std::string& message = "Camper Warning! Don't forget to shoot.";
- this->gtinfo_->sendFadingMessage(message,elem.first->getClientID());
+ this->gtinfo_->sendFadingMessage(message,mapEntry.first->getClientID());
}
}
}
Modified: code/branches/cpp11_v2/src/orxonox/gametypes/LastTeamStanding.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/gametypes/LastTeamStanding.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/gametypes/LastTeamStanding.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -144,13 +144,13 @@
void LastTeamStanding::spawnDeadPlayersIfRequested()
{
- for (auto & elem : this->players_)
- if (elem.second.state_ == PlayerState::Dead)
+ for (auto& mapEntry : this->players_)
+ if (mapEntry.second.state_ == PlayerState::Dead)
{
- bool alive = (0 < playerLives_[elem.first]&&(inGame_[elem.first]));
- if (alive&&(elem.first->isReadyToSpawn() || this->bForceSpawn_))
+ bool alive = (0 < playerLives_[mapEntry.first]&&(inGame_[mapEntry.first]));
+ if (alive&&(mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
{
- this->spawnPlayer(elem.first);
+ this->spawnPlayer(mapEntry.first);
}
}
}
@@ -183,41 +183,41 @@
{
this->end();
}
- for (auto & elem : this->timeToAct_)
+ for (auto& mapEntry : this->timeToAct_)
{
- if (playerGetLives(elem.first) <= 0)//Players without lives shouldn't be affected by time.
+ if (playerGetLives(mapEntry.first) <= 0)//Players without lives shouldn't be affected by time.
continue;
- elem.second -= dt;//Decreases punishment time.
- if (!inGame_[elem.first])//Manages respawn delay - player is forced to respawn after the delaytime is used up.
+ mapEntry.second -= dt;//Decreases punishment time.
+ if (!inGame_[mapEntry.first])//Manages respawn delay - player is forced to respawn after the delaytime is used up.
{
- playerDelayTime_[elem.first] -= dt;
- if (playerDelayTime_[elem.first] <= 0)
- this->inGame_[elem.first] = true;
+ playerDelayTime_[mapEntry.first] -= dt;
+ if (playerDelayTime_[mapEntry.first] <= 0)
+ this->inGame_[mapEntry.first] = true;
- if (elem.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
+ if (mapEntry.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
continue;
- int output = 1 + (int)playerDelayTime_[elem.first];
+ int output = 1 + (int)playerDelayTime_[mapEntry.first];
const std::string& message = "Respawn in " +multi_cast<std::string>(output)+ " seconds." ;//Countdown
- this->gtinfo_->sendFadingMessage(message,elem.first->getClientID());
+ this->gtinfo_->sendFadingMessage(message,mapEntry.first->getClientID());
}
- else if (elem.second < 0.0f)
+ else if (mapEntry.second < 0.0f)
{
- elem.second = timeRemaining + 3.0f;//reset punishment-timer
- if (playerGetLives(elem.first) > 0)
+ mapEntry.second = timeRemaining + 3.0f;//reset punishment-timer
+ if (playerGetLives(mapEntry.first) > 0)
{
- this->punishPlayer(elem.first);
- if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
+ this->punishPlayer(mapEntry.first);
+ if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
return;
const std::string& message = ""; // resets Camper-Warning-message
- this->gtinfo_->sendFadingMessage(message, elem.first->getClientID());
+ this->gtinfo_->sendFadingMessage(message, mapEntry.first->getClientID());
}
}
- else if (elem.second < timeRemaining/5)//Warning message
+ else if (mapEntry.second < timeRemaining/5)//Warning message
{
- if (elem.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
+ if (mapEntry.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
continue;
const std::string& message = "Camper Warning! Don't forget to shoot.";
- this->gtinfo_->sendFadingMessage(message, elem.first->getClientID());
+ this->gtinfo_->sendFadingMessage(message, mapEntry.first->getClientID());
}
}
}
@@ -228,15 +228,15 @@
Gametype::end();
int party = -1;
//find a player who survived
- for (auto & elem : this->playerLives_)
+ for (auto& mapEntry : this->playerLives_)
{
- if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
+ if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
continue;
- if (elem.second > 0)//a player that is alive
+ if (mapEntry.second > 0)//a player that is alive
{
//which party has survived?
- std::map<PlayerInfo*, int>::iterator it2 = this->teamnumbers_.find(elem.first);
+ std::map<PlayerInfo*, int>::iterator it2 = this->teamnumbers_.find(mapEntry.first);
if (it2 != this->teamnumbers_.end())
{
party = it2->second;
@@ -254,12 +254,12 @@
int LastTeamStanding::getMinLives()
{
int min = lives;
- for (auto & elem : this->playerLives_)
+ for (auto& mapEntry : this->playerLives_)
{
- if (elem.second <= 0)
+ if (mapEntry.second <= 0)
continue;
- if (elem.second < lives)
- min = elem.second;
+ if (mapEntry.second < lives)
+ min = mapEntry.second;
}
return min;
}
Modified: code/branches/cpp11_v2/src/orxonox/gametypes/TeamBaseMatch.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/gametypes/TeamBaseMatch.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/gametypes/TeamBaseMatch.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -151,13 +151,13 @@
int amountControlled = 0;
int amountControlled2 = 0;
- for (const auto & elem : this->bases_)
+ for (TeamBaseMatchBase* base : this->bases_)
{
- if((elem)->getState() == BaseState::ControlTeam1)
+ if(base->getState() == BaseState::ControlTeam1)
{
amountControlled++;
}
- if((elem)->getState() == BaseState::ControlTeam2)
+ if(base->getState() == BaseState::ControlTeam2)
{
amountControlled2++;
}
@@ -186,15 +186,15 @@
winningteam = 1;
}
- for (auto & elem : this->teamnumbers_)
+ for (auto& mapEntry : this->teamnumbers_)
{
- if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
+ if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
continue;
- if (elem.second == winningteam)
- this->gtinfo_->sendAnnounceMessage("You have won the match!", elem.first->getClientID());
+ if (mapEntry.second == winningteam)
+ this->gtinfo_->sendAnnounceMessage("You have won the match!", mapEntry.first->getClientID());
else
- this->gtinfo_->sendAnnounceMessage("You have lost the match!", elem.first->getClientID());
+ this->gtinfo_->sendAnnounceMessage("You have lost the match!", mapEntry.first->getClientID());
}
this->end();
@@ -237,11 +237,11 @@
{
int count = 0;
- for (const auto & elem : this->bases_)
+ for (TeamBaseMatchBase* base : this->bases_)
{
- if ((elem)->getState() == BaseState::ControlTeam1 && team == 0)
+ if (base->getState() == BaseState::ControlTeam1 && team == 0)
count++;
- if ((elem)->getState() == BaseState::ControlTeam2 && team == 1)
+ if (base->getState() == BaseState::ControlTeam2 && team == 1)
count++;
}
@@ -257,11 +257,11 @@
TeamBaseMatchBase* TeamBaseMatch::getBase(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->bases_)
+ for (TeamBaseMatchBase* base : this->bases_)
{
i++;
if (i > index)
- return (elem);
+ return base;
}
return nullptr;
}
Modified: code/branches/cpp11_v2/src/orxonox/gametypes/TeamDeathmatch.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/gametypes/TeamDeathmatch.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/gametypes/TeamDeathmatch.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -68,12 +68,12 @@
//find team that won the match
int winnerTeam = 0;
int highestScore = 0;
- for (auto & elem : this->players_)
+ for (auto& mapEntry : this->players_)
{
- if ( this->getTeamScore(elem.first) > highestScore )
+ if ( this->getTeamScore(mapEntry.first) > highestScore )
{
- winnerTeam = this->getTeam(elem.first);
- highestScore = this->getTeamScore(elem.first);
+ winnerTeam = this->getTeam(mapEntry.first);
+ highestScore = this->getTeamScore(mapEntry.first);
}
}
Modified: code/branches/cpp11_v2/src/orxonox/gametypes/TeamGametype.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/gametypes/TeamGametype.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/gametypes/TeamGametype.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -98,9 +98,9 @@
if(player == nullptr) return; // catch null pointers
std::vector<unsigned int> playersperteam(this->teams_, 0);
- for (auto & elem : this->teamnumbers_)
- if (elem.second < static_cast<int>(this->teams_) && elem.second >= 0)
- playersperteam[elem.second]++;
+ for (auto& mapEntry : this->teamnumbers_)
+ if (mapEntry.second < static_cast<int>(this->teams_) && mapEntry.second >= 0)
+ playersperteam[mapEntry.second]++;
unsigned int minplayers = static_cast<unsigned int>(-1);
size_t minplayersteam = 0;
@@ -122,10 +122,10 @@
bool valid_player = Gametype::playerLeft(player);
if( (this->players_.size() >= maxPlayers_) && (allowedInGame_[player] == true) ) // if there's a "waiting list"
{
- for (auto & elem : this->allowedInGame_)
+ for (auto& mapEntry : this->allowedInGame_)
{
- if(elem.second == false) // waiting player found
- {elem.second = true; break;} // allow player to enter
+ if(mapEntry.second == false) // waiting player found
+ {mapEntry.second = true; break;} // allow player to enter
}
}
@@ -140,17 +140,17 @@
void TeamGametype::spawnDeadPlayersIfRequested()
{
- for (auto & elem : this->players_)\
+ for (auto& mapEntry : this->players_)\
{
- if(allowedInGame_[elem.first] == false)//check if dead player is allowed to enter
+ if(allowedInGame_[mapEntry.first] == false)//check if dead player is allowed to enter
{
continue;
}
- if (elem.second.state_ == PlayerState::Dead)
+ if (mapEntry.second.state_ == PlayerState::Dead)
{
- if ((elem.first->isReadyToSpawn() || this->bForceSpawn_))
+ if ((mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
{
- this->spawnPlayer(elem.first);
+ this->spawnPlayer(mapEntry.first);
}
}
}
@@ -177,11 +177,11 @@
int teamscore = 0;
if(!player || this->getTeam(player) == -1)
return 0;
- for (auto & elem : this->players_)
+ for (auto& mapEntry : this->players_)
{
- if ( this->getTeam(elem.first) == this->getTeam(player) )
+ if ( this->getTeam(mapEntry.first) == this->getTeam(player) )
{
- teamscore += elem.second.frags_;
+ teamscore += mapEntry.second.frags_;
}
}
return teamscore;
@@ -190,9 +190,9 @@
int TeamGametype::getTeamSize(int team)
{
int teamSize = 0;
- for (auto & elem : this->teamnumbers_)
+ for (auto& mapEntry : this->teamnumbers_)
{
- if (elem.second == team)
+ if (mapEntry.second == team)
teamSize++;
}
return teamSize;
@@ -201,9 +201,9 @@
int TeamGametype::getHumansInTeam(int team)
{
int teamSize = 0;
- for (auto & elem : this->teamnumbers_)
+ for (auto& mapEntry : this->teamnumbers_)
{
- if (elem.second == team && elem.first->isHumanPlayer())
+ if (mapEntry.second == team && mapEntry.first->isHumanPlayer())
teamSize++;
}
return teamSize;
@@ -240,11 +240,11 @@
unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size())));
unsigned int index = 0;
// Get random fallback spawnpoint in case there is no active SpawnPoint.
- for (const auto & teamSpawnPoint : teamSpawnPoints)
+ for (SpawnPoint* teamSpawnPoint : teamSpawnPoints)
{
if (index == randomspawn)
{
- fallbackSpawnPoint = (teamSpawnPoint);
+ fallbackSpawnPoint = teamSpawnPoint;
break;
}
@@ -265,10 +265,10 @@
randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size())));
index = 0;
- for (const auto & teamSpawnPoint : teamSpawnPoints)
+ for (SpawnPoint* teamSpawnPoint : teamSpawnPoints)
{
if (index == randomspawn)
- return (teamSpawnPoint);
+ return teamSpawnPoint;
++index;
}
@@ -363,9 +363,9 @@
pawn->setRadarObjectColour(this->teamcolours_[teamNr]);
std::set<WorldEntity*> pawnAttachments = pawn->getAttachedObjects();
- for (const auto & pawnAttachment : pawnAttachments)
+ for (WorldEntity* pawnAttachment : pawnAttachments)
{
- if ((pawnAttachment)->isA(Class(TeamColourable)))
+ if (pawnAttachment->isA(Class(TeamColourable)))
{
TeamColourable* tc = orxonox_cast<TeamColourable*>(pawnAttachment);
tc->setTeamColour(this->teamcolours_[teamNr]);
@@ -375,17 +375,17 @@
void TeamGametype::announceTeamWin(int winnerTeam)
{
- for (auto & elem : this->teamnumbers_)
+ for (auto& mapEntry : this->teamnumbers_)
{
- if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
+ if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
continue;
- if (elem.second == winnerTeam)
+ if (mapEntry.second == winnerTeam)
{
- this->gtinfo_->sendAnnounceMessage("Your team has won the match!", elem.first->getClientID());
+ this->gtinfo_->sendAnnounceMessage("Your team has won the match!", mapEntry.first->getClientID());
}
else
{
- this->gtinfo_->sendAnnounceMessage("Your team has lost the match!", elem.first->getClientID());
+ this->gtinfo_->sendAnnounceMessage("Your team has lost the match!", mapEntry.first->getClientID());
}
}
}
Modified: code/branches/cpp11_v2/src/orxonox/gametypes/UnderAttack.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/gametypes/UnderAttack.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/gametypes/UnderAttack.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -73,15 +73,15 @@
ChatManager::message(message);
this->gameEnded_ = true;
- for (auto & elem : this->teamnumbers_)
+ for (auto& mapEntry : this->teamnumbers_)
{
- if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
+ if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
continue;
- if (elem.second == attacker_)
- this->gtinfo_->sendAnnounceMessage("You have won the match!", elem.first->getClientID());
+ if (mapEntry.second == attacker_)
+ this->gtinfo_->sendAnnounceMessage("You have won the match!", mapEntry.first->getClientID());
else
- this->gtinfo_->sendAnnounceMessage("You have lost the match!", elem.first->getClientID());
+ this->gtinfo_->sendAnnounceMessage("You have lost the match!", mapEntry.first->getClientID());
}
}
@@ -154,15 +154,15 @@
std::string message("Time is up! Team 1 has won!");
ChatManager::message(message);
- for (auto & elem : this->teamnumbers_)
+ for (auto& mapEntry : this->teamnumbers_)
{
- if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
+ if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
continue;
- if (elem.second == 1)
- this->gtinfo_->sendAnnounceMessage("You have won the match!", elem.first->getClientID());
+ if (mapEntry.second == 1)
+ this->gtinfo_->sendAnnounceMessage("You have won the match!", mapEntry.first->getClientID());
else
- this->gtinfo_->sendAnnounceMessage("You have lost the match!", elem.first->getClientID());
+ this->gtinfo_->sendAnnounceMessage("You have lost the match!", mapEntry.first->getClientID());
}
}
Modified: code/branches/cpp11_v2/src/orxonox/interfaces/PickupCarrier.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/interfaces/PickupCarrier.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/interfaces/PickupCarrier.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -134,11 +134,11 @@
PickupCarrier* target = nullptr;
// Go recursively through all children to check whether they are the target.
std::vector<PickupCarrier*>* children = this->getCarrierChildren();
- for(auto & elem : *children)
+ for(PickupCarrier* child : *children)
{
- if(pickup->isTarget(elem))
+ if(pickup->isTarget(child))
{
- target = elem;
+ target = child;
break;
}
}
Modified: code/branches/cpp11_v2/src/orxonox/interfaces/Pickupable.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/interfaces/Pickupable.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/interfaces/Pickupable.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -159,9 +159,9 @@
bool Pickupable::isTarget(const Identifier* identifier) const
{
// Iterate through all targets of this Pickupable.
- for(const auto & elem : this->targets_)
+ for(Identifier* target : this->targets_)
{
- if(identifier->isA(elem))
+ if(identifier->isA(target))
return true;
}
Modified: code/branches/cpp11_v2/src/orxonox/items/MultiStateEngine.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/items/MultiStateEngine.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/items/MultiStateEngine.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -218,10 +218,10 @@
EffectContainer* MultiStateEngine::getEffectContainer(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->effectContainers_)
+ for (EffectContainer* effectContainer : this->effectContainers_)
{
if (i == index)
- return (elem);
+ return effectContainer;
i++;
}
return nullptr;
Modified: code/branches/cpp11_v2/src/orxonox/items/ShipPart.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/items/ShipPart.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/items/ShipPart.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -142,14 +142,14 @@
/**
@brief
Check whether the ShipPart has a particular Entity.
- @param engine
+ @param search
A pointer to the Entity to be checked.
*/
- bool ShipPart::hasEntity(StaticEntity* entity) const
+ bool ShipPart::hasEntity(StaticEntity* search) const
{
- for(auto & elem : this->entityList_)
+ for(StaticEntity* entity : this->entityList_)
{
- if(elem == entity)
+ if(entity == search)
return true;
}
return false;
Modified: code/branches/cpp11_v2/src/orxonox/overlays/OverlayGroup.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/overlays/OverlayGroup.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/overlays/OverlayGroup.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -61,8 +61,8 @@
OverlayGroup::~OverlayGroup()
{
- for (const auto & elem : hudElements_)
- (elem)->destroy();
+ for (OrxonoxOverlay* hudElement : hudElements_)
+ hudElement->destroy();
this->hudElements_.clear();
}
@@ -85,16 +85,16 @@
//! Scales every element in the set.
void OverlayGroup::setScale(const Vector2& scale)
{
- for (const auto & elem : hudElements_)
- (elem)->scale(scale / this->scale_);
+ for (OrxonoxOverlay* hudElement : hudElements_)
+ hudElement->scale(scale / this->scale_);
this->scale_ = scale;
}
//! Scrolls every element in the set.
void OverlayGroup::setScroll(const Vector2& scroll)
{
- for (const auto & elem : hudElements_)
- (elem)->scroll(scroll - this->scroll_);
+ for (OrxonoxOverlay* hudElement : hudElements_)
+ hudElement->scroll(scroll - this->scroll_);
this->scroll_ = scroll;
}
@@ -146,16 +146,16 @@
{
SUPER( OverlayGroup, changedVisibility );
- for (const auto & elem : hudElements_)
- (elem)->changedVisibility(); //inform all Child Overlays that our visibility has changed
+ for (OrxonoxOverlay* hudElement : hudElements_)
+ hudElement->changedVisibility(); //inform all Child Overlays that our visibility has changed
}
void OverlayGroup::setOwner(BaseObject* owner)
{
this->owner_ = owner;
- for (const auto & elem : hudElements_)
- (elem)->setOwner(owner);
+ for (OrxonoxOverlay* hudElement : hudElements_)
+ hudElement->setOwner(owner);
}
//########### Console commands ############
Modified: code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -406,12 +406,12 @@
{
if (ambient != nullptr)
{
- for (auto & elem : this->ambientSounds_)
+ for (std::pair<AmbientSound*, bool>& pair : this->ambientSounds_)
{
- if (elem.first == ambient)
+ if (pair.first == ambient)
{
- elem.second = true;
- this->fadeOut(elem.first);
+ pair.second = true;
+ this->fadeOut(pair.first);
return;
}
}
Modified: code/branches/cpp11_v2/src/orxonox/sound/SoundStreamer.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/sound/SoundStreamer.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/sound/SoundStreamer.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -67,7 +67,7 @@
alGenBuffers(4, initbuffers);
int current_section;
- for(auto & initbuffer : initbuffers)
+ for(ALuint& initbuffer : initbuffers)
{
long ret = ov_read(&vf, inbuffer, sizeof(inbuffer), 0, 2, 1, ¤t_section);
if (ret == 0)
Modified: code/branches/cpp11_v2/src/orxonox/weaponsystem/Munition.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/weaponsystem/Munition.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/weaponsystem/Munition.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -54,8 +54,8 @@
Munition::~Munition()
{
- for (auto & elem : this->currentMagazines_)
- delete elem.second;
+ for (auto& mapEntry : this->currentMagazines_)
+ delete mapEntry.second;
}
Munition::Magazine* Munition::getMagazine(WeaponMode* user) const
@@ -267,8 +267,8 @@
else
{
// Return true if any of the current magazines is not full (loading counts as full although it returns 0 munition)
- for (const auto & elem : this->currentMagazines_)
- if (elem.second->munition_ < this->maxMunitionPerMagazine_ && elem.second->bLoaded_)
+ for (const auto& mapEntry : this->currentMagazines_)
+ if (mapEntry.second->munition_ < this->maxMunitionPerMagazine_ && mapEntry.second->bLoaded_)
return true;
}
@@ -315,12 +315,12 @@
while (amount > 0)
{
bool change = false;
- for (auto & elem : this->currentMagazines_)
+ for (auto& mapEntry : this->currentMagazines_)
{
// Add munition if the magazine isn't full (but only to loaded magazines)
- if (amount > 0 && elem.second->munition_ < this->maxMunitionPerMagazine_ && elem.second->bLoaded_)
+ if (amount > 0 && mapEntry.second->munition_ < this->maxMunitionPerMagazine_ && mapEntry.second->bLoaded_)
{
- elem.second->munition_++;
+ mapEntry.second->munition_++;
amount--;
change = true;
}
Modified: code/branches/cpp11_v2/src/orxonox/weaponsystem/Weapon.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/weaponsystem/Weapon.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/weaponsystem/Weapon.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -60,8 +60,8 @@
if (this->weaponPack_)
this->weaponPack_->removeWeapon(this);
- for (auto & elem : this->weaponmodes_)
- elem.second->destroy();
+ for (auto& mapEntry : this->weaponmodes_)
+ mapEntry.second->destroy();
}
}
@@ -84,10 +84,10 @@
WeaponMode* Weapon::getWeaponmode(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->weaponmodes_)
+ for (const auto& mapEntry : this->weaponmodes_)
{
if (i == index)
- return elem.second;
+ return mapEntry.second;
++i;
}
@@ -135,8 +135,8 @@
void Weapon::reload()
{
- for (auto & elem : this->weaponmodes_)
- elem.second->reload();
+ for (auto& mapEntry : this->weaponmodes_)
+ mapEntry.second->reload();
}
void Weapon::reloaded()
@@ -147,7 +147,7 @@
void Weapon::notifyWeaponModes()
{
- for (auto & elem : this->weaponmodes_)
- elem.second->setWeapon(this);
+ for (auto& mapEntry : this->weaponmodes_)
+ mapEntry.second->setWeapon(this);
}
}
Modified: code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponPack.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponPack.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponPack.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -75,8 +75,8 @@
*/
void WeaponPack::fire(unsigned int weaponmode)
{
- for (auto & elem : this->weapons_)
- (elem)->fire(weaponmode);
+ for (Weapon* weapon : this->weapons_)
+ weapon->fire(weaponmode);
}
/**
@@ -85,8 +85,8 @@
*/
void WeaponPack::reload()
{
- for (auto & elem : this->weapons_)
- (elem)->reload();
+ for (Weapon* weapon : this->weapons_)
+ weapon->reload();
}
void WeaponPack::addWeapon(Weapon * weapon)
@@ -113,10 +113,10 @@
{
unsigned int i = 0;
- for (const auto & elem : this->weapons_)
+ for (Weapon* weapon : this->weapons_)
{
if (i == index)
- return (elem);
+ return weapon;
++i;
}
@@ -131,10 +131,10 @@
DefaultWeaponmodeLink* WeaponPack::getDefaultWeaponmodeLink(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->links_)
+ for (DefaultWeaponmodeLink* link : this->links_)
{
if (i == index)
- return (elem);
+ return link;
++i;
}
@@ -143,9 +143,9 @@
unsigned int WeaponPack::getDesiredWeaponmode(unsigned int firemode) const
{
- for (const auto & elem : this->links_)
- if ((elem)->getFiremode() == firemode)
- return (elem)->getWeaponmode();
+ for (DefaultWeaponmodeLink* link : this->links_)
+ if (link->getFiremode() == firemode)
+ return link->getWeaponmode();
return WeaponSystem::WEAPON_MODE_UNASSIGNED;
}
Modified: code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponSet.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponSet.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponSet.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -62,16 +62,16 @@
void WeaponSet::fire()
{
// Fire all WeaponPacks with their defined weaponmode
- for (auto & elem : this->weaponpacks_)
- if (elem.second != WeaponSystem::WEAPON_MODE_UNASSIGNED)
- elem.first->fire(elem.second);
+ for (auto& mapEntry : this->weaponpacks_)
+ if (mapEntry.second != WeaponSystem::WEAPON_MODE_UNASSIGNED)
+ mapEntry.first->fire(mapEntry.second);
}
void WeaponSet::reload()
{
// Reload all WeaponPacks with their defined weaponmode
- for (auto & elem : this->weaponpacks_)
- elem.first->reload();
+ for (auto& mapEntry : this->weaponpacks_)
+ mapEntry.first->reload();
}
void WeaponSet::setWeaponmodeLink(WeaponPack* weaponpack, unsigned int weaponmode)
Modified: code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponSystem.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponSystem.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponSystem.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -105,11 +105,11 @@
WeaponSlot * WeaponSystem::getWeaponSlot(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->weaponSlots_)
+ for (WeaponSlot* weaponSlot : this->weaponSlots_)
{
++i;
if (i > index)
- return (elem);
+ return weaponSlot;
}
return nullptr;
}
@@ -152,11 +152,11 @@
WeaponSet * WeaponSystem::getWeaponSet(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->weaponSets_)
+ for (const auto& mapEntry : this->weaponSets_)
{
++i;
if (i > index)
- return elem.second;
+ return mapEntry.second;
}
return nullptr;
}
@@ -167,9 +167,9 @@
return false;
unsigned int freeSlots = 0;
- for (auto & elem : this->weaponSlots_)
+ for (WeaponSlot* weaponSlot : this->weaponSlots_)
{
- if (!(elem)->isOccupied())
+ if (!weaponSlot->isOccupied())
++freeSlots;
}
@@ -183,23 +183,23 @@
// Attach all weapons to the first free slots (and to the Pawn)
unsigned int i = 0;
- for (auto & elem : this->weaponSlots_)
+ for (WeaponSlot* weaponSlot : this->weaponSlots_)
{
- if (!(elem)->isOccupied() && i < wPack->getNumWeapons())
+ if (!weaponSlot->isOccupied() && i < wPack->getNumWeapons())
{
Weapon* weapon = wPack->getWeapon(i);
- (elem)->attachWeapon(weapon);
+ weaponSlot->attachWeapon(weapon);
this->getPawn()->attach(weapon);
++i;
}
}
// Assign the desired weaponmode to the firemodes
- for (auto & elem : this->weaponSets_)
+ for (auto& mapEntry : this->weaponSets_)
{
- unsigned int weaponmode = wPack->getDesiredWeaponmode(elem.first);
+ unsigned int weaponmode = wPack->getDesiredWeaponmode(mapEntry.first);
if (weaponmode != WeaponSystem::WEAPON_MODE_UNASSIGNED)
- elem.second->setWeaponmodeLink(wPack, weaponmode);
+ mapEntry.second->setWeaponmodeLink(wPack, weaponmode);
}
this->weaponPacks_.push_back(wPack);
@@ -218,8 +218,8 @@
weapon->getWeaponSlot()->removeWeapon();
// Remove all added links from the WeaponSets
- for (auto & elem : this->weaponSets_)
- elem.second->removeWeaponmodeLink(wPack);
+ for (auto& mapEntry : this->weaponSets_)
+ mapEntry.second->removeWeaponmodeLink(wPack);
// Remove the WeaponPack from the WeaponSystem
std::vector<WeaponPack*>::iterator it2 = std::find(this->weaponPacks_.begin(),this->weaponPacks_.end(), wPack);
@@ -230,11 +230,11 @@
WeaponPack * WeaponSystem::getWeaponPack(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->weaponPacks_)
+ for (WeaponPack* weaponPack : this->weaponPacks_)
{
++i;
if (i > index)
- return (elem);
+ return weaponPack;
}
return nullptr;
}
@@ -267,9 +267,9 @@
// Check if the WeaponSet belongs to this WeaponSystem
bool foundWeaponSet = false;
- for (auto & elem : this->weaponSets_)
+ for (auto& mapEntry : this->weaponSets_)
{
- if (elem.second == wSet)
+ if (mapEntry.second == wSet)
{
foundWeaponSet = true;
break;
@@ -295,8 +295,8 @@
void WeaponSystem::reload()
{
- for (auto & elem : this->weaponSets_)
- elem.second->reload();
+ for (auto& mapEntry : this->weaponSets_)
+ mapEntry.second->reload();
}
Munition * WeaponSystem::getMunition(SubclassIdentifier<Munition> * identifier)
Modified: code/branches/cpp11_v2/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/worldentities/ControllableEntity.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/worldentities/ControllableEntity.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -164,10 +164,10 @@
CameraPosition* ControllableEntity::getCameraPosition(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->cameraPositions_)
+ for (CameraPosition* cameraPosition : this->cameraPositions_)
{
if (i == index)
- return (elem);
+ return cameraPosition;
++i;
}
return nullptr;
@@ -179,9 +179,9 @@
return 0;
unsigned int counter = 0;
- for (const auto & elem : this->cameraPositions_)
+ for (CameraPosition* cameraPosition : this->cameraPositions_)
{
- if ((elem) == this->currentCameraPosition_)
+ if (cameraPosition == this->currentCameraPosition_)
break;
counter++;
}
@@ -476,9 +476,9 @@
WorldEntity* parent = this->getParent();
if (parent)
{
- for (auto & elem : this->cameraPositions_)
- if ((elem)->getIsAbsolute())
- parent->attach((elem));
+ for (CameraPosition* cameraPosition : this->cameraPositions_)
+ if (cameraPosition->getIsAbsolute())
+ parent->attach(cameraPosition);
}
}
Modified: code/branches/cpp11_v2/src/orxonox/worldentities/EffectContainer.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/worldentities/EffectContainer.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/worldentities/EffectContainer.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -88,9 +88,9 @@
WorldEntity* EffectContainer::getEffect(unsigned int index) const
{
unsigned int i = 0;
- for (const auto & elem : this->effects_)
+ for (WorldEntity* effect : this->effects_)
if (i == index)
- return (elem);
+ return effect;
return nullptr;
}
Modified: code/branches/cpp11_v2/src/orxonox/worldentities/WorldEntity.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/worldentities/WorldEntity.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/worldentities/WorldEntity.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -232,16 +232,16 @@
this->deactivatePhysics();
// iterate over all children and change their activity as well
- for (const auto & elem : this->getAttachedObjects())
+ for (WorldEntity* object : this->getAttachedObjects())
{
if(!this->isActive())
{
- (elem)->bActiveMem_ = (elem)->isActive();
- (elem)->setActive(this->isActive());
+ object->bActiveMem_ = object->isActive();
+ object->setActive(this->isActive());
}
else
{
- (elem)->setActive((elem)->bActiveMem_);
+ object->setActive(object->bActiveMem_);
}
}
}
@@ -258,16 +258,16 @@
if(GameMode::isMaster())
{
// iterate over all children and change their visibility as well
- for (const auto & elem : this->getAttachedObjects())
+ for (WorldEntity* object : this->getAttachedObjects())
{
if(!this->isVisible())
{
- (elem)->bVisibleMem_ = (elem)->isVisible();
- (elem)->setVisible(this->isVisible());
+ object->bVisibleMem_ = object->isVisible();
+ object->setVisible(this->isVisible());
}
else
{
- (elem)->setVisible((elem)->bVisibleMem_);
+ object->setVisible(object->bVisibleMem_);
}
}
}
@@ -517,10 +517,10 @@
WorldEntity* WorldEntity::getAttachedObject(unsigned int index)
{
unsigned int i = 0;
- for (const auto & elem : this->children_)
+ for (WorldEntity* child : this->children_)
{
if (i == index)
- return (elem);
+ return child;
++i;
}
return nullptr;
@@ -937,8 +937,8 @@
// Note: CollisionShape changes of a child get handled over the internal CompoundCollisionShape already
// Recalculate mass
this->childrenMass_ = 0.0f;
- for (const auto & elem : this->children_)
- this->childrenMass_ += (elem)->getMass();
+ for (WorldEntity* child : this->children_)
+ this->childrenMass_ += child->getMass();
recalculateMassProps();
// Notify parent WE
if (this->parent_)
Modified: code/branches/cpp11_v2/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/worldentities/pawns/ModularSpaceShip.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/worldentities/pawns/ModularSpaceShip.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -98,15 +98,15 @@
break;
}
// iterate through all attached parts
- for(auto & elem : this->partList_)
+ for(ShipPart* part : this->partList_)
{
// if the name of the part matches the name of the object, add the object to that parts entitylist (unless it was already done).
- if((elem->getName() == this->getAttachedObject(i)->getName()) && !elem->hasEntity(orxonox_cast<StaticEntity*>(this->getAttachedObject(i))))
+ if((part->getName() == this->getAttachedObject(i)->getName()) && !part->hasEntity(orxonox_cast<StaticEntity*>(this->getAttachedObject(i))))
{
// The Entity is added to the part's entityList_
- elem->addEntity(orxonox_cast<StaticEntity*>(this->getAttachedObject(i)));
+ part->addEntity(orxonox_cast<StaticEntity*>(this->getAttachedObject(i)));
// An entry in the partMap_ is created, assigning the part to the entity.
- this->addPartEntityAssignment((StaticEntity*)(this->getAttachedObject(i)), elem);
+ this->addPartEntityAssignment((StaticEntity*)(this->getAttachedObject(i)), part);
}
}
}
@@ -145,10 +145,10 @@
*/
ShipPart* ModularSpaceShip::getPartOfEntity(StaticEntity* entity) const
{
- for (const auto & elem : this->partMap_)
+ for (const auto& mapEntry : this->partMap_)
{
- if (elem.first == entity)
- return elem.second;
+ if (mapEntry.first == entity)
+ return mapEntry.second;
}
return nullptr;
}
@@ -241,11 +241,11 @@
*/
ShipPart* ModularSpaceShip::getShipPartByName(std::string name)
{
- for(auto & elem : this->partList_)
+ for(ShipPart* part : this->partList_)
{
- if(orxonox_cast<ShipPart*>(elem)->getName() == name)
+ if(orxonox_cast<ShipPart*>(part)->getName() == name)
{
- return orxonox_cast<ShipPart*>(elem);
+ return orxonox_cast<ShipPart*>(part);
}
}
orxout(internal_warning) << "Couldn't find ShipPart with name \"" << name << "\"." << endl;
@@ -255,14 +255,14 @@
/**
@brief
Check whether the SpaceShip has a particular Engine.
- @param engine
+ @param search
A pointer to the Engine to be checked.
*/
- bool ModularSpaceShip::hasShipPart(ShipPart* part) const
+ bool ModularSpaceShip::hasShipPart(ShipPart* search) const
{
- for(auto & elem : this->partList_)
+ for(ShipPart* part : this->partList_)
{
- if(elem == part)
+ if(part == search)
return true;
}
return false;
Modified: code/branches/cpp11_v2/src/orxonox/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/worldentities/pawns/SpaceShip.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/worldentities/pawns/SpaceShip.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -157,8 +157,8 @@
SUPER(SpaceShip, tick, dt);
// Run the engines
- for(auto & elem : this->engineList_)
- (elem)->run(dt);
+ for(Engine* engine : this->engineList_)
+ engine->run(dt);
if (this->hasLocalController())
{
@@ -312,14 +312,14 @@
/**
@brief
Check whether the SpaceShip has a particular Engine.
- @param engine
+ @param search
A pointer to the Engine to be checked.
*/
- bool SpaceShip::hasEngine(Engine* engine) const
+ bool SpaceShip::hasEngine(Engine* search) const
{
- for(auto & elem : this->engineList_)
+ for(Engine* engine : this->engineList_)
{
- if(elem == engine)
+ if(engine == search)
return true;
}
return false;
@@ -349,9 +349,9 @@
*/
Engine* SpaceShip::getEngineByName(const std::string& name)
{
- for(auto & elem : this->engineList_)
- if(elem->getName() == name)
- return elem;
+ for(Engine* engine : this->engineList_)
+ if(engine->getName() == name)
+ return engine;
orxout(internal_warning) << "Couldn't find Engine with name \"" << name << "\"." << endl;
return nullptr;
@@ -395,8 +395,8 @@
*/
void SpaceShip::addSpeedFactor(float factor)
{
- for(auto & elem : this->engineList_)
- elem->addSpeedMultiply(factor);
+ for(Engine* engine : this->engineList_)
+ engine->addSpeedMultiply(factor);
}
/**
@@ -407,8 +407,8 @@
*/
void SpaceShip::addSpeed(float speed)
{
- for(auto & elem : this->engineList_)
- elem->addSpeedAdd(speed);
+ for(Engine* engine : this->engineList_)
+ engine->addSpeedAdd(speed);
}
/**
@@ -435,10 +435,10 @@
float SpaceShip::getMaxSpeedFront() const
{
float speed=0;
- for(auto & elem : this->engineList_)
+ for(Engine* engine : this->engineList_)
{
- if(elem->getMaxSpeedFront() > speed)
- speed = elem->getMaxSpeedFront();
+ if(engine->getMaxSpeedFront() > speed)
+ speed = engine->getMaxSpeedFront();
}
return speed;
}
Modified: code/branches/cpp11_v2/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc 2015-12-02 09:31:23 UTC (rev 10915)
+++ code/branches/cpp11_v2/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc 2015-12-02 22:22:03 UTC (rev 10916)
@@ -79,9 +79,9 @@
std::set<WorldEntity*> attachments = this->getAttachedObjects();
- for (const auto & attachment : attachments)
+ for (WorldEntity* attachment : attachments)
{
- if ((attachment)->isA(Class(TeamColourable)))
+ if (attachment->isA(Class(TeamColourable)))
{
TeamColourable* tc = orxonox_cast<TeamColourable*>(attachment);
tc->setTeamColour(colour);
More information about the Orxonox-commit
mailing list