Changeset 10821 for code/branches/cpp11_v2/src/modules/objects
- Timestamp:
- Nov 21, 2015, 7:05:53 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/modules/objects
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/modules/objects/Attacher.cc
r10768 r10821 61 61 SUPER(Attacher, changedActivity); 62 62 63 for ( std::list<WorldEntity*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)64 ( *it)->setActive(this->isActive());63 for (auto & elem : this->objects_) 64 (elem)->setActive(this->isActive()); 65 65 } 66 66 … … 69 69 SUPER(Attacher, changedVisibility); 70 70 71 for ( std::list<WorldEntity*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)72 ( *it)->setVisible(this->isVisible());71 for (auto & elem : this->objects_) 72 (elem)->setVisible(this->isVisible()); 73 73 } 74 74 … … 83 83 { 84 84 unsigned int i = 0; 85 for ( std::list<WorldEntity*>::const_iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)85 for (const auto & elem : this->objects_) 86 86 { 87 87 if (i == index) 88 return ( *it);88 return (elem); 89 89 90 90 ++i; -
code/branches/cpp11_v2/src/modules/objects/Script.cc
r10765 r10821 196 196 { 197 197 const std::map<unsigned int, PlayerInfo*> clients = PlayerManager::getInstance().getClients(); 198 for( std::map<unsigned int, PlayerInfo*>::const_iterator it = clients.begin(); it != clients.end(); it++)198 for(const auto & client : clients) 199 199 { 200 callStaticNetworkFunction(&Script::executeHelper, it->first, this->getCode(), this->getMode(), this->getNeedsGraphics());200 callStaticNetworkFunction(&Script::executeHelper, client.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
r10769 r10821 59 59 this->pawnsIn_.clear(); 60 60 61 for( std::vector<BillboardAdministration>::iterator current = this->billboards_.begin(); current != this->billboards_.end(); current++)61 for(auto & elem : this->billboards_) 62 62 { 63 if( current->billy != nullptr)64 { 65 delete current->billy;63 if( elem.billy != nullptr) 64 { 65 delete elem.billy; 66 66 } 67 67 } … … 138 138 void SpaceBoundaries::removeAllBillboards() 139 139 { 140 for( std::vector<BillboardAdministration>::iterator current = this->billboards_.begin(); current != this->billboards_.end(); current++)141 { 142 current->usedYet = false;143 current->billy->setVisible(false);140 for(auto & elem : this->billboards_) 141 { 142 elem.usedYet = false; 143 elem.billy->setVisible(false); 144 144 } 145 145 } … … 208 208 float distance; 209 209 bool humanItem; 210 for( std::list<WeakPtr<Pawn>>::iterator current = pawnsIn_.begin(); current != pawnsIn_.end(); current++)211 { 212 Pawn* currentPawn = *current;210 for(auto currentPawn : pawnsIn_) 211 { 212 213 213 if( currentPawn && currentPawn->getNode() ) 214 214 { -
code/branches/cpp11_v2/src/modules/objects/eventsystem/EventDispatcher.cc
r10768 r10821 45 45 { 46 46 if (this->isInitialized()) 47 for ( std::list<BaseObject*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)48 ( *it)->destroy();47 for (auto & elem : this->targets_) 48 (elem)->destroy(); 49 49 } 50 50 … … 61 61 void EventDispatcher::processEvent(Event& event) 62 62 { 63 for ( std::list<BaseObject*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)64 ( *it)->processEvent(event);63 for (auto & elem : this->targets_) 64 (elem)->processEvent(event); 65 65 } 66 66 … … 73 73 { 74 74 unsigned int i = 0; 75 for ( std::list<BaseObject*>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)75 for (const auto & elem : this->targets_) 76 76 { 77 77 if (i == index) 78 return ( *it);78 return (elem); 79 79 ++i; 80 80 } -
code/branches/cpp11_v2/src/modules/objects/eventsystem/EventFilter.cc
r10768 r10821 96 96 { 97 97 unsigned int i = 0; 98 for ( std::list<BaseObject*>::const_iterator it = this->sources_.begin(); it != this->sources_.end(); ++it)98 for (const auto & elem : this->sources_) 99 99 { 100 100 if (i == index) 101 return ( *it);101 return (elem); 102 102 ++i; 103 103 } … … 113 113 { 114 114 unsigned int i = 0; 115 for ( std::list<EventName*>::const_iterator it = this->names_.begin(); it != this->names_.end(); ++it)115 for (const auto & elem : this->names_) 116 116 { 117 117 if (i == index) 118 return ( *it);118 return (elem); 119 119 ++i; 120 120 } -
code/branches/cpp11_v2/src/modules/objects/triggers/DistanceMultiTrigger.cc
r10769 r10821 160 160 const std::set<WorldEntity*> attached = entity->getAttachedObjects(); 161 161 bool found = false; 162 for( std::set<WorldEntity*>::const_iterator it = attached.begin(); it != attached.end(); it++)162 for(const auto & elem : attached) 163 163 { 164 if(( *it)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(*it)->getName() == this->targetName_)164 if((elem)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(elem)->getName() == this->targetName_) 165 165 { 166 166 found = true; -
code/branches/cpp11_v2/src/modules/objects/triggers/DistanceTrigger.cc
r10765 r10821 182 182 const std::set<WorldEntity*> attached = entity->getAttachedObjects(); 183 183 bool found = false; 184 for( std::set<WorldEntity*>::const_iterator it = attached.begin(); it != attached.end(); it++)184 for(const auto & elem : attached) 185 185 { 186 if(( *it)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(*it)->getName() == this->targetName_)186 if((elem)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(elem)->getName() == this->targetName_) 187 187 { 188 188 found = true; -
code/branches/cpp11_v2/src/modules/objects/triggers/MultiTrigger.cc
r10765 r10821 504 504 bool MultiTrigger::checkAnd(BaseObject* triggerer) 505 505 { 506 for( std::set<TriggerBase*>::iterator it = this->children_.begin(); it != this->children_.end(); ++it)507 { 508 TriggerBase* trigger = *it;506 for(auto trigger : this->children_) 507 { 508 509 509 if(trigger->isMultiTrigger()) 510 510 { … … 531 531 bool MultiTrigger::checkOr(BaseObject* triggerer) 532 532 { 533 for( std::set<TriggerBase*>::iterator it = this->children_.begin(); it != this->children_.end(); ++it)534 { 535 TriggerBase* trigger = *it;533 for(auto trigger : this->children_) 534 { 535 536 536 if(trigger->isMultiTrigger()) 537 537 { … … 559 559 { 560 560 bool triggered = false; 561 for( std::set<TriggerBase*>::iterator it = this->children_.begin(); it != this->children_.end(); ++it)562 { 563 TriggerBase* trigger = *it;561 for(auto trigger : this->children_) 562 { 563 564 564 if(triggered) 565 565 { -
code/branches/cpp11_v2/src/modules/objects/triggers/Trigger.cc
r10624 r10821 234 234 { 235 235 // Iterate over all sub-triggers. 236 for ( std::set<TriggerBase*>::iterator it = this->children_.begin(); it != this->children_.end(); ++it)237 { 238 if (!( *it)->isActive())236 for (const auto & elem : this->children_) 237 { 238 if (!(elem)->isActive()) 239 239 return false; 240 240 } … … 252 252 { 253 253 // Iterate over all sub-triggers. 254 for ( std::set<TriggerBase*>::iterator it = this->children_.begin(); it != this->children_.end(); ++it)255 { 256 if (( *it)->isActive())254 for (const auto & elem : this->children_) 255 { 256 if ((elem)->isActive()) 257 257 return true; 258 258 } … … 270 270 { 271 271 bool test = false; 272 for ( std::set<TriggerBase*>::iterator it = this->children_.begin(); it != this->children_.end(); ++it)273 { 274 if (test && ( *it)->isActive())272 for (const auto & elem : this->children_) 273 { 274 if (test && (elem)->isActive()) 275 275 return false; 276 if (( *it)->isActive())276 if ((elem)->isActive()) 277 277 test = true; 278 278 }
Note: See TracChangeset
for help on using the changeset viewer.