Changeset 10545 for code/branches/cpp11/src/orxonox
- Timestamp:
- Jul 14, 2015, 11:23:57 PM (9 years ago)
- Location:
- code/branches/cpp11/src/orxonox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11/src/orxonox/chat/ChatManager.cc
r9667 r10545 105 105 106 106 // notify all listeners 107 for ( ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)108 it->incomingChat(text, name);107 for (ChatListener* listener : ObjectList<ChatListener>()) 108 listener->incomingChat(text, name); 109 109 } 110 110 -
code/branches/cpp11/src/orxonox/controllers/ArtificialController.cc
r10294 r10545 205 205 void ArtificialController::setAllBotLevel(float level) 206 206 { 207 for ( ObjectList<ArtificialController>::iterator it = ObjectList<ArtificialController>::begin(); it != ObjectList<ArtificialController>::end(); ++it)208 it->setBotLevel(level);207 for (ArtificialController* controller : ObjectList<ArtificialController>()) 208 controller->setBotLevel(level); 209 209 } 210 210 … … 229 229 int ArtificialController::getFiremode(std::string name) 230 230 { 231 for ( std::map< std::string, int >::iterator it = this->weaponModes_.begin(); it != this->weaponModes_.end(); ++it)232 { 233 if ( it->first == name)234 return it->second;231 for (auto firemode : this->weaponModes_) 232 { 233 if (firemode.first == name) 234 return firemode.second; 235 235 } 236 236 return -1; … … 257 257 { 258 258 WorldEntity* waypoint = NULL; 259 for ( ObjectList<WorldEntity>::iterator it = ObjectList<WorldEntity>::begin(); it != ObjectList<WorldEntity>::end(); ++it)260 { 261 if( (*it)->getIdentifier() == ClassByString(name))259 for (WorldEntity* we : ObjectList<WorldEntity>()) 260 { 261 if(we->getIdentifier() == ClassByString(name)) 262 262 { 263 263 ControllableEntity* controllable = this->getControllableEntity(); 264 264 if(!controllable) continue; 265 float actualDistance = ( (*it)->getPosition() - controllable->getPosition() ).length();265 float actualDistance = ( we->getPosition() - controllable->getPosition() ).length(); 266 266 if(actualDistance > searchDistance || actualDistance < 5.0f) continue; 267 267 // TODO: PickupSpawner: adjust waypoint accuracy to PickupSpawner's triggerdistance … … 269 269 else 270 270 { 271 waypoint = *it;271 waypoint = we; 272 272 break; 273 273 }
Note: See TracChangeset
for help on using the changeset viewer.