Changeset 11071 for code/trunk/src/modules/objects/Attacher.cc
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (8 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/modules/objects/Attacher.cc
r9667 r11071 40 40 RegisterObject(Attacher); 41 41 42 this->target_ = 0;42 this->target_ = nullptr; 43 43 } 44 44 … … 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 (WorldEntity* object : this->objects_) 64 object->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 (WorldEntity* object : this->objects_) 72 object->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 (WorldEntity* object : this->objects_) 86 86 { 87 87 if (i == index) 88 return (*it);88 return object; 89 89 90 90 ++i; 91 91 } 92 return 0;92 return nullptr; 93 93 } 94 94 … … 96 96 { 97 97 this->targetname_ = target; 98 this->target_ = 0;98 this->target_ = nullptr; 99 99 100 100 if (this->targetname_.empty()) 101 101 return; 102 102 103 for ( ObjectList<WorldEntity>::iterator it = ObjectList<WorldEntity>::begin(); it != ObjectList<WorldEntity>::end(); ++it)103 for (WorldEntity* worldEntity : ObjectList<WorldEntity>()) 104 104 { 105 if ( it->getName() == this->targetname_)105 if (worldEntity->getName() == this->targetname_) 106 106 { 107 this->target_ = *it;108 this->attachToParent( *it);107 this->target_ = worldEntity; 108 this->attachToParent(worldEntity); 109 109 } 110 110 }
Note: See TracChangeset
for help on using the changeset viewer.