Changeset 10916 for code/branches/cpp11_v2/src/modules
- Timestamp:
- Dec 2, 2015, 11:22:03 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/modules
- Files:
-
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/modules/docking/Dock.cc
r10821 r10916 327 327 const DockingEffect* Dock::getEffect(unsigned int i) const 328 328 { 329 for ( const auto & elem: this->effects_)329 for (DockingEffect* effect : this->effects_) 330 330 { 331 331 if(i == 0) 332 return e lem;332 return effect; 333 333 i--; 334 334 } … … 346 346 const DockingAnimation* Dock::getAnimation(unsigned int i) const 347 347 { 348 for ( const auto & elem: this->animations_)348 for (DockingAnimation* animation : this->animations_) 349 349 { 350 350 if(i == 0) 351 return elem;351 return animation; 352 352 i--; 353 353 } -
code/branches/cpp11_v2/src/modules/docking/DockingAnimation.cc
r10821 r10916 57 57 bool check = true; 58 58 59 for ( auto & animations_animation : animations)59 for (DockingAnimation* animation : animations) 60 60 { 61 61 if(dock) 62 check &= (animations_animation)->docking(player);62 check &= animation->docking(player); 63 63 else 64 check &= (animations_animation)->release(player);64 check &= animation->release(player); 65 65 } 66 66 -
code/branches/cpp11_v2/src/modules/docking/DockingEffect.cc
r10821 r10916 53 53 bool check = true; 54 54 55 for ( auto & effects_effect : effects)55 for (DockingEffect* effect : effects) 56 56 { 57 57 if (dock) 58 check &= (effects_effect)->docking(player);58 check &= effect->docking(player); 59 59 else 60 check &= (effects_effect)->release(player);60 check &= effect->release(player); 61 61 } 62 62 -
code/branches/cpp11_v2/src/modules/gametypes/RaceCheckPoint.cc
r10821 r10916 146 146 { 147 147 Vector3 checkpoints(-1,-1,-1); int count=0; 148 for ( const auto & elem: nextCheckpoints_)148 for (int nextCheckpoint : nextCheckpoints_) 149 149 { 150 150 switch (count) 151 151 { 152 case 0: checkpoints.x = static_cast<Ogre::Real>( elem); break;153 case 1: checkpoints.y = static_cast<Ogre::Real>( elem); break;154 case 2: checkpoints.z = static_cast<Ogre::Real>( elem); break;152 case 0: checkpoints.x = static_cast<Ogre::Real>(nextCheckpoint); break; 153 case 1: checkpoints.y = static_cast<Ogre::Real>(nextCheckpoint); break; 154 case 2: checkpoints.z = static_cast<Ogre::Real>(nextCheckpoint); break; 155 155 } 156 156 ++count; -
code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceController.cc
r10821 r10916 154 154 { 155 155 std::map<RaceCheckPoint*, int> zaehler; // counts how many times the checkpoint was reached (for simulation) 156 for ( auto & allCheckpoint : allCheckpoints)157 { 158 zaehler.insert(std::pair<RaceCheckPoint*, int>( allCheckpoint,0));156 for (RaceCheckPoint* checkpoint : allCheckpoints) 157 { 158 zaehler.insert(std::pair<RaceCheckPoint*, int>(checkpoint,0)); 159 159 } 160 160 int maxWays = rekSimulationCheckpointsReached(currentCheckpoint, zaehler); 161 161 162 162 std::vector<RaceCheckPoint*> returnVec; 163 for (auto & elem: zaehler)164 { 165 if ( elem.second == maxWays)166 { 167 returnVec.push_back( elem.first);163 for (auto& mapEntry : zaehler) 164 { 165 if (mapEntry.second == maxWays) 166 { 167 returnVec.push_back(mapEntry.first); 168 168 } 169 169 } … … 226 226 227 227 // find the next checkpoint with the minimal distance 228 for ( auto elem: raceCheckpoint->getNextCheckpoints())229 { 230 RaceCheckPoint* nextRaceCheckPoint = findCheckpoint( elem);228 for (int checkpointIndex : raceCheckpoint->getNextCheckpoints()) 229 { 230 RaceCheckPoint* nextRaceCheckPoint = findCheckpoint(checkpointIndex); 231 231 float distance = recCalculateDistance(nextRaceCheckPoint, this->getControllableEntity()->getPosition()); 232 232 … … 289 289 RaceCheckPoint* SpaceRaceController::findCheckpoint(int index) const 290 290 { 291 for ( auto & elem: this->checkpoints_)292 if ( elem->getCheckpointIndex() == index)293 return elem;291 for (RaceCheckPoint* checkpoint : this->checkpoints_) 292 if (checkpoint->getCheckpointIndex() == index) 293 return checkpoint; 294 294 return nullptr; 295 295 } … … 414 414 btScalar radiusObject; 415 415 416 for ( const auto & allObject : allObjects)417 { 418 for (int everyShape=0; (allObject)->getAttachedCollisionShape(everyShape) != nullptr; everyShape++)419 { 420 btCollisionShape* currentShape = (allObject)->getAttachedCollisionShape(everyShape)->getCollisionShape();416 for (StaticEntity* object : allObjects) 417 { 418 for (int everyShape=0; object->getAttachedCollisionShape(everyShape) != nullptr; everyShape++) 419 { 420 btCollisionShape* currentShape = object->getAttachedCollisionShape(everyShape)->getCollisionShape(); 421 421 if(currentShape == nullptr) 422 422 continue; -
code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceManager.cc
r10821 r10916 54 54 SpaceRaceManager::~SpaceRaceManager() 55 55 { 56 for ( auto & elem: this->checkpoints_)57 elem->destroy();56 for (RaceCheckPoint* checkpoint : this->checkpoints_) 57 checkpoint->destroy(); 58 58 } 59 59 … … 77 77 } 78 78 79 for (auto & elem: players_)79 for (auto& mapEntry : players_) 80 80 { 81 81 82 for ( auto & _i: this->checkpoints_)82 for (RaceCheckPoint* checkpoint : this->checkpoints_) 83 83 { 84 if ( _i->playerWasHere(elem.first)){85 this->checkpointReached( _i, elem.first /*this->checkpoints_[i]->getPlayer()*/);84 if (checkpoint->playerWasHere(mapEntry.first)){ 85 this->checkpointReached(checkpoint, mapEntry.first /*this->checkpoints_[i]->getPlayer()*/); 86 86 } 87 87 } … … 113 113 RaceCheckPoint* SpaceRaceManager::findCheckpoint(int index) const 114 114 { 115 for ( auto & elem: this->checkpoints_)116 if ( elem->getCheckpointIndex() == index)117 return elem;115 for (RaceCheckPoint* checkpoint : this->checkpoints_) 116 if (checkpoint->getCheckpointIndex() == index) 117 return checkpoint; 118 118 return nullptr; 119 119 } … … 125 125 // the player already visited an old checkpoint; see which checkpoints are possible now 126 126 const std::set<int>& possibleCheckpoints = oldCheckpoint->getNextCheckpoints(); 127 for ( const auto &possibleCheckpoint : possibleCheckpoints)127 for (int possibleCheckpoint : possibleCheckpoints) 128 128 if (this->findCheckpoint(possibleCheckpoint) == newCheckpoint) 129 129 return true; … … 179 179 { 180 180 const std::set<int>& oldVisible = oldCheckpoint->getNextCheckpoints(); 181 for ( const auto & elem: oldVisible)182 this->findCheckpoint( elem)->setRadarVisibility(false);181 for (int checkpointIndex : oldVisible) 182 this->findCheckpoint(checkpointIndex)->setRadarVisibility(false); 183 183 } 184 184 … … 188 188 189 189 const std::set<int>& newVisible = newCheckpoint->getNextCheckpoints(); 190 for ( const auto & elem: newVisible)191 this->findCheckpoint( elem)->setRadarVisibility(true);190 for (int checkpointIndex : newVisible) 191 this->findCheckpoint(checkpointIndex)->setRadarVisibility(true); 192 192 } 193 193 } -
code/branches/cpp11_v2/src/modules/jump/Jump.cc
r10821 r10916 633 633 634 634 635 for ( auto & elem : matrix)635 for (int i = 0; i < numI; ++i) 636 636 { 637 637 for (int j = 0; j < numJ; ++j) 638 638 { 639 elem[j].type = PLATFORM_EMPTY;640 elem[j].done = false;639 matrix[i][j].type = PLATFORM_EMPTY; 640 matrix[i][j].done = false; 641 641 } 642 642 } … … 795 795 796 796 // Fill matrix with selected platform types 797 for ( auto & elem : matrix)797 for (int i = 0; i < numI; ++ i) 798 798 { 799 799 for (int j = 0; j < numJ; ++ j) … … 801 801 if (rand()%3 == 0) 802 802 { 803 elem[j].type = platformtype1;803 matrix[i][j].type = platformtype1; 804 804 } 805 805 else 806 806 { 807 elem[j].type = platformtype2;807 matrix[i][j].type = platformtype2; 808 808 } 809 elem[j].done = false;809 matrix[i][j].done = false; 810 810 } 811 811 } -
code/branches/cpp11_v2/src/modules/mini4dgame/Mini4Dgame.cc
r10821 r10916 155 155 { 156 156 // first spawn human players to assign always the left bat to the player in singleplayer 157 for (auto & elem: this->players_)158 if ( elem.first->isHumanPlayer() && (elem.first->isReadyToSpawn() || this->bForceSpawn_))159 this->spawnPlayer( elem.first);157 for (auto& mapEntry : this->players_) 158 if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_)) 159 this->spawnPlayer(mapEntry.first); 160 160 // now spawn bots 161 for (auto & elem: this->players_)162 if (! elem.first->isHumanPlayer() && (elem.first->isReadyToSpawn() || this->bForceSpawn_))163 this->spawnPlayer( elem.first);161 for (auto& mapEntry : this->players_) 162 if (!mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_)) 163 this->spawnPlayer(mapEntry.first); 164 164 } 165 165 -
code/branches/cpp11_v2/src/modules/notifications/NotificationManager.cc
r10821 r10916 69 69 { 70 70 // Destroys all Notifications. 71 for(auto & elem: this->allNotificationsList_)72 elem.second->destroy();71 for(auto& mapEntry : this->allNotificationsList_) 72 mapEntry.second->destroy(); 73 73 this->allNotificationsList_.clear(); 74 74 … … 152 152 bool executed = false; 153 153 // Clear all NotificationQueues that have the input sender as target. 154 for(auto & elem: this->queues_) // Iterate through all NotificationQueues.155 { 156 const std::set<std::string>& set = elem.second->getTargetsSet();154 for(auto& mapEntry : this->queues_) // Iterate through all NotificationQueues. 155 { 156 const std::set<std::string>& set = mapEntry.second->getTargetsSet(); 157 157 // If either the sender is 'all', the NotificationQueue has as target all or the NotificationQueue has the input sender as a target. 158 158 if(all || set.find(NotificationListener::ALL) != set.end() || set.find(sender) != set.end()) 159 executed = elem.second->tidy() || executed;159 executed = mapEntry.second->tidy() || executed; 160 160 } 161 161 … … 187 187 188 188 // Insert the Notification in all NotificationQueues that have its sender as target. 189 for(auto & elem: this->queues_) // Iterate through all NotificationQueues.190 { 191 const std::set<std::string>& set = elem.second->getTargetsSet();189 for(auto& mapEntry : this->queues_) // Iterate through all NotificationQueues. 190 { 191 const std::set<std::string>& set = mapEntry.second->getTargetsSet(); 192 192 bool bAll = set.find(NotificationListener::ALL) != set.end(); 193 193 // If either the Notification has as sender 'all', the NotificationQueue displays all Notifications or the NotificationQueue has the sender of the Notification as target. … … 195 195 { 196 196 if(!bAll) 197 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.198 elem.second->update(notification, time); // Update the NotificationQueue.197 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. 198 mapEntry.second->update(notification, time); // Update the NotificationQueue. 199 199 } 200 200 } … … 345 345 346 346 // Iterate through all Notifications to determine whether any of them should belong to the newly registered NotificationQueue. 347 for(auto & elem: this->allNotificationsList_)348 { 349 if(!bAll && set.find( elem.second->getSender()) != set.end()) // Checks whether the listener has the sender of the current Notification as target.350 map->insert(std::pair<std::time_t, Notification*>( elem.first, elem.second));347 for(auto& mapEntry : this->allNotificationsList_) 348 { 349 if(!bAll && set.find(mapEntry.second->getSender()) != set.end()) // Checks whether the listener has the sender of the current Notification as target. 350 map->insert(std::pair<std::time_t, Notification*>(mapEntry.first, mapEntry.second)); 351 351 } 352 352 -
code/branches/cpp11_v2/src/modules/notifications/NotificationQueue.cc
r10821 r10916 206 206 { 207 207 // Add all Notifications that have been created after this NotificationQueue was created. 208 for(auto & notification: *notifications)208 for(auto& mapEntry : *notifications) 209 209 { 210 if( notification.first >= this->creationTime_)211 this->push( notification.second, notification.first);210 if(mapEntry.first >= this->creationTime_) 211 this->push(mapEntry.second, mapEntry.first); 212 212 } 213 213 } … … 336 336 this->ordering_.clear(); 337 337 // Delete all NotificationContainers in the list. 338 for( auto & elem: this->notifications_)339 delete elem;338 for(NotificationContainer* notification : this->notifications_) 339 delete notification; 340 340 341 341 this->notifications_.clear(); … … 426 426 bool first = true; 427 427 // Iterate through the set of targets. 428 for(const auto & elem: this->targets_)428 for(const std::string& target : this->targets_) 429 429 { 430 430 if(!first) … … 432 432 else 433 433 first = false; 434 stream << elem;434 stream << target; 435 435 } 436 436 -
code/branches/cpp11_v2/src/modules/objects/Attacher.cc
r10821 r10916 61 61 SUPER(Attacher, changedActivity); 62 62 63 for ( auto & elem: this->objects_)64 (elem)->setActive(this->isActive());63 for (WorldEntity* object : this->objects_) 64 object->setActive(this->isActive()); 65 65 } 66 66 … … 69 69 SUPER(Attacher, changedVisibility); 70 70 71 for ( auto & elem: this->objects_)72 (elem)->setVisible(this->isVisible());71 for (WorldEntity* object : this->objects_) 72 object->setVisible(this->isVisible()); 73 73 } 74 74 … … 83 83 { 84 84 unsigned int i = 0; 85 for ( const auto & elem: this->objects_)85 for (WorldEntity* object : this->objects_) 86 86 { 87 87 if (i == index) 88 return (elem);88 return object; 89 89 90 90 ++i; -
code/branches/cpp11_v2/src/modules/objects/Script.cc
r10821 r10916 196 196 { 197 197 const std::map<unsigned int, PlayerInfo*> clients = PlayerManager::getInstance().getClients(); 198 for(const auto & client: clients)198 for(const auto& mapEntry : clients) 199 199 { 200 callStaticNetworkFunction(&Script::executeHelper, client.first, this->getCode(), this->getMode(), this->getNeedsGraphics());200 callStaticNetworkFunction(&Script::executeHelper, mapEntry.first, this->getCode(), this->getMode(), this->getNeedsGraphics()); 201 201 if(this->times_ != Script::INF) // Decrement the number of remaining executions. 202 202 { -
code/branches/cpp11_v2/src/modules/objects/SpaceBoundaries.cc
r10821 r10916 59 59 this->pawnsIn_.clear(); 60 60 61 for( auto & elem: this->billboards_)61 for(BillboardAdministration& billboard : this->billboards_) 62 62 { 63 if( elem.billy != nullptr)64 { 65 delete elem.billy;63 if( billboard.billy != nullptr) 64 { 65 delete billboard.billy; 66 66 } 67 67 } … … 138 138 void SpaceBoundaries::removeAllBillboards() 139 139 { 140 for( auto & elem: this->billboards_)141 { 142 elem.usedYet = false;143 elem.billy->setVisible(false);140 for(BillboardAdministration& billboard : this->billboards_) 141 { 142 billboard.usedYet = false; 143 billboard.billy->setVisible(false); 144 144 } 145 145 } … … 208 208 float distance; 209 209 bool humanItem; 210 for(auto currentPawn : pawnsIn_) 211 { 212 210 for(Pawn* currentPawn : pawnsIn_) 211 { 213 212 if( currentPawn && currentPawn->getNode() ) 214 213 { -
code/branches/cpp11_v2/src/modules/objects/eventsystem/EventDispatcher.cc
r10821 r10916 45 45 { 46 46 if (this->isInitialized()) 47 for ( auto & elem: this->targets_)48 (elem)->destroy();47 for (BaseObject* target : this->targets_) 48 target->destroy(); 49 49 } 50 50 … … 61 61 void EventDispatcher::processEvent(Event& event) 62 62 { 63 for ( auto & elem: this->targets_)64 (elem)->processEvent(event);63 for (BaseObject* target : this->targets_) 64 target->processEvent(event); 65 65 } 66 66 … … 73 73 { 74 74 unsigned int i = 0; 75 for ( const auto & elem: this->targets_)75 for (BaseObject* target : this->targets_) 76 76 { 77 77 if (i == index) 78 return (elem);78 return target; 79 79 ++i; 80 80 } -
code/branches/cpp11_v2/src/modules/objects/eventsystem/EventFilter.cc
r10821 r10916 96 96 { 97 97 unsigned int i = 0; 98 for ( const auto & elem: this->sources_)98 for (BaseObject* source : this->sources_) 99 99 { 100 100 if (i == index) 101 return (elem);101 return source; 102 102 ++i; 103 103 } … … 113 113 { 114 114 unsigned int i = 0; 115 for ( const auto & elem: this->names_)115 for (EventName* name : this->names_) 116 116 { 117 117 if (i == index) 118 return (elem);118 return name; 119 119 ++i; 120 120 } -
code/branches/cpp11_v2/src/modules/objects/triggers/DistanceMultiTrigger.cc
r10821 r10916 158 158 { 159 159 160 const std::set<WorldEntity*> attached = entity->getAttachedObjects();160 const std::set<WorldEntity*> attachedObjects = entity->getAttachedObjects(); 161 161 bool found = false; 162 for( const auto & elem : attached)162 for(WorldEntity* attachedObject : attachedObjects) 163 163 { 164 if( (elem)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(elem)->getName() == this->targetName_)164 if(attachedObject->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(attachedObject)->getName() == this->targetName_) 165 165 { 166 166 found = true; -
code/branches/cpp11_v2/src/modules/objects/triggers/DistanceTrigger.cc
r10821 r10916 180 180 { 181 181 182 const std::set<WorldEntity*> attached = entity->getAttachedObjects();182 const std::set<WorldEntity*> attachedObjects = entity->getAttachedObjects(); 183 183 bool found = false; 184 for( const auto & elem : attached)184 for(WorldEntity* attachedObject : attachedObjects) 185 185 { 186 if( (elem)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(elem)->getName() == this->targetName_)186 if(attachedObject->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(attachedObject)->getName() == this->targetName_) 187 187 { 188 188 found = true; -
code/branches/cpp11_v2/src/modules/objects/triggers/MultiTrigger.cc
r10821 r10916 504 504 bool MultiTrigger::checkAnd(BaseObject* triggerer) 505 505 { 506 for(auto trigger : this->children_) 507 { 508 506 for(TriggerBase* trigger : this->children_) 507 { 509 508 if(trigger->isMultiTrigger()) 510 509 { … … 531 530 bool MultiTrigger::checkOr(BaseObject* triggerer) 532 531 { 533 for(auto trigger : this->children_) 534 { 535 532 for(TriggerBase* trigger : this->children_) 533 { 536 534 if(trigger->isMultiTrigger()) 537 535 { … … 559 557 { 560 558 bool triggered = false; 561 for(auto trigger : this->children_) 562 { 563 559 for(TriggerBase* trigger : this->children_) 560 { 564 561 if(triggered) 565 562 { -
code/branches/cpp11_v2/src/modules/objects/triggers/Trigger.cc
r10821 r10916 234 234 { 235 235 // Iterate over all sub-triggers. 236 for ( const auto & elem: this->children_)237 { 238 if (! (elem)->isActive())236 for (TriggerBase* child : this->children_) 237 { 238 if (!child->isActive()) 239 239 return false; 240 240 } … … 252 252 { 253 253 // Iterate over all sub-triggers. 254 for ( const auto & elem: this->children_)255 { 256 if ( (elem)->isActive())254 for (TriggerBase* child : this->children_) 255 { 256 if (child->isActive()) 257 257 return true; 258 258 } … … 270 270 { 271 271 bool test = false; 272 for ( const auto & elem: this->children_)273 { 274 if (test && (elem)->isActive())272 for (TriggerBase* child : this->children_) 273 { 274 if (test && child->isActive()) 275 275 return false; 276 if ( (elem)->isActive())276 if (child->isActive()) 277 277 test = true; 278 278 } -
code/branches/cpp11_v2/src/modules/overlays/hud/ChatOverlay.cc
r10821 r10916 58 58 ChatOverlay::~ChatOverlay() 59 59 { 60 for ( const auto & elem: this->timers_)61 delete (elem);60 for (Timer* timer : this->timers_) 61 delete timer; 62 62 } 63 63 … … 92 92 this->text_->setCaption(""); 93 93 94 for ( auto & elem: this->messages_)94 for (const Ogre::DisplayString& message : this->messages_) 95 95 { 96 this->text_->setCaption(this->text_->getCaption() + "\n" + (elem));96 this->text_->setCaption(this->text_->getCaption() + "\n" + message); 97 97 } 98 98 } -
code/branches/cpp11_v2/src/modules/overlays/hud/HUDNavigation.cc
r10821 r10916 131 131 } 132 132 this->fontName_ = font; 133 for (auto & elem: this->activeObjectList_)134 { 135 if ( elem.second.text_ != nullptr)136 elem.second.text_->setFontName(this->fontName_);133 for (auto& mapEntry : this->activeObjectList_) 134 { 135 if (mapEntry.second.text_ != nullptr) 136 mapEntry.second.text_->setFontName(this->fontName_); 137 137 } 138 138 } … … 151 151 } 152 152 this->textSize_ = size; 153 for (auto & elem: this->activeObjectList_)154 { 155 if ( elem.second.text_)156 elem.second.text_->setCharHeight(size);153 for (auto& mapEntry : this->activeObjectList_) 154 { 155 if (mapEntry.second.text_) 156 mapEntry.second.text_->setCharHeight(size); 157 157 } 158 158 } … … 186 186 const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix(); 187 187 188 for ( auto & elem: this->sortedObjectList_)189 elem.second = (int)((elem.first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f);188 for (std::pair<RadarViewable*, unsigned int>& pair : this->sortedObjectList_) 189 pair.second = (int)((pair.first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f); 190 190 191 191 this->sortedObjectList_.sort(compareDistance); … … 531 531 float yScale = this->getActualSize().y; 532 532 533 for (auto & elem: this->activeObjectList_)534 { 535 if ( elem.second.health_ != nullptr)536 elem.second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);537 if ( elem.second.healthLevel_ != nullptr)538 elem.second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);539 if ( elem.second.panel_ != nullptr)540 elem.second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);541 if ( elem.second.text_ != nullptr)542 elem.second.text_->setCharHeight(this->textSize_ * yScale);543 if ( elem.second.target_ != nullptr)544 elem.second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale);533 for (auto& mapEntry : this->activeObjectList_) 534 { 535 if (mapEntry.second.health_ != nullptr) 536 mapEntry.second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale); 537 if (mapEntry.second.healthLevel_ != nullptr) 538 mapEntry.second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale); 539 if (mapEntry.second.panel_ != nullptr) 540 mapEntry.second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale); 541 if (mapEntry.second.text_ != nullptr) 542 mapEntry.second.text_->setCharHeight(this->textSize_ * yScale); 543 if (mapEntry.second.target_ != nullptr) 544 mapEntry.second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale); 545 545 } 546 546 } … … 670 670 { 671 671 const std::set<RadarViewable*>& respawnObjects = this->getOwner()->getScene()->getRadar()->getRadarObjects(); 672 for ( const auto &respawnObject : respawnObjects)673 { 674 if (! (respawnObject)->isHumanShip_)672 for (RadarViewable* respawnObject : respawnObjects) 673 { 674 if (!respawnObject->isHumanShip_) 675 675 this->addObject(respawnObject); 676 676 } -
code/branches/cpp11_v2/src/modules/overlays/hud/HUDRadar.cc
r10821 r10916 92 92 Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->map3DBack_); 93 93 94 for (auto & elem: this->radarObjects_)95 { 96 Ogre::OverlayManager::getSingleton().destroyOverlayElement( elem.second);94 for (auto& mapEntry : this->radarObjects_) 95 { 96 Ogre::OverlayManager::getSingleton().destroyOverlayElement(mapEntry.second); 97 97 } 98 98 } -
code/branches/cpp11_v2/src/modules/overlays/stats/Scoreboard.cc
r10821 r10916 60 60 SUPER(Scoreboard, changedVisibility); 61 61 62 for ( auto & elem: this->lines_)63 elem->changedVisibility();62 for (CreateLines* line : this->lines_) 63 line->changedVisibility(); 64 64 } 65 65 … … 94 94 95 95 unsigned int index = 0; 96 for (const auto & elem: playerList)96 for (const auto& mapEntry : playerList) 97 97 { 98 this->lines_[index]->setPlayerName(multi_cast<std::string>( elem.first->getName()));99 this->lines_[index]->setScore(multi_cast<std::string>( elem.second.frags_));100 this->lines_[index]->setDeaths(multi_cast<std::string>( elem.second.killed_));98 this->lines_[index]->setPlayerName(multi_cast<std::string>(mapEntry.first->getName())); 99 this->lines_[index]->setScore(multi_cast<std::string>(mapEntry.second.frags_)); 100 this->lines_[index]->setDeaths(multi_cast<std::string>(mapEntry.second.killed_)); 101 101 index++; 102 102 } -
code/branches/cpp11_v2/src/modules/pickup/PickupCollection.cc
r10821 r10916 68 68 { 69 69 // Destroy all Pickupables constructing this PickupCollection. 70 for( auto & elem: this->pickups_)71 { 72 (elem)->wasRemovedFromCollection();73 (elem)->destroy();70 for(CollectiblePickup* pickup : this->pickups_) 71 { 72 pickup->wasRemovedFromCollection(); 73 pickup->destroy(); 74 74 } 75 75 this->pickups_.clear(); … … 99 99 this->processingUsed_ = true; 100 100 // Change used for all Pickupables this PickupCollection consists of. 101 for( auto & elem: this->pickups_)102 (elem)->setUsed(this->isUsed());101 for(CollectiblePickup* pickup : this->pickups_) 102 pickup->setUsed(this->isUsed()); 103 103 104 104 this->processingUsed_ = false; … … 119 119 size_t numPickupsEnabled = 0; 120 120 size_t numPickupsInUse = 0; 121 for( auto & elem: this->pickups_)122 { 123 if ( (elem)->isEnabled())121 for(CollectiblePickup* pickup : this->pickups_) 122 { 123 if (pickup->isEnabled()) 124 124 ++numPickupsEnabled; 125 if ( (elem)->isUsed())125 if (pickup->isUsed()) 126 126 ++numPickupsInUse; 127 127 } … … 146 146 147 147 // Change the PickupCarrier for all Pickupables this PickupCollection consists of. 148 for( auto & elem: this->pickups_)148 for(CollectiblePickup* pickup : this->pickups_) 149 149 { 150 150 if(this->getCarrier() == nullptr) 151 (elem)->setCarrier(nullptr);151 pickup->setCarrier(nullptr); 152 152 else 153 (elem)->setCarrier(this->getCarrier()->getTarget(elem));153 pickup->setCarrier(this->getCarrier()->getTarget(pickup)); 154 154 } 155 155 } … … 186 186 // If at least all the enabled pickups of this PickupCollection are no longer picked up. 187 187 bool isOnePickupEnabledAndPickedUp = false; 188 for( auto & elem: this->pickups_)189 { 190 if ( (elem)->isEnabled() && (elem)->isPickedUp())188 for(CollectiblePickup* pickup : this->pickups_) 189 { 190 if (pickup->isEnabled() && pickup->isPickedUp()) 191 191 { 192 192 isOnePickupEnabledAndPickedUp = true; … … 208 208 bool PickupCollection::isTarget(const PickupCarrier* carrier) const 209 209 { 210 for( const auto & elem: this->pickups_)211 { 212 if(!carrier->isTarget( elem))210 for(CollectiblePickup* pickup : this->pickups_) 211 { 212 if(!carrier->isTarget(pickup)) 213 213 return false; 214 214 } -
code/branches/cpp11_v2/src/modules/pickup/PickupManager.cc
r10821 r10916 91 91 92 92 // Destroying all the PickupInventoryContainers that are still there. 93 for(auto & elem: this->pickupInventoryContainers_)94 delete elem.second;93 for(auto& mapEntry : this->pickupInventoryContainers_) 94 delete mapEntry.second; 95 95 this->pickupInventoryContainers_.clear(); 96 96 -
code/branches/cpp11_v2/src/modules/pickup/items/MetaPickup.cc
r10821 r10916 118 118 std::set<Pickupable*> pickups = carrier->getPickups(); 119 119 // Iterate over all Pickupables of the PickupCarrier. 120 for( autopickup : pickups)120 for(Pickupable* pickup : pickups) 121 121 { 122 123 122 if(pickup == nullptr || pickup == this) 124 123 continue; -
code/branches/cpp11_v2/src/modules/pong/Pong.cc
r10821 r10916 145 145 146 146 // If one of the bats is missing, create it. Apply the template for the bats as specified in the centerpoint. 147 for ( auto & elem: this->bat_)147 for (WeakPtr<orxonox::PongBat>& bat : this->bat_) 148 148 { 149 if ( elem== nullptr)149 if (bat == nullptr) 150 150 { 151 elem= new PongBat(this->center_->getContext());152 elem->addTemplate(this->center_->getBattemplate());151 bat = new PongBat(this->center_->getContext()); 152 bat->addTemplate(this->center_->getBattemplate()); 153 153 } 154 154 } … … 211 211 { 212 212 // first spawn human players to assign always the left bat to the player in singleplayer 213 for (auto & elem: this->players_)214 if ( elem.first->isHumanPlayer() && (elem.first->isReadyToSpawn() || this->bForceSpawn_))215 this->spawnPlayer( elem.first);213 for (auto& mapEntry : this->players_) 214 if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_)) 215 this->spawnPlayer(mapEntry.first); 216 216 // now spawn bots 217 for (auto & elem: this->players_)218 if (! elem.first->isHumanPlayer() && (elem.first->isReadyToSpawn() || this->bForceSpawn_))219 this->spawnPlayer( elem.first);217 for (auto& mapEntry : this->players_) 218 if (!mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_)) 219 this->spawnPlayer(mapEntry.first); 220 220 } 221 221 -
code/branches/cpp11_v2/src/modules/pong/PongAI.cc
r10821 r10916 77 77 PongAI::~PongAI() 78 78 { 79 for ( auto & elem: this->reactionTimers_)80 elem.first->destroy();79 for (std::pair<Timer*, char>& pair : this->reactionTimers_) 80 pair.first->destroy(); 81 81 } 82 82 -
code/branches/cpp11_v2/src/modules/questsystem/GlobalQuest.cc
r10821 r10916 94 94 95 95 // Iterate through all players possessing this Quest. 96 for( const auto & elem: players_)97 QuestEffect::invokeEffects( elem, this->getFailEffectList());96 for(PlayerInfo* questPlayer : players_) 97 QuestEffect::invokeEffects(questPlayer, this->getFailEffectList()); 98 98 99 99 return true; … … 119 119 120 120 // Iterate through all players possessing the Quest. 121 for( const auto & elem: players_)122 QuestEffect::invokeEffects( elem, this->getCompleteEffectList());121 for(PlayerInfo* questPlayer : players_) 122 QuestEffect::invokeEffects(questPlayer, this->getCompleteEffectList()); 123 123 124 124 Quest::complete(player); … … 242 242 { 243 243 int i = index; 244 for ( const auto & elem: this->rewards_)244 for (QuestEffect* reward : this->rewards_) 245 245 { 246 246 if(i == 0) 247 return elem;247 return reward; 248 248 249 249 i--; -
code/branches/cpp11_v2/src/modules/questsystem/Quest.cc
r10821 r10916 190 190 191 191 // Iterate through all subquests. 192 for ( const auto & elem: this->subQuests_)192 for (Quest* quest : this->subQuests_) 193 193 { 194 194 if(i == 0) // We're counting down... 195 return elem;195 return quest; 196 196 197 197 i--; … … 214 214 215 215 // Iterate through all QuestHints. 216 for ( const auto & elem: this->hints_)216 for (QuestHint* hint : this->hints_) 217 217 { 218 218 if(i == 0) // We're counting down... 219 return elem;219 return hint; 220 220 221 221 i--; … … 237 237 238 238 // Iterate through all fail QuestEffects. 239 for ( const auto & elem: this->failEffects_)239 for (QuestEffect* effect : this->failEffects_) 240 240 { 241 241 if(i == 0) // We're counting down... 242 return e lem;242 return effect; 243 243 244 244 i--; … … 260 260 261 261 // Iterate through all complete QuestEffects. 262 for ( const auto & elem: this->completeEffects_)262 for (QuestEffect* effect : this->completeEffects_) 263 263 { 264 264 if(i == 0) // We're counting down... 265 return e lem;265 return effect; 266 266 267 267 i--; -
code/branches/cpp11_v2/src/modules/questsystem/QuestEffect.cc
r10821 r10916 74 74 orxout(verbose, context::quests) << "Invoking QuestEffects on player: " << player << " ." << endl; 75 75 76 for ( auto & effects_effect : effects)77 temp = temp && (effects_effect)->invoke(player);76 for (QuestEffect* effect : effects) 77 temp = temp && effect->invoke(player); 78 78 79 79 return temp; -
code/branches/cpp11_v2/src/modules/questsystem/QuestEffectBeacon.cc
r10821 r10916 236 236 { 237 237 int i = index; 238 for ( const auto & elem: this->effects_)238 for (QuestEffect* effect : this->effects_) 239 239 { 240 240 if(i == 0) 241 return e lem;241 return effect; 242 242 243 243 i--; -
code/branches/cpp11_v2/src/modules/questsystem/QuestListener.cc
r10821 r10916 97 97 /* static */ void QuestListener::advertiseStatusChange(std::list<QuestListener*> & listeners, const std::string & status) 98 98 { 99 for (auto listener : listeners) // Iterate through all QuestListeners 100 { 101 99 for (QuestListener* listener : listeners) // Iterate through all QuestListeners 100 { 102 101 if(listener->getMode() == status || listener->getMode() == QuestListener::ALL) // Check whether the status change affects the give QuestListener. 103 102 listener->execute(); -
code/branches/cpp11_v2/src/modules/questsystem/QuestManager.cc
r10821 r10916 235 235 { 236 236 int numQuests = 0; 237 for(auto & elem: this->questMap_)238 { 239 if( elem.second->getParentQuest() == nullptr && !elem.second->isInactive(player))237 for(auto& mapEntry : this->questMap_) 238 { 239 if(mapEntry.second->getParentQuest() == nullptr && !mapEntry.second->isInactive(player)) 240 240 numQuests++; 241 241 } … … 255 255 Quest* QuestManager::getRootQuest(PlayerInfo* player, int index) 256 256 { 257 for(auto & elem: this->questMap_)258 { 259 if( elem.second->getParentQuest() == nullptr && !elem.second->isInactive(player) && index-- == 0)260 return elem.second;257 for(auto& mapEntry : this->questMap_) 258 { 259 if(mapEntry.second->getParentQuest() == nullptr && !mapEntry.second->isInactive(player) && index-- == 0) 260 return mapEntry.second; 261 261 } 262 262 return nullptr; … … 280 280 std::list<Quest*> quests = quest->getSubQuestList(); 281 281 int numQuests = 0; 282 for( auto &quest : quests)283 { 284 if(! (quest)->isInactive(player))282 for(Quest* subquest : quests) 283 { 284 if(!subquest->isInactive(player)) 285 285 numQuests++; 286 286 } … … 304 304 305 305 std::list<Quest*> quests = quest->getSubQuestList(); 306 for( auto &quest : quests)307 { 308 if(! (quest)->isInactive(player) && index-- == 0)306 for(Quest* subquest : quests) 307 { 308 if(!subquest->isInactive(player) && index-- == 0) 309 309 return quest; 310 310 } … … 326 326 std::list<QuestHint*> hints = quest->getHintsList(); 327 327 int numHints = 0; 328 for( auto &hint : hints)329 { 330 if( (hint)->isActive(player))328 for(QuestHint* hint : hints) 329 { 330 if(hint->isActive(player)) 331 331 numHints++; 332 332 } … … 349 349 { 350 350 std::list<QuestHint*> hints = quest->getHintsList(); 351 for( auto &hint : hints)352 { 353 if( (hint)->isActive(player) && index-- == 0)351 for(QuestHint* hint : hints) 352 { 353 if(hint->isActive(player) && index-- == 0) 354 354 return hint; 355 355 } -
code/branches/cpp11_v2/src/modules/questsystem/effects/AddReward.cc
r10821 r10916 84 84 { 85 85 int i = index; 86 for ( const auto & elem: this->rewards_)86 for (Rewardable* reward : this->rewards_) 87 87 { 88 88 if(i == 0) 89 return elem;89 return reward; 90 90 i--; 91 91 } … … 106 106 107 107 bool temp = true; 108 for ( auto & elem: this->rewards_)109 temp = temp && (elem)->reward(player);108 for (Rewardable* reward : this->rewards_) 109 temp = temp && reward->reward(player); 110 110 111 111 orxout(verbose, context::quests) << "Rewardable successfully added to player." << player << " ." << endl; -
code/branches/cpp11_v2/src/modules/tetris/Tetris.cc
r10821 r10916 104 104 } 105 105 106 for ( auto & elem: this->stones_)107 (elem)->destroy();106 for (TetrisStone* stone : this->stones_) 107 stone->destroy(); 108 108 this->stones_.clear(); 109 109 } … … 341 341 { 342 342 // Spawn a human player. 343 for (auto & elem: this->players_)344 if ( elem.first->isHumanPlayer() && (elem.first->isReadyToSpawn() || this->bForceSpawn_))345 this->spawnPlayer( elem.first);343 for (auto& mapEntry : this->players_) 344 if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_)) 345 this->spawnPlayer(mapEntry.first); 346 346 } 347 347 … … 502 502 } 503 503 // adjust height of stones above the deleted row //TODO: check if this could be a source of a bug. 504 for( auto & elem: this->stones_)505 { 506 if(static_cast<unsigned int>(( (elem)->getPosition().y - 5)/this->center_->getStoneSize()) > row)507 (elem)->setPosition((elem)->getPosition()-Vector3(0,10,0));504 for(TetrisStone* stone : this->stones_) 505 { 506 if(static_cast<unsigned int>((stone->getPosition().y - 5)/this->center_->getStoneSize()) > row) 507 stone->setPosition(stone->getPosition()-Vector3(0,10,0)); 508 508 } 509 509 -
code/branches/cpp11_v2/src/modules/tetris/TetrisBrick.cc
r10821 r10916 239 239 { 240 240 assert(this->tetris_); 241 for( auto & elem: this->brickStones_)242 { 243 elem->detachFromParent();244 elem->attachToParent(center);245 elem->setPosition(this->getPosition()+this->tetris_->rotateVector(elem->getPosition(),this->rotationCount_ ));241 for(TetrisStone* stone : this->brickStones_) 242 { 243 stone->detachFromParent(); 244 stone->attachToParent(center); 245 stone->setPosition(this->getPosition()+this->tetris_->rotateVector(stone->getPosition(),this->rotationCount_ )); 246 246 } 247 247 this->brickStones_.clear(); -
code/branches/cpp11_v2/src/modules/towerdefense/TowerDefense.cc
r10821 r10916 183 183 en1->lookAt(waypoints_.at(1)->getPosition() + offset_); 184 184 185 for ( auto & elem: waypoints_)185 for (TowerDefenseField* field : waypoints_) 186 186 { 187 187 orxonox::WeakPtr<MovableEntity> waypoint = new MovableEntity(this->center_->getContext()); 188 waypoint->setPosition( elem->getPosition() + offset_);188 waypoint->setPosition(field->getPosition() + offset_); 189 189 controller->addWaypoint(waypoint); 190 190 }
Note: See TracChangeset
for help on using the changeset viewer.