Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 10, 2016, 1:54:11 PM (9 years ago)
Author:
landauf
Message:

merged branch cpp11_v2 into cpp11_v3

Location:
code/branches/cpp11_v3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/orxonox/weaponsystem/Weapon.cc

    r11052 r11054  
    4545        RegisterObject(Weapon);
    4646
    47         this->weaponPack_ = 0;
    48         this->weaponSlot_ = 0;
     47        this->weaponPack_ = nullptr;
     48        this->weaponSlot_ = nullptr;
    4949        this->bReloading_ = false;
    5050        this->reloadingWeaponmode_ = WeaponSystem::WEAPON_MODE_UNASSIGNED;
     
    6161                this->weaponPack_->removeWeapon(this);
    6262
    63             for (std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
    64                 it->second->destroy();
     63            for (const auto& mapEntry : this->weaponmodes_)
     64                mapEntry.second->destroy();
    6565        }
    6666    }
     
    8585    {
    8686        unsigned int i = 0;
    87         for (std::multimap<unsigned int, WeaponMode*>::const_iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
     87        for (const auto& mapEntry : this->weaponmodes_)
    8888        {
    8989            if (i == index)
    90                 return it->second;
     90                return mapEntry.second;
    9191
    9292            ++i;
    9393        }
    94         return 0;
     94        return nullptr;
    9595    }
    9696
     
    140140    void Weapon::reload()
    141141    {
    142         for (std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
    143             it->second->reload();
     142        for (const auto& mapEntry : this->weaponmodes_)
     143            mapEntry.second->reload();
    144144    }
    145145
     
    152152    void Weapon::notifyWeaponModes()
    153153    {
    154         for (std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
    155             it->second->setWeapon(this);
     154        for (const auto& mapEntry : this->weaponmodes_)
     155            mapEntry.second->setWeapon(this);
    156156    }
    157157
Note: See TracChangeset for help on using the changeset viewer.