- Timestamp:
- Nov 21, 2015, 7:05:53 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/orxonox/worldentities/WorldEntity.cc
r10774 r10821 233 233 234 234 // iterate over all children and change their activity as well 235 for ( std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)235 for (const auto & elem : this->getAttachedObjects()) 236 236 { 237 237 if(!this->isActive()) 238 238 { 239 ( *it)->bActiveMem_ = (*it)->isActive();240 ( *it)->setActive(this->isActive());239 (elem)->bActiveMem_ = (elem)->isActive(); 240 (elem)->setActive(this->isActive()); 241 241 } 242 242 else 243 243 { 244 ( *it)->setActive((*it)->bActiveMem_);244 (elem)->setActive((elem)->bActiveMem_); 245 245 } 246 246 } … … 259 259 { 260 260 // iterate over all children and change their visibility as well 261 for ( std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)261 for (const auto & elem : this->getAttachedObjects()) 262 262 { 263 263 if(!this->isVisible()) 264 264 { 265 ( *it)->bVisibleMem_ = (*it)->isVisible();266 ( *it)->setVisible(this->isVisible());265 (elem)->bVisibleMem_ = (elem)->isVisible(); 266 (elem)->setVisible(this->isVisible()); 267 267 } 268 268 else 269 269 { 270 ( *it)->setVisible((*it)->bVisibleMem_);270 (elem)->setVisible((elem)->bVisibleMem_); 271 271 } 272 272 } … … 518 518 { 519 519 unsigned int i = 0; 520 for ( std::set<WorldEntity*>::const_iterator it = this->children_.begin(); it != this->children_.end(); ++it)520 for (const auto & elem : this->children_) 521 521 { 522 522 if (i == index) 523 return ( *it);523 return (elem); 524 524 ++i; 525 525 } … … 938 938 // Recalculate mass 939 939 this->childrenMass_ = 0.0f; 940 for ( std::set<WorldEntity*>::const_iterator it = this->children_.begin(); it != this->children_.end(); ++it)941 this->childrenMass_ += ( *it)->getMass();940 for (const auto & elem : this->children_) 941 this->childrenMass_ += (elem)->getMass(); 942 942 recalculateMassProps(); 943 943 // Notify parent WE
Note: See TracChangeset
for help on using the changeset viewer.