- Timestamp:
- Jan 10, 2016, 1:54:11 PM (9 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/orxonox/overlays/OverlayGroup.cc
r11052 r11054 51 51 { 52 52 ArgumentCompletionList names; 53 for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup> ::begin(); it; ++it)53 for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>().begin(); it; ++it) 54 54 names.push_back(ArgumentCompletionListElement(it->getName(), getLowercase(it->getName()))); 55 55 return names; … … 69 69 RegisterObject(OverlayGroup); 70 70 71 this->owner_ = 0;71 this->owner_ = nullptr; 72 72 73 73 setScale(Vector2(1.0, 1.0)); … … 77 77 OverlayGroup::~OverlayGroup() 78 78 { 79 for ( std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)80 (*it)->destroy();79 for (OrxonoxOverlay* hudElement : hudElements_) 80 hudElement->destroy(); 81 81 this->hudElements_.clear(); 82 82 } … … 101 101 void OverlayGroup::setScale(const Vector2& scale) 102 102 { 103 for ( std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)104 (*it)->scale(scale / this->scale_);103 for (OrxonoxOverlay* hudElement : hudElements_) 104 hudElement->scale(scale / this->scale_); 105 105 this->scale_ = scale; 106 106 } … … 109 109 void OverlayGroup::setScroll(const Vector2& scroll) 110 110 { 111 for ( std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)112 (*it)->scroll(scroll - this->scroll_);111 for (OrxonoxOverlay* hudElement : hudElements_) 112 hudElement->scroll(scroll - this->scroll_); 113 113 this->scroll_ = scroll; 114 114 } … … 148 148 if (index < this->hudElements_.size()) 149 149 { 150 std::set< StrongPtr<OrxonoxOverlay>>::const_iterator it = hudElements_.begin();150 std::set<StrongPtr<OrxonoxOverlay>>::const_iterator it = hudElements_.begin(); 151 151 for (unsigned int i = 0; i != index; ++it, ++i) 152 152 ; … … 154 154 } 155 155 else 156 return 0;156 return nullptr; 157 157 } 158 158 … … 162 162 SUPER( OverlayGroup, changedVisibility ); 163 163 164 for ( std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)165 (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed164 for (OrxonoxOverlay* hudElement : hudElements_) 165 hudElement->changedVisibility(); //inform all Child Overlays that our visibility has changed 166 166 } 167 167 … … 170 170 this->owner_ = owner; 171 171 172 for ( std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)173 (*it)->setOwner(owner);172 for (OrxonoxOverlay* hudElement : hudElements_) 173 hudElement->setOwner(owner); 174 174 } 175 175 … … 185 185 /*static*/ void OverlayGroup::toggleVisibility(const std::string& name) 186 186 { 187 for (O bjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)188 { 189 if ( (*it)->getName() == name)190 (*it)->setVisible(!((*it)->isVisible()));187 for (OverlayGroup* group : ObjectList<OverlayGroup>()) 188 { 189 if (group->getName() == name) 190 group->setVisible(!(group->isVisible())); 191 191 } 192 192 } … … 200 200 /*static*/ void OverlayGroup::show(const std::string& name) 201 201 { 202 for (O bjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)203 { 204 if ( (*it)->getName() == name)202 for (OverlayGroup* group : ObjectList<OverlayGroup>()) 203 { 204 if (group->getName() == name) 205 205 { 206 if( (*it)->isVisible())207 (*it)->changedVisibility();206 if(group->isVisible()) 207 group->changedVisibility(); 208 208 else 209 (*it)->setVisible(!((*it)->isVisible()));209 group->setVisible(!(group->isVisible())); 210 210 } 211 211 } … … 223 223 /*static*/ void OverlayGroup::scaleGroup(const std::string& name, float scale) 224 224 { 225 for (O bjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)226 { 227 if ( (*it)->getName() == name)228 (*it)->scale(Vector2(scale, scale));225 for (OverlayGroup* group : ObjectList<OverlayGroup>()) 226 { 227 if (group->getName() == name) 228 group->scale(Vector2(scale, scale)); 229 229 } 230 230 } … … 241 241 /*static*/ void OverlayGroup::scrollGroup(const std::string& name, const Vector2& scroll) 242 242 { 243 for (O bjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)244 { 245 if ( (*it)->getName() == name)246 (*it)->scroll(scroll);243 for (OverlayGroup* group : ObjectList<OverlayGroup>()) 244 { 245 if (group->getName() == name) 246 group->scroll(scroll); 247 247 } 248 248 }
Note: See TracChangeset
for help on using the changeset viewer.