Changeset 10919 for code/branches/cpp11_v2/src/modules/docking
- Timestamp:
- Dec 5, 2015, 10:47:51 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/modules/docking
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/modules/docking/Dock.cc
r10916 r10919 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 } -
code/branches/cpp11_v2/src/modules/docking/DockingEffect.cc
r10916 r10919 65 65 66 66 DockingTarget *DockingEffect::findTarget(std::string name) { 67 for ( ObjectList<DockingTarget>::iterator it = ObjectList<DockingTarget>::begin(); it != ObjectList<DockingTarget>::end(); ++it)67 for (DockingTarget* target : ObjectList<DockingTarget>()) 68 68 { 69 if ( (*it)->getName().compare(name) == 0)70 return (*it);69 if (target->getName().compare(name) == 0) 70 return target; 71 71 } 72 72 return nullptr;
Note: See TracChangeset
for help on using the changeset viewer.