Changeset 11054 for code/branches/cpp11_v3/src/modules/docking/Dock.cc
- Timestamp:
- Jan 10, 2016, 1:54:11 PM (9 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/modules/docking/Dock.cc
r10624 r11054 87 87 88 88 PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger); 89 PlayerInfo* player = NULL;89 PlayerInfo* player = nullptr; 90 90 91 91 // Check whether it is a player trigger and extract pawn from it 92 if(pTrigger != NULL)92 if(pTrigger != nullptr) 93 93 { 94 94 if(!pTrigger->isForPlayer()) { // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. … … 103 103 return false; 104 104 } 105 if(player == NULL)105 if(player == nullptr) 106 106 { 107 107 orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl; … … 131 131 { 132 132 PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger); 133 PlayerInfo* player = NULL;133 PlayerInfo* player = nullptr; 134 134 135 135 // Check whether it is a player trigger and extract pawn from it 136 if(pTrigger != NULL)136 if(pTrigger != nullptr) 137 137 { 138 138 if(!pTrigger->isForPlayer()) { // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. … … 147 147 return false; 148 148 } 149 if(player == NULL)149 if(player == nullptr) 150 150 { 151 151 orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl; … … 214 214 { 215 215 PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer(); 216 for( ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)217 { 218 if( it->dock(player))216 for(Dock* dock : ObjectList<Dock>()) 217 { 218 if(dock->dock(player)) 219 219 break; 220 220 } … … 224 224 { 225 225 PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer(); 226 for( ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)227 { 228 if( it->undock(player))226 for(Dock* dock : ObjectList<Dock>()) 227 { 228 if(dock->undock(player)) 229 229 break; 230 230 } … … 295 295 int i = 0; 296 296 PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer(); 297 for( ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)298 { 299 if( it->candidates_.find(player) != it->candidates_.end())297 for(Dock* dock : ObjectList<Dock>()) 298 { 299 if(dock->candidates_.find(player) != dock->candidates_.end()) 300 300 i++; 301 301 } … … 306 306 { 307 307 PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer(); 308 for( ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)309 { 310 if( it->candidates_.find(player) != it->candidates_.end())308 for(Dock* dock : ObjectList<Dock>()) 309 { 310 if(dock->candidates_.find(player) != dock->candidates_.end()) 311 311 { 312 312 if(index == 0) 313 return *it;313 return dock; 314 314 index--; 315 315 } 316 316 } 317 return NULL;317 return nullptr; 318 318 } 319 319 … … 327 327 const DockingEffect* Dock::getEffect(unsigned int i) const 328 328 { 329 for ( std::list<DockingEffect*>::const_iterator effect = this->effects_.begin(); effect != this->effects_.end(); ++effect)329 for (DockingEffect* effect : this->effects_) 330 330 { 331 331 if(i == 0) 332 return *effect;332 return effect; 333 333 i--; 334 334 } 335 return NULL;335 return nullptr; 336 336 } 337 337 … … 346 346 const DockingAnimation* Dock::getAnimation(unsigned int i) const 347 347 { 348 for ( std::list<DockingAnimation*>::const_iterator animation = this->animations_.begin(); animation != this->animations_.end(); ++animation)348 for (DockingAnimation* animation : this->animations_) 349 349 { 350 350 if(i == 0) 351 return *animation;351 return animation; 352 352 i--; 353 353 } 354 return NULL;354 return nullptr; 355 355 } 356 356 }
Note: See TracChangeset
for help on using the changeset viewer.