Changeset 10821 for code/branches/cpp11_v2/src/modules/objects/triggers
- Timestamp:
- Nov 21, 2015, 7:05:53 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/modules/objects/triggers
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
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.