Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 1:59:00 PM (8 years ago)
Author:
landauf
Message:

added c++11 features to code that was added in presentationHS15

Location:
code/branches/cpp11_v3/src/modules
Files:
32 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3/src/modules/hover/FlagHUD.cc

    r11043 r11065  
    4848        RegisterObject(FlagHUD);
    4949
    50         this->hoverGame_ = NULL;
     50        this->hoverGame_ = nullptr;
    5151        this->panel_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
    5252            .createOverlayElement("Panel", "FlagHUD_Panel_" + getUniqueNumberString()));
     
    101101        else
    102102        {
    103             this->hoverGame_ = 0;
     103            this->hoverGame_ = nullptr;
    104104        }
    105105    }
  • code/branches/cpp11_v3/src/modules/hover/FlagHUD.h

    r11041 r11065  
    4747        virtual ~FlagHUD();
    4848
    49         virtual void tick(float dt);
    50         virtual void changedOwner();
     49        virtual void tick(float dt) override;
     50        virtual void changedOwner() override;
    5151
    5252        void setFlagCount(int flagCount);
  • code/branches/cpp11_v3/src/modules/hover/Hover.cc

    r11043 r11065  
    4848        RegisterObject(Hover);
    4949
    50         this->origin_ = NULL;
     50        this->origin_ = nullptr;
    5151        this->numberOfFlags_ = 1;
    5252        this->firstTick_ = true;
  • code/branches/cpp11_v3/src/modules/hover/Hover.h

    r11043 r11065  
    5050            Hover(Context* context);
    5151
    52             virtual void tick(float dt);         
     52            virtual void tick(float dt) override;
    5353
    5454            void setOrigin(HoverOrigin* origin)
  • code/branches/cpp11_v3/src/modules/hover/HoverFlag.cc

    r11043 r11065  
    4949        RegisterObject(HoverFlag);
    5050
    51         this->model_ = NULL;
    52         this->cs_ = NULL;
     51        this->model_ = nullptr;
     52        this->cs_ = nullptr;
    5353        this->collided_ = false;
    5454
  • code/branches/cpp11_v3/src/modules/hover/HoverFlag.h

    r11042 r11065  
    5151            void init(int xCoordinate, int yCoordinate, int cellSize);
    5252
    53             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint);           
     53            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
    5454
    5555            inline bool getCollided() const
  • code/branches/cpp11_v3/src/modules/hover/HoverOrigin.cc

    r11040 r11065  
    5858    void HoverOrigin::checkGametype()
    5959    {
    60         if (getGametype() != NULL && this->getGametype()->isA(Class(Hover)))
     60        if (getGametype() != nullptr && this->getGametype()->isA(Class(Hover)))
    6161        {
    6262            Hover* hoverGametype = orxonox_cast<Hover*>(this->getGametype());
  • code/branches/cpp11_v3/src/modules/hover/HoverOrigin.h

    r11041 r11065  
    108108        public:
    109109            HoverOrigin(Context* context); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually Hover.
    110             virtual ~HoverOrigin() {}
    111             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method to create a HoverOrigin through XML.
     110            virtual ~HoverOrigin() = default;
     111            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method to create a HoverOrigin through XML.
    112112           
    113113            inline void setNumCells(int numCells)
  • code/branches/cpp11_v3/src/modules/hover/HoverShip.h

    r11041 r11065  
    4444            HoverShip(Context* context);
    4545
    46             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     46            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    4747
    4848            /// sets this ships jumpBoost
     
    5353                { return this->jumpBoost_; }
    5454
    55             virtual void moveFrontBack(const Vector2& value);
     55            virtual void moveFrontBack(const Vector2& value) override;
    5656
    57             virtual void moveRightLeft(const Vector2& value);
     57            virtual void moveRightLeft(const Vector2& value) override;
    5858
    59             virtual void moveUpDown(const Vector2& value);
     59            virtual void moveUpDown(const Vector2& value) override;
    6060
    61             virtual void rotateYaw(const Vector2& value);
     61            virtual void rotateYaw(const Vector2& value) override;
    6262
    63             virtual void rotatePitch(const Vector2& value);
     63            virtual void rotatePitch(const Vector2& value) override;
    6464
    65             virtual void rotateRoll(const Vector2& value);
     65            virtual void rotateRoll(const Vector2& value) override;
    6666
    67             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
     67            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
    6868
    69             virtual void boost(bool bBoost);
     69            virtual void boost(bool bBoost) override;
    7070
    7171        private:
  • code/branches/cpp11_v3/src/modules/hover/HoverWall.cc

    r11043 r11065  
    4646        RegisterObject(HoverWall);
    4747
    48         this->model_ = NULL;
    49         this->cs_ = NULL;
     48        this->model_ = nullptr;
     49        this->cs_ = nullptr;
    5050
    5151        this->enableCollisionCallback();
  • code/branches/cpp11_v3/src/modules/hover/TimeHUD.cc

    r11043 r11065  
    4747        this->time_ = 0.0f;
    4848        this->running_ = false;
    49         this->hoverGame_ = 0;
     49        this->hoverGame_ = nullptr;
    5050        setRunning(true);
    5151    }
     
    9898        else
    9999        {
    100             this->hoverGame_ = 0;
     100            this->hoverGame_ = nullptr;
    101101        }
    102102    }
  • code/branches/cpp11_v3/src/modules/hover/TimeHUD.h

    r11041 r11065  
    4545            TimeHUD(Context* context);
    4646
    47             virtual void tick(float dt);
    48             virtual void changedOwner();
     47            virtual void tick(float dt) override;
     48            virtual void changedOwner() override;
    4949
    5050            /// sets if the clock is running
  • code/branches/cpp11_v3/src/modules/overlays/hud/HUDEnemyShieldBar.cc

    r11052 r11065  
    4141
    4242        this->setConfigValues();
    43         this->owner_ = NULL;
     43        this->owner_ = nullptr;
    4444    }
    4545
     
    6262    void HUDEnemyShieldBar::updateTarget()
    6363    {
    64         Pawn* pawn = NULL;
     64        Pawn* pawn = nullptr;
    6565        if (this->owner_ && this->useEnemyBar_)
    6666        {
     
    7373            // Don't show the EnemyShieldBar if the pawn is invisible
    7474            if (pawn && !pawn->isVisible())
    75                 pawn = NULL;
     75                pawn = nullptr;
    7676        }
    7777        // Set the pawn as owner of the EnemyShieldBar
    7878        this->setShieldBarOwner(pawn);
    79         this->setVisible(pawn != NULL);
     79        this->setVisible(pawn != nullptr);
    8080    }
    8181
  • code/branches/cpp11_v3/src/modules/overlays/hud/HUDEnemyShieldBar.h

    r11052 r11065  
    4545
    4646            void setConfigValues();
    47             virtual void tick(float dt);
     47            virtual void tick(float dt) override;
    4848
    49             void changedOwner();
     49            virtual void changedOwner() override;
    5050
    5151        private:
  • code/branches/cpp11_v3/src/modules/overlays/hud/HUDRocketFuelBar.cc

    r11052 r11065  
    4040        RegisterObject(HUDRocketFuelBar);
    4141
    42         this->owner_ = NULL;
     42        this->owner_ = nullptr;
    4343    }
    4444
  • code/branches/cpp11_v3/src/modules/overlays/hud/HUDRocketFuelBar.h

    r11052 r11065  
    4949        virtual ~HUDRocketFuelBar();
    5050
    51         virtual void tick(float dt);
    52         virtual void changedOwner();
     51        virtual void tick(float dt) override;
     52        virtual void changedOwner() override;
    5353
    5454    private:
  • code/branches/cpp11_v3/src/modules/overlays/hud/HUDShieldBar.cc

    r11052 r11065  
    4141        RegisterObject(HUDShieldBar);
    4242
    43         this->owner_ = NULL;
     43        this->owner_ = nullptr;
    4444    }
    4545
  • code/branches/cpp11_v3/src/modules/overlays/hud/HUDShieldBar.h

    r11052 r11065  
    4949        virtual ~HUDShieldBar();
    5050
    51         virtual void tick(float dt);
    52         virtual void changedOwner();
     51        virtual void tick(float dt) override;
     52        virtual void changedOwner() override;
    5353
    5454        inline void setShieldBarOwner(Pawn* owner)
  • code/branches/cpp11_v3/src/modules/overlays/hud/HUDWeapon.cc

    r11059 r11065  
    7676        if (!weapon_)
    7777        {
    78             // TODO: destroy this HUD id the Weapon does no more exist. (Wehen the weak pointer is NULL)
     78            // TODO: destroy this HUD id the Weapon does no more exist. (Wehen the weak pointer is null)
    7979        }
    8080    }   
     
    114114        bool visible = this->isVisible();
    115115
    116         for (std::vector<WeakPtr<HUDWeaponMode> >::iterator it = hudWeaponModes_.begin(); it != hudWeaponModes_.end(); ++it)
    117         {
    118             (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed
    119             (*it)->setVisible(visible);
     116        for (HUDWeaponMode* hudWeaponMode : hudWeaponModes_)
     117        {
     118            hudWeaponMode->changedVisibility(); //inform all Child Overlays that our visibility has changed
     119            hudWeaponMode->setVisible(visible);
    120120        }
    121121    }
     
    154154    void HUDWeapon::createHUDChilds()
    155155    {
    156         if (weapon_ == NULL)
     156        if (weapon_ == nullptr)
    157157        {
    158158            return;
     
    161161        int positionIndex = 0;
    162162
    163         for (std::multimap<unsigned int, WeaponMode*>::const_iterator it = weapon_->getAllWeaponmodes().begin(); it != weapon_->getAllWeaponmodes().end(); ++it)
     163        for (const auto& mapEntry : weapon_->getAllWeaponmodes())
    164164        {
    165165            HUDWeaponMode* hudWeaponMode = new HUDWeaponMode(this->getContext());
     
    167167            hudWeaponMode->setOverlayGroup(this->getOverlayGroup());
    168168            hudWeaponMode->setVisible(this->isVisible());
    169             hudWeaponMode->setWeaponMode(it->second);
     169            hudWeaponMode->setWeaponMode(mapEntry.second);
    170170            hudWeaponMode->setWeaponIndex(this->weaponIndex_);                   
    171171            hudWeaponMode->setAspectCorrection(false);
     
    182182        int positionIndex = 0;
    183183
    184         for (std::vector<WeakPtr<HUDWeaponMode> >::iterator it = hudWeaponModes_.begin(); it != hudWeaponModes_.end(); ++it)
    185         {
    186             (*it)->setPositionOffset(this->positionOffset_);
    187             (*it)->setWeaponModeIndex(positionIndex);
    188             (*it)->setWeaponIndex(this->weaponIndex_);
    189             (*it)->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_);
     184        for (HUDWeaponMode* hudWeaponMode : hudWeaponModes_)
     185        {
     186            hudWeaponMode->setPositionOffset(this->positionOffset_);
     187            hudWeaponMode->setWeaponModeIndex(positionIndex);
     188            hudWeaponMode->setWeaponIndex(this->weaponIndex_);
     189            hudWeaponMode->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_);
    190190
    191191            ++ positionIndex;
     
    195195    void HUDWeapon::destroyHUDChilds()
    196196    {
    197         for (std::vector<WeakPtr<HUDWeaponMode> >::iterator it = hudWeaponModes_.begin(); it != hudWeaponModes_.end(); ++it)
    198         {
    199             (*it)->destroy();
     197        for (HUDWeaponMode* hudWeaponMode : hudWeaponModes_)
     198        {
     199            hudWeaponMode->destroy();
    200200        }
    201201
     
    205205    void HUDWeapon::updateSize()
    206206    {
    207         if (weapon_ != NULL)
     207        if (weapon_ != nullptr)
    208208        {
    209209            this->setSize(Vector2(weaponModeHUDActualSize_.x,weaponModeHUDActualSize_.y*weapon_->getAllWeaponmodes().size()));
     
    214214    void HUDWeapon::updatePosition()
    215215    {
    216         if (weapon_ != NULL)
     216        if (weapon_ != nullptr)
    217217        {
    218218            this->setPosition(Vector2(weaponModeHUDActualSize_.x*weaponIndex_,0.0f) + this->positionOffset_);
  • code/branches/cpp11_v3/src/modules/overlays/hud/HUDWeapon.h

    r11064 r11065  
    5555        virtual ~HUDWeapon();
    5656
    57         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    58         virtual void tick(float dt);
    59         virtual void changedOwner();
    60         virtual void changedOverlayGroup();
    61         virtual void changedVisibility();
    62         virtual void changedName();
    63         virtual void positionChanged();
    64         virtual void sizeChanged();
     57        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     58        virtual void tick(float dt) override;
     59        virtual void changedOwner() override;
     60        virtual void changedOverlayGroup() override;
     61        virtual void changedVisibility() override;
     62        virtual void changedName() override;
     63        virtual void positionChanged() override;
     64        virtual void sizeChanged() override;
    6565
    6666        void setWeapon(Weapon* weapon);
     
    9494        WeakPtr<Weapon> weapon_;
    9595
    96         std::vector<WeakPtr<HUDWeaponMode> > hudWeaponModes_;
     96        std::vector<WeakPtr<HUDWeaponMode>> hudWeaponModes_;
    9797
    9898        Ogre::PanelOverlayElement* overlayElement_;
  • code/branches/cpp11_v3/src/modules/overlays/hud/HUDWeaponMode.cc

    r11063 r11065  
    126126            Munition* munition = this->weaponMode_->getMunition();
    127127
    128             if (munition != NULL)
     128            if (munition != nullptr)
    129129            {
    130130                MunitionDeployment deployment = munition->getMunitionDeployment();
     
    237237        Munition* munition = this->weaponMode_->getMunition();
    238238
    239         if (munition != NULL)
     239        if (munition != nullptr)
    240240        {
    241241            MunitionDeployment deployment = munition->getMunitionDeployment();
  • code/branches/cpp11_v3/src/modules/overlays/hud/HUDWeaponMode.h

    r11064 r11065  
    5757        virtual ~HUDWeaponMode();
    5858
    59         virtual void tick(float dt);
    60         virtual void changedOwner();
    61         virtual void changedOverlayGroup();
    62         virtual void changedVisibility();
    63         virtual void changedName();
    64         virtual void positionChanged();
    65         virtual void sizeChanged();
     59        virtual void tick(float dt) override;
     60        virtual void changedOwner() override;
     61        virtual void changedOverlayGroup() override;
     62        virtual void changedVisibility() override;
     63        virtual void changedName() override;
     64        virtual void positionChanged() override;
     65        virtual void sizeChanged() override;
    6666
    6767        void setWeaponMode(WeaponMode* weaponMode);
  • code/branches/cpp11_v3/src/modules/overlays/hud/HUDWeaponSystem.cc

    r11059 r11065  
    103103        bool visible = this->isVisible();
    104104
    105         for (std::vector<WeakPtr<HUDWeapon> >::iterator it = hudWeapons_.begin(); it != hudWeapons_.end(); ++it)
     105        for (HUDWeapon* hudWeapon : hudWeapons_)
    106106        {
    107             (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed
    108             (*it)->setVisible(visible);
     107            hudWeapon->changedVisibility(); //inform all Child Overlays that our visibility has changed
     108            hudWeapon->setVisible(visible);
    109109        }
    110110    }
     
    129129        {
    130130            const std::vector<WeaponPack*>& weaponPacks = owner_->getWeaponSystem()->getAllWeaponPacks();
    131 
    132             for (std::vector<WeaponPack*>::const_iterator itPacks = weaponPacks.begin(); itPacks != weaponPacks.end(); ++itPacks)
     131            for (WeaponPack* weaponPack : weaponPacks)
    133132            {
    134                 const std::vector<Weapon*>& weapons = (*itPacks)->getAllWeapons();
    135 
    136                 for (std::vector<Weapon*>::const_iterator itWeapons = weapons.begin(); itWeapons != weapons.end(); ++itWeapons)
     133                const std::vector<Weapon*>& weapons = weaponPack->getAllWeapons();
     134                for (Weapon* weapon : weapons)
    137135                {
    138                     this->weapons_.push_back(*itWeapons);
     136                    this->weapons_.push_back(weapon);
    139137                }
    140138            }
     
    149147        int positionIndex = 0;
    150148
    151         for (std::vector<WeakPtr<Weapon> >::iterator it = weapons_.begin(); it != weapons_.end(); ++it)
     149        for (Weapon* weapon : weapons_)
    152150        {
    153151            HUDWeapon* hudWeapon = new HUDWeapon(this->getContext());
     
    155153            hudWeapon->setOverlayGroup(this->getOverlayGroup());
    156154            hudWeapon->setVisible(this->isVisible());
    157             hudWeapon->setWeapon(*it);
     155            hudWeapon->setWeapon(weapon);
    158156            hudWeapon->setAspectCorrection(false);
    159157            hudWeapon->setPickPoint(Vector2(0.0f,0.0f));
     
    170168        Vector2 offset = this->getPosition();
    171169
    172         for (std::vector<WeakPtr<HUDWeapon> >::iterator it = hudWeapons_.begin(); it != hudWeapons_.end(); ++it)
     170        for (HUDWeapon* hudWeapon : hudWeapons_)
    173171        {
    174             (*it)->setPositionOffset(offset);
    175             (*it)->setWeaponIndex(positionIndex);
    176             (*it)->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_);
     172            hudWeapon->setPositionOffset(offset);
     173            hudWeapon->setWeaponIndex(positionIndex);
     174            hudWeapon->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_);
    177175
    178176            ++ positionIndex;
     
    182180    void HUDWeaponSystem::destroyHUDChilds()
    183181    {
    184         for (std::vector<WeakPtr<HUDWeapon> >::iterator it = hudWeapons_.begin(); it != hudWeapons_.end(); ++it)
     182        for (HUDWeapon* hudWeapon : hudWeapons_)
    185183        {
    186             (*it)->destroy();
     184            hudWeapon->destroy();
    187185        }
    188186
  • code/branches/cpp11_v3/src/modules/overlays/hud/HUDWeaponSystem.h

    r11064 r11065  
    4949        virtual ~HUDWeaponSystem();
    5050
    51         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    52         virtual void changedOwner();
    53         virtual void changedOverlayGroup();
    54         virtual void changedVisibility();
    55         virtual void changedName();
    56         virtual void positionChanged();
    57         virtual void sizeChanged();
     51        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     52        virtual void changedOwner() override;
     53        virtual void changedOverlayGroup() override;
     54        virtual void changedVisibility() override;
     55        virtual void changedName() override;
     56        virtual void positionChanged() override;
     57        virtual void sizeChanged() override;
    5858    protected:
    5959        inline void setWeaponModeHUDSize(Vector2 vector)
     
    7171        WeakPtr<Pawn> owner_;
    7272
    73         std::vector<WeakPtr<Weapon> > weapons_;
    74         std::vector<WeakPtr<HUDWeapon> > hudWeapons_;
     73        std::vector<WeakPtr<Weapon>> weapons_;
     74        std::vector<WeakPtr<HUDWeapon>> hudWeapons_;
    7575
    7676        Vector2 weaponModeHUDSize_;
  • code/branches/cpp11_v3/src/modules/pickup/items/BoostPickup.cc

    r11052 r11065  
    106106
    107107        SpaceShip* ship = this->carrierToSpaceShipHelper();
    108         if(ship == NULL) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed.
     108        if(ship == nullptr) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed.
    109109            this->Pickupable::destroy();
    110110
     
    128128        Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails.
    129129    @return
    130         A pointer to the SpaceShip, or NULL if the conversion failed.
     130        A pointer to the SpaceShip, or nullptr if the conversion failed.
    131131    */
    132132    SpaceShip* BoostPickup::carrierToSpaceShipHelper(void)
     
    135135        SpaceShip* ship = orxonox_cast<SpaceShip*>(carrier);
    136136
    137         if(ship == NULL)
     137        if(ship == nullptr)
    138138        {
    139139            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in BoostPickup." << endl;
  • code/branches/cpp11_v3/src/modules/pickup/items/BoostPickup.h

    r11052 r11065  
    5252            virtual ~BoostPickup(); //!< Destructor.
    5353
    54             virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a BoostPickup object through XML.
     54            virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode) override; //!< Method for creating a BoostPickup object through XML.
    5555
    56             virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
     56            virtual void changedUsed(void) override; //!< Is called when the pickup has transited from used to unused or the other way around.
    5757            inline float getBoostRefill()
    5858                { return this->boostRefill_; }
  • code/branches/cpp11_v3/src/modules/pickup/items/MunitionContainer.h

    r11052 r11065  
    5353            virtual ~MunitionContainer();
    5454
    55             virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode);
     55            virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode) override;
    5656
    5757            inline const std::string& getMunitionName() const
  • code/branches/cpp11_v3/src/modules/pickup/items/MunitionPickup.cc

    r11052 r11065  
    8686    void MunitionPickup::addMunitionContainer(MunitionContainer* munitionContainer)
    8787    {
    88         OrxAssert(munitionContainer != NULL, "The munitionContainer cannot be NULL.");
     88        OrxAssert(munitionContainer != nullptr, "The munitionContainer cannot be nullptr.");
    8989        this->munitionContainers_.push_back(munitionContainer);
    9090    }
     
    9393    {
    9494        if(this->munitionContainers_.size() >= index)
    95             return NULL;
     95            return nullptr;
    9696        else
    9797            return this->munitionContainers_[index];
     
    108108        Pawn* pawn = this->carrierToPawnHelper();
    109109
    110         if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     110        if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    111111            this->Pickupable::destroy();
    112112
     
    114114        if(this->isUsed())
    115115        {
    116             for(std::vector<MunitionContainer*>::iterator it = this->munitionContainers_.begin(); it != this->munitionContainers_.end(); ++it)
     116            for(MunitionContainer* container : this->munitionContainers_)
    117117            {
    118118                //Get pointer to the appropriate munition
    119                 SubclassIdentifier<Munition> identifier = (*it)->getMunitionType();
     119                SubclassIdentifier<Munition> identifier = container->getMunitionType();
    120120                Munition* munition = pawn->getMunition(&identifier);
    121121                if (munition)
    122122                {
    123123                    // Add munition and magzines
    124                     munition->addMunition((*it)->getMunitionAmount());
    125                     munition->addMagazines((*it)->getMagazinesAmount());
     124                    munition->addMunition(container->getMunitionAmount());
     125                    munition->addMagazines(container->getMagazinesAmount());
    126126                }
    127                 (*it)->destroy();
     127                container->destroy();
    128128            }
    129129            // This will destroy the pickp
     
    140140        Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
    141141    @return
    142         A pointer to the Pawn, or NULL if the conversion failed.
     142        A pointer to the Pawn, or nullptr if the conversion failed.
    143143    */
    144144    Pawn* MunitionPickup::carrierToPawnHelper(void)
     
    147147        Pawn* pawn = orxonox_cast<Pawn*>(carrier);
    148148
    149         if(pawn == NULL)
     149        if(pawn == nullptr)
    150150        {
    151151            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in MunitionPickup." << endl;
  • code/branches/cpp11_v3/src/modules/pickup/items/MunitionPickup.h

    r11064 r11065  
    5959            virtual ~MunitionPickup(); //!< Destructor.
    6060
    61             virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a MunitionPickup object through XML.
     61            virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode) override; //!< Method for creating a MunitionPickup object through XML.
    6262
    63             virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
     63            virtual void changedUsed(void) override; //!< Is called when the pickup has transited from used to unused or the other way around.
    6464
    6565            void addMunitionContainer(MunitionContainer* munitionContainer);
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/MineProjectile.cc

    r11054 r11065  
    112112        modelRing4_->yaw(Degree(270));
    113113
    114         emitter_ = NULL;
     114        emitter_ = nullptr;
    115115
    116116        if (GameMode::isMaster())
     
    217217            {
    218218                // Damage all pawns within the damage radius
    219                 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>().begin(); it; ++it)
     219                for (Pawn* pawn : ObjectList<Pawn>())
    220220                {
    221                     Vector3 distanceVector = it->getWorldPosition()-this->getWorldPosition();
     221                    Vector3 distanceVector = pawn->getWorldPosition()-this->getWorldPosition();
    222222                    if(distanceVector.length()< damageRadius_)
    223223                    {
    224                         it->hit(this->getShooter(), it->getWorldPosition(), NULL, this->getDamage(), this->getHealthDamage(), this->getShieldDamage());
     224                        pawn->hit(this->getShooter(), pawn->getWorldPosition(), nullptr, this->getDamage(), this->getHealthDamage(), this->getShieldDamage());
    225225                    }
    226226                }
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/MineProjectile.h

    r11064 r11065  
    5757            virtual ~MineProjectile();
    5858
    59             virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
     59            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override;
    6060
    6161            void setMaxTimeUntilExplosion(float maxTimeUntilExplosion);
  • code/branches/cpp11_v3/src/modules/weapons/weaponmodes/MineGun.h

    r11052 r11065  
    5959            virtual ~MineGun();
    6060
    61             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    62             virtual void fire();
     61            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     62            virtual void fire() override;
    6363
    6464            inline float getMaxTimeUntilExplosion() const
Note: See TracChangeset for help on using the changeset viewer.