Changeset 10917 for code/branches/cpp11_v2
- Timestamp:
- Dec 2, 2015, 11:32:08 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/Language.cc
r10916 r10917 107 107 Language::~Language() 108 108 { 109 for ( auto& mapEntry : this->languageEntries_)109 for (const auto& mapEntry : this->languageEntries_) 110 110 delete (mapEntry.second); 111 111 } -
code/branches/cpp11_v2/src/libraries/core/Loader.cc
r10916 r10917 261 261 { 262 262 bool expectedValue = true; 263 for ( auto& mapEntry : luaTags)263 for (const auto& mapEntry : luaTags) 264 264 { 265 265 if (mapEntry.second == expectedValue) -
code/branches/cpp11_v2/src/libraries/core/NamespaceNode.cc
r10916 r10917 103 103 bool bFoundMatchingNamespace = false; 104 104 105 for ( auto& mapEntry : this->subnodes_)105 for (const auto& mapEntry : this->subnodes_) 106 106 { 107 107 if (mapEntry.first.find(firstPart) == (mapEntry.first.size() - firstPart.size())) -
code/branches/cpp11_v2/src/libraries/core/class/Identifier.cc
r10916 r10917 92 92 const_cast<Identifier*>(directChild)->directParents_.remove(this); 93 93 94 for ( auto& mapEntry : this->configValues_)94 for (const auto& mapEntry : this->configValues_) 95 95 delete (mapEntry.second); 96 for ( auto& mapEntry : this->xmlportParamContainers_)96 for (const auto& mapEntry : this->xmlportParamContainers_) 97 97 delete (mapEntry.second); 98 for ( auto& mapEntry : this->xmlportObjectContainers_)98 for (const auto& mapEntry : this->xmlportObjectContainers_) 99 99 delete (mapEntry.second); 100 100 } -
code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc
r10916 r10917 373 373 // check whether a state has changed its EMPTY situation 374 374 bool bUpdateRequired = false; 375 for ( auto& mapEntry : activeStates_)375 for (const auto& mapEntry : activeStates_) 376 376 { 377 377 if (mapEntry.second->hasExpired()) -
code/branches/cpp11_v2/src/libraries/core/module/DynLibManager.cc
r10916 r10917 75 75 { 76 76 // Unload & delete resources in turn 77 for ( auto& mapEntry : mLibList)77 for (const auto& mapEntry : mLibList) 78 78 { 79 79 mapEntry.second->unload(); -
code/branches/cpp11_v2/src/libraries/core/module/ModuleInstance.cc
r10916 r10917 75 75 std::map<StaticInitialization::Type, std::set<StaticallyInitializedInstance*>> copy(this->staticallyInitializedInstancesByType_); 76 76 this->staticallyInitializedInstancesByType_.clear(); 77 for ( auto& mapEntry : copy)77 for (const auto& mapEntry : copy) 78 78 for (std::set<StaticallyInitializedInstance*>::iterator it2 = mapEntry.second.begin(); it2 != mapEntry.second.end(); ++it2) 79 79 delete (*it2); -
code/branches/cpp11_v2/src/libraries/core/module/PluginManager.cc
r10916 r10917 59 59 ModifyConsoleCommand("PluginManager", __CC_PluginManager_unload_name).setObject(nullptr); 60 60 61 for ( auto& mapEntry : this->references_)61 for (const auto& mapEntry : this->references_) 62 62 delete mapEntry.second; 63 for ( auto& mapEntry : this->plugins_)63 for (const auto& mapEntry : this->plugins_) 64 64 delete mapEntry.second; 65 65 } -
code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceController.cc
r10916 r10917 161 161 162 162 std::vector<RaceCheckPoint*> returnVec; 163 for ( auto& mapEntry : zaehler)163 for (const auto& mapEntry : zaehler) 164 164 { 165 165 if (mapEntry.second == maxWays) -
code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceManager.cc
r10916 r10917 77 77 } 78 78 79 for ( auto& mapEntry : players_)79 for (const auto& mapEntry : players_) 80 80 { 81 81 -
code/branches/cpp11_v2/src/modules/mini4dgame/Mini4Dgame.cc
r10916 r10917 155 155 { 156 156 // first spawn human players to assign always the left bat to the player in singleplayer 157 for ( auto& mapEntry : this->players_)157 for (const auto& mapEntry : this->players_) 158 158 if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_)) 159 159 this->spawnPlayer(mapEntry.first); 160 160 // now spawn bots 161 for ( auto& mapEntry : this->players_)161 for (const auto& mapEntry : this->players_) 162 162 if (!mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_)) 163 163 this->spawnPlayer(mapEntry.first); -
code/branches/cpp11_v2/src/modules/notifications/NotificationManager.cc
r10916 r10917 69 69 { 70 70 // Destroys all Notifications. 71 for( auto& mapEntry : this->allNotificationsList_)71 for(const auto& mapEntry : this->allNotificationsList_) 72 72 mapEntry.second->destroy(); 73 73 this->allNotificationsList_.clear(); … … 152 152 bool executed = false; 153 153 // Clear all NotificationQueues that have the input sender as target. 154 for( auto& mapEntry : this->queues_) // Iterate through all NotificationQueues.154 for(const auto& mapEntry : this->queues_) // Iterate through all NotificationQueues. 155 155 { 156 156 const std::set<std::string>& set = mapEntry.second->getTargetsSet(); … … 187 187 188 188 // Insert the Notification in all NotificationQueues that have its sender as target. 189 for( auto& mapEntry : this->queues_) // Iterate through all NotificationQueues.189 for(const auto& mapEntry : this->queues_) // Iterate through all NotificationQueues. 190 190 { 191 191 const std::set<std::string>& set = mapEntry.second->getTargetsSet(); … … 345 345 346 346 // Iterate through all Notifications to determine whether any of them should belong to the newly registered NotificationQueue. 347 for( auto& mapEntry : this->allNotificationsList_)347 for(const auto& mapEntry : this->allNotificationsList_) 348 348 { 349 349 if(!bAll && set.find(mapEntry.second->getSender()) != set.end()) // Checks whether the listener has the sender of the current Notification as target. -
code/branches/cpp11_v2/src/modules/notifications/NotificationQueue.cc
r10916 r10917 206 206 { 207 207 // Add all Notifications that have been created after this NotificationQueue was created. 208 for( auto& mapEntry : *notifications)208 for(const auto& mapEntry : *notifications) 209 209 { 210 210 if(mapEntry.first >= this->creationTime_) -
code/branches/cpp11_v2/src/modules/overlays/hud/HUDNavigation.cc
r10916 r10917 131 131 } 132 132 this->fontName_ = font; 133 for ( auto& mapEntry : this->activeObjectList_)133 for (const auto& mapEntry : this->activeObjectList_) 134 134 { 135 135 if (mapEntry.second.text_ != nullptr) … … 151 151 } 152 152 this->textSize_ = size; 153 for ( auto& mapEntry : this->activeObjectList_)153 for (const auto& mapEntry : this->activeObjectList_) 154 154 { 155 155 if (mapEntry.second.text_) … … 531 531 float yScale = this->getActualSize().y; 532 532 533 for ( auto& mapEntry : this->activeObjectList_)533 for (const auto& mapEntry : this->activeObjectList_) 534 534 { 535 535 if (mapEntry.second.health_ != nullptr) -
code/branches/cpp11_v2/src/modules/overlays/hud/HUDRadar.cc
r10916 r10917 92 92 Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->map3DBack_); 93 93 94 for ( auto& mapEntry : this->radarObjects_)94 for (const auto& mapEntry : this->radarObjects_) 95 95 { 96 96 Ogre::OverlayManager::getSingleton().destroyOverlayElement(mapEntry.second); -
code/branches/cpp11_v2/src/modules/pickup/PickupManager.cc
r10916 r10917 91 91 92 92 // Destroying all the PickupInventoryContainers that are still there. 93 for( auto& mapEntry : this->pickupInventoryContainers_)93 for(const auto& mapEntry : this->pickupInventoryContainers_) 94 94 delete mapEntry.second; 95 95 this->pickupInventoryContainers_.clear(); -
code/branches/cpp11_v2/src/modules/pong/Pong.cc
r10916 r10917 211 211 { 212 212 // first spawn human players to assign always the left bat to the player in singleplayer 213 for ( auto& mapEntry : this->players_)213 for (const auto& mapEntry : this->players_) 214 214 if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_)) 215 215 this->spawnPlayer(mapEntry.first); 216 216 // now spawn bots 217 for ( auto& mapEntry : this->players_)217 for (const auto& mapEntry : this->players_) 218 218 if (!mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_)) 219 219 this->spawnPlayer(mapEntry.first); -
code/branches/cpp11_v2/src/modules/questsystem/QuestManager.cc
r10916 r10917 235 235 { 236 236 int numQuests = 0; 237 for( auto& mapEntry : this->questMap_)237 for(const auto& mapEntry : this->questMap_) 238 238 { 239 239 if(mapEntry.second->getParentQuest() == nullptr && !mapEntry.second->isInactive(player)) … … 255 255 Quest* QuestManager::getRootQuest(PlayerInfo* player, int index) 256 256 { 257 for( auto& mapEntry : this->questMap_)257 for(const auto& mapEntry : this->questMap_) 258 258 { 259 259 if(mapEntry.second->getParentQuest() == nullptr && !mapEntry.second->isInactive(player) && index-- == 0) -
code/branches/cpp11_v2/src/modules/tetris/Tetris.cc
r10916 r10917 341 341 { 342 342 // Spawn a human player. 343 for ( auto& mapEntry : this->players_)343 for (const auto& mapEntry : this->players_) 344 344 if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_)) 345 345 this->spawnPlayer(mapEntry.first); -
code/branches/cpp11_v2/src/orxonox/collisionshapes/CompoundCollisionShape.cc
r10916 r10917 65 65 { 66 66 // Delete all children 67 for ( auto& mapEntry : this->attachedShapes_)67 for (const auto& mapEntry : this->attachedShapes_) 68 68 { 69 69 // make sure that the child doesn't want to detach itself --> speedup because of the missing update … … 266 266 std::vector<CollisionShape*> shapes; 267 267 // Iterate through all attached CollisionShapes and add them to the list of shapes. 268 for( auto& mapEntry : this->attachedShapes_)268 for(const auto& mapEntry : this->attachedShapes_) 269 269 shapes.push_back(mapEntry.first); 270 270 -
code/branches/cpp11_v2/src/orxonox/controllers/ArtificialController.cc
r10916 r10917 231 231 int ArtificialController::getFiremode(std::string name) 232 232 { 233 for ( auto& mapEntry : this->weaponModes_)233 for (const auto& mapEntry : this->weaponModes_) 234 234 { 235 235 if (mapEntry.first == name) -
code/branches/cpp11_v2/src/orxonox/gametypes/Dynamicmatch.cc
r10916 r10917 405 405 void Dynamicmatch::rewardPig() 406 406 { 407 for ( auto& mapEntry : this->playerParty_) //durch alle Spieler iterieren und alle piggys finden407 for (const auto& mapEntry : this->playerParty_) //durch alle Spieler iterieren und alle piggys finden 408 408 { 409 409 if (mapEntry.second==piggy)//Spieler mit der Pig-party frags++ … … 441 441 if (tutorial) // Announce selectionphase 442 442 { 443 for ( auto& mapEntry : this->playerParty_)443 for (const auto& mapEntry : this->playerParty_) 444 444 { 445 445 if (!mapEntry.first)//in order to catch nullpointer … … 456 456 if(tutorial&&(!notEnoughKillers)&&(!notEnoughChasers)) //Selection phase over 457 457 { 458 for ( auto& mapEntry : this->playerParty_)458 for (const auto& mapEntry : this->playerParty_) 459 459 { 460 460 if (!mapEntry.first)//in order to catch nullpointer … … 490 490 if (tutorial) // Announce selectionphase 491 491 { 492 for ( auto& mapEntry : this->playerParty_)492 for (const auto& mapEntry : this->playerParty_) 493 493 { 494 494 if (!mapEntry.first)//in order to catch nullpointer … … 505 505 if(tutorial&&(!notEnoughPigs)&&(!notEnoughChasers)) //Selection phase over 506 506 { 507 for ( auto& mapEntry : this->playerParty_)507 for (const auto& mapEntry : this->playerParty_) 508 508 { 509 509 if (!mapEntry.first) … … 540 540 if (tutorial) // Announce selectionphase 541 541 { 542 for ( auto& mapEntry : this->playerParty_)542 for (const auto& mapEntry : this->playerParty_) 543 543 { 544 544 if (!mapEntry.first)//in order to catch nullpointer … … 555 555 if(tutorial&&(!notEnoughPigs)&&(!notEnoughKillers)) //Selection phase over 556 556 { 557 for ( auto& mapEntry : this->playerParty_)557 for (const auto& mapEntry : this->playerParty_) 558 558 { 559 559 if (!mapEntry.first) … … 620 620 else if(tutorial) // Announce selectionphase 621 621 { 622 for ( auto& mapEntry : this->playerParty_)622 for (const auto& mapEntry : this->playerParty_) 623 623 { 624 624 if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN) -
code/branches/cpp11_v2/src/orxonox/gametypes/Gametype.cc
r10916 r10917 139 139 if (!this->gtinfo_->hasStarted()) 140 140 { 141 for ( auto& mapEntry : this->players_)141 for (const auto& mapEntry : this->players_) 142 142 { 143 143 // Inform the GametypeInfo that the player is ready to spawn. … … 169 169 } 170 170 171 for ( auto& mapEntry : this->players_)171 for (const auto& mapEntry : this->players_) 172 172 { 173 173 if (mapEntry.first->getControllableEntity()) … … 404 404 bool allplayersready = true; 405 405 bool hashumanplayers = false; 406 for ( auto& mapEntry : this->players_)406 for (const auto& mapEntry : this->players_) 407 407 { 408 408 if (!mapEntry.first->isReadyToSpawn()) … … 430 430 void Gametype::spawnPlayersIfRequested() 431 431 { 432 for ( auto& mapEntry : this->players_)432 for (const auto& mapEntry : this->players_) 433 433 { 434 434 if (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_) … … 439 439 void Gametype::spawnDeadPlayersIfRequested() 440 440 { 441 for ( auto& mapEntry : this->players_)441 for (const auto& mapEntry : this->players_) 442 442 if (mapEntry.second.state_ == PlayerState::Dead) 443 443 if (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_) … … 538 538 GSLevelMementoState* Gametype::exportMementoState() 539 539 { 540 for ( auto& mapEntry : this->players_)540 for (const auto& mapEntry : this->players_) 541 541 { 542 542 if (mapEntry.first->isHumanPlayer() && mapEntry.first->getControllableEntity() && mapEntry.first->getControllableEntity()->getCamera()) … … 587 587 588 588 // find correct player and assign default entity with original position & orientation 589 for ( auto& mapEntry : this->players_)589 for (const auto& mapEntry : this->players_) 590 590 { 591 591 if (mapEntry.first->isHumanPlayer()) -
code/branches/cpp11_v2/src/orxonox/gametypes/LastManStanding.cc
r10916 r10917 56 56 void LastManStanding::spawnDeadPlayersIfRequested() 57 57 { 58 for ( auto& mapEntry : this->players_)58 for (const auto& mapEntry : this->players_) 59 59 if (mapEntry.second.state_ == PlayerState::Dead) 60 60 { … … 114 114 { 115 115 int min=lives; 116 for ( auto& mapEntry : this->playerLives_)116 for (const auto& mapEntry : this->playerLives_) 117 117 { 118 118 if (mapEntry.second<=0) … … 128 128 Gametype::end(); 129 129 130 for ( auto& mapEntry : this->playerLives_)130 for (const auto& mapEntry : this->playerLives_) 131 131 { 132 132 if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN) -
code/branches/cpp11_v2/src/orxonox/gametypes/LastTeamStanding.cc
r10916 r10917 145 145 void LastTeamStanding::spawnDeadPlayersIfRequested() 146 146 { 147 for ( auto& mapEntry : this->players_)147 for (const auto& mapEntry : this->players_) 148 148 if (mapEntry.second.state_ == PlayerState::Dead) 149 149 { … … 229 229 int party = -1; 230 230 //find a player who survived 231 for ( auto& mapEntry : this->playerLives_)231 for (const auto& mapEntry : this->playerLives_) 232 232 { 233 233 if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN) … … 255 255 { 256 256 int min = lives; 257 for ( auto& mapEntry : this->playerLives_)257 for (const auto& mapEntry : this->playerLives_) 258 258 { 259 259 if (mapEntry.second <= 0) -
code/branches/cpp11_v2/src/orxonox/gametypes/TeamBaseMatch.cc
r10916 r10917 187 187 } 188 188 189 for ( auto& mapEntry : this->teamnumbers_)189 for (const auto& mapEntry : this->teamnumbers_) 190 190 { 191 191 if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN) -
code/branches/cpp11_v2/src/orxonox/gametypes/TeamDeathmatch.cc
r10916 r10917 69 69 int winnerTeam = 0; 70 70 int highestScore = 0; 71 for ( auto& mapEntry : this->players_)71 for (const auto& mapEntry : this->players_) 72 72 { 73 73 if ( this->getTeamScore(mapEntry.first) > highestScore ) -
code/branches/cpp11_v2/src/orxonox/gametypes/TeamGametype.cc
r10916 r10917 99 99 std::vector<unsigned int> playersperteam(this->teams_, 0); 100 100 101 for ( auto& mapEntry : this->teamnumbers_)101 for (const auto& mapEntry : this->teamnumbers_) 102 102 if (mapEntry.second < static_cast<int>(this->teams_) && mapEntry.second >= 0) 103 103 playersperteam[mapEntry.second]++; … … 141 141 void TeamGametype::spawnDeadPlayersIfRequested() 142 142 { 143 for ( auto& mapEntry : this->players_)\143 for (const auto& mapEntry : this->players_)\ 144 144 { 145 145 if(allowedInGame_[mapEntry.first] == false)//check if dead player is allowed to enter … … 178 178 if(!player || this->getTeam(player) == -1) 179 179 return 0; 180 for ( auto& mapEntry : this->players_)180 for (const auto& mapEntry : this->players_) 181 181 { 182 182 if ( this->getTeam(mapEntry.first) == this->getTeam(player) ) … … 191 191 { 192 192 int teamSize = 0; 193 for ( auto& mapEntry : this->teamnumbers_)193 for (const auto& mapEntry : this->teamnumbers_) 194 194 { 195 195 if (mapEntry.second == team) … … 202 202 { 203 203 int teamSize = 0; 204 for ( auto& mapEntry : this->teamnumbers_)204 for (const auto& mapEntry : this->teamnumbers_) 205 205 { 206 206 if (mapEntry.second == team && mapEntry.first->isHumanPlayer()) … … 376 376 void TeamGametype::announceTeamWin(int winnerTeam) 377 377 { 378 for ( auto& mapEntry : this->teamnumbers_)378 for (const auto& mapEntry : this->teamnumbers_) 379 379 { 380 380 if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN) -
code/branches/cpp11_v2/src/orxonox/gametypes/UnderAttack.cc
r10916 r10917 74 74 this->gameEnded_ = true; 75 75 76 for ( auto& mapEntry : this->teamnumbers_)76 for (const auto& mapEntry : this->teamnumbers_) 77 77 { 78 78 if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN) … … 155 155 ChatManager::message(message); 156 156 157 for ( auto& mapEntry : this->teamnumbers_)157 for (const auto& mapEntry : this->teamnumbers_) 158 158 { 159 159 if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN) -
code/branches/cpp11_v2/src/orxonox/weaponsystem/Munition.cc
r10916 r10917 55 55 Munition::~Munition() 56 56 { 57 for ( auto& mapEntry : this->currentMagazines_)57 for (const auto& mapEntry : this->currentMagazines_) 58 58 delete mapEntry.second; 59 59 } … … 316 316 { 317 317 bool change = false; 318 for ( auto& mapEntry : this->currentMagazines_)318 for (const auto& mapEntry : this->currentMagazines_) 319 319 { 320 320 // Add munition if the magazine isn't full (but only to loaded magazines) -
code/branches/cpp11_v2/src/orxonox/weaponsystem/Weapon.cc
r10916 r10917 61 61 this->weaponPack_->removeWeapon(this); 62 62 63 for ( auto& mapEntry : this->weaponmodes_)63 for (const auto& mapEntry : this->weaponmodes_) 64 64 mapEntry.second->destroy(); 65 65 } … … 136 136 void Weapon::reload() 137 137 { 138 for ( auto& mapEntry : this->weaponmodes_)138 for (const auto& mapEntry : this->weaponmodes_) 139 139 mapEntry.second->reload(); 140 140 } … … 148 148 void Weapon::notifyWeaponModes() 149 149 { 150 for ( auto& mapEntry : this->weaponmodes_)150 for (const auto& mapEntry : this->weaponmodes_) 151 151 mapEntry.second->setWeapon(this); 152 152 } -
code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponSet.cc
r10916 r10917 63 63 { 64 64 // Fire all WeaponPacks with their defined weaponmode 65 for ( auto& mapEntry : this->weaponpacks_)65 for (const auto& mapEntry : this->weaponpacks_) 66 66 if (mapEntry.second != WeaponSystem::WEAPON_MODE_UNASSIGNED) 67 67 mapEntry.first->fire(mapEntry.second); … … 71 71 { 72 72 // Reload all WeaponPacks with their defined weaponmode 73 for ( auto& mapEntry : this->weaponpacks_)73 for (const auto& mapEntry : this->weaponpacks_) 74 74 mapEntry.first->reload(); 75 75 } -
code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponSystem.cc
r10916 r10917 196 196 197 197 // Assign the desired weaponmode to the firemodes 198 for ( auto& mapEntry : this->weaponSets_)198 for (const auto& mapEntry : this->weaponSets_) 199 199 { 200 200 unsigned int weaponmode = wPack->getDesiredWeaponmode(mapEntry.first); … … 219 219 220 220 // Remove all added links from the WeaponSets 221 for ( auto& mapEntry : this->weaponSets_)221 for (const auto& mapEntry : this->weaponSets_) 222 222 mapEntry.second->removeWeaponmodeLink(wPack); 223 223 … … 268 268 // Check if the WeaponSet belongs to this WeaponSystem 269 269 bool foundWeaponSet = false; 270 for ( auto& mapEntry : this->weaponSets_)270 for (const auto& mapEntry : this->weaponSets_) 271 271 { 272 272 if (mapEntry.second == wSet) … … 296 296 void WeaponSystem::reload() 297 297 { 298 for ( auto& mapEntry : this->weaponSets_)298 for (const auto& mapEntry : this->weaponSets_) 299 299 mapEntry.second->reload(); 300 300 }
Note: See TracChangeset
for help on using the changeset viewer.