- Timestamp:
- Nov 21, 2015, 7:05:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponPack.cc
r10768 r10821 76 76 void WeaponPack::fire(unsigned int weaponmode) 77 77 { 78 for ( std::vector<Weapon *>::iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)79 ( *it)->fire(weaponmode);78 for (auto & elem : this->weapons_) 79 (elem)->fire(weaponmode); 80 80 } 81 81 … … 86 86 void WeaponPack::reload() 87 87 { 88 for ( std::vector<Weapon *>::iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)89 ( *it)->reload();88 for (auto & elem : this->weapons_) 89 (elem)->reload(); 90 90 } 91 91 … … 114 114 unsigned int i = 0; 115 115 116 for ( std::vector<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)116 for (const auto & elem : this->weapons_) 117 117 { 118 118 if (i == index) 119 return ( *it);119 return (elem); 120 120 ++i; 121 121 } … … 132 132 { 133 133 unsigned int i = 0; 134 for ( std::set<DefaultWeaponmodeLink*>::const_iterator it = this->links_.begin(); it != this->links_.end(); ++it)134 for (const auto & elem : this->links_) 135 135 { 136 136 if (i == index) 137 return ( *it);137 return (elem); 138 138 139 139 ++i; … … 144 144 unsigned int WeaponPack::getDesiredWeaponmode(unsigned int firemode) const 145 145 { 146 for ( std::set<DefaultWeaponmodeLink*>::const_iterator it = this->links_.begin(); it != this->links_.end(); ++it)147 if (( *it)->getFiremode() == firemode)148 return ( *it)->getWeaponmode();146 for (const auto & elem : this->links_) 147 if ((elem)->getFiremode() == firemode) 148 return (elem)->getWeaponmode(); 149 149 150 150 return WeaponSystem::WEAPON_MODE_UNASSIGNED;
Note: See TracChangeset
for help on using the changeset viewer.