- Timestamp:
- Jan 10, 2016, 1:54:11 PM (8 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/weaponsystem/WeaponPack.cc
r11052 r11054 44 44 RegisterObject(WeaponPack); 45 45 46 this->weaponSystem_ = 0;46 this->weaponSystem_ = nullptr; 47 47 } 48 48 … … 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 (Weapon* weapon : this->weapons_) 79 weapon->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 (Weapon* weapon : this->weapons_) 89 weapon->reload(); 90 90 } 91 91 … … 107 107 assert(it != this->weapons_.end()); 108 108 this->weapons_.erase(it); 109 weapon->setWeaponPack( 0);109 weapon->setWeaponPack(nullptr); 110 110 } 111 111 … … 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 (Weapon* weapon : this->weapons_) 117 117 { 118 118 if (i == index) 119 return (*it);119 return weapon; 120 120 ++i; 121 121 } 122 122 123 return 0;123 return nullptr; 124 124 } 125 125 … … 137 137 { 138 138 unsigned int i = 0; 139 for ( std::set<DefaultWeaponmodeLink*>::const_iterator it = this->links_.begin(); it != this->links_.end(); ++it)139 for (DefaultWeaponmodeLink* link : this->links_) 140 140 { 141 141 if (i == index) 142 return (*it);142 return link; 143 143 144 144 ++i; 145 145 } 146 return 0;146 return nullptr; 147 147 } 148 148 149 149 unsigned int WeaponPack::getDesiredWeaponmode(unsigned int firemode) const 150 150 { 151 for ( std::set<DefaultWeaponmodeLink*>::const_iterator it = this->links_.begin(); it != this->links_.end(); ++it)152 if ( (*it)->getFiremode() == firemode)153 return (*it)->getWeaponmode();151 for (DefaultWeaponmodeLink* link : this->links_) 152 if (link->getFiremode() == firemode) 153 return link->getWeaponmode(); 154 154 155 155 return WeaponSystem::WEAPON_MODE_UNASSIGNED; … … 158 158 void WeaponPack::notifyWeapons() 159 159 { 160 for ( std::vector<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)161 (*it)->setWeaponPack(this);160 for (Weapon* weapon : this->weapons_) 161 weapon->setWeaponPack(this); 162 162 } 163 163
Note: See TracChangeset
for help on using the changeset viewer.