Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (9 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
356 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/designtools/CreateStars.h

    r9667 r11071  
    4343            void createBillboards();
    4444
    45             void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     45            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    4646
    4747            void setNumStars(int num) {
  • code/trunk/src/modules/designtools/ScreenshotManager.cc

    r10624 r11071  
    6969        Constructor.
    7070    */
    71     ScreenshotManager::ScreenshotManager() : finalPicturePB_(NULL), data_(NULL)
     71    ScreenshotManager::ScreenshotManager() : finalPicturePB_(nullptr), data_(nullptr)
    7272    {
    7373        RegisterObject(ScreenshotManager);
     
    9090    void ScreenshotManager::cleanup(void)
    9191    {
    92         if(this->finalPicturePB_ != NULL)
     92        if(this->finalPicturePB_ != nullptr)
    9393        {
    9494            delete this->finalPicturePB_;
    95             this->finalPicturePB_ = NULL;
    96         }
    97         if(this->data_ != NULL)
     95            this->finalPicturePB_ = nullptr;
     96        }
     97        if(this->data_ != nullptr)
    9898        {
    9999            delete this->data_;
    100             this->data_ = NULL;
     100            this->data_ = nullptr;
    101101        }
    102102        if(!this->tempTexture_.isNull())
     
    151151        // Get the screenshot.
    152152        Ogre::Image* finalImage = getScreenshot();
    153         if(finalImage != NULL)
     153        if(finalImage != nullptr)
    154154        {
    155155            // Save it.
     
    173173    Ogre::Image* ScreenshotManager::getScreenshot()
    174174    {
    175         if(CameraManager::getInstance().getActiveCamera() == NULL )
    176             return NULL;
     175        if(CameraManager::getInstance().getActiveCamera() == nullptr )
     176            return nullptr;
    177177        return this->getScreenshot(CameraManager::getInstance().getActiveCamera()->getOgreCamera());
    178178    }
     
    189189    Ogre::Image* ScreenshotManager::getScreenshot(Ogre::Camera* camera)
    190190    {
    191         if(camera == NULL)
    192             return NULL;
     191        if(camera == nullptr)
     192            return nullptr;
    193193       
    194194        // Update the internal parameters.
  • code/trunk/src/modules/designtools/SkyboxGenerator.cc

    r10624 r11071  
    8282        this->faceCounter_ = 0;
    8383       
    84         this->names_.push_back("fr");
    85         this->names_.push_back("lf");
    86         this->names_.push_back("bk");
    87         this->names_.push_back("rt");
    88         this->names_.push_back("up");
    89         this->names_.push_back("dn");
    90        
    91         this->rotations_.push_back(std::pair<int, int>(90, 0));
    92         this->rotations_.push_back(std::pair<int, int>(90, 0));
    93         this->rotations_.push_back(std::pair<int, int>(90, 0));
    94         this->rotations_.push_back(std::pair<int, int>(90, 90));
    95         this->rotations_.push_back(std::pair<int, int>(0, 180));
    96         this->rotations_.push_back(std::pair<int, int>(0, 90));
     84        this->names_.emplace_back("fr");
     85        this->names_.emplace_back("lf");
     86        this->names_.emplace_back("bk");
     87        this->names_.emplace_back("rt");
     88        this->names_.emplace_back("up");
     89        this->names_.emplace_back("dn");
     90       
     91        this->rotations_.emplace_back(90, 0);
     92        this->rotations_.emplace_back(90, 0);
     93        this->rotations_.emplace_back(90, 0);
     94        this->rotations_.emplace_back(90, 90);
     95        this->rotations_.emplace_back(0, 180);
     96        this->rotations_.emplace_back(0, 90);
    9797    }
    9898
     
    146146            }
    147147
    148             ControllableEntity* entity = NULL;
    149             if(HumanController::getLocalControllerSingleton() != NULL && HumanController::getLocalControllerSingleton()->getControllableEntity() != NULL)
     148            ControllableEntity* entity = nullptr;
     149            if(HumanController::getLocalControllerSingleton() != nullptr && HumanController::getLocalControllerSingleton()->getControllableEntity() != nullptr)
    150150                entity = HumanController::getLocalControllerSingleton()->getControllableEntity();
    151151            else
  • code/trunk/src/modules/designtools/SkyboxGenerator.h

    r9667 r11071  
    6565            SkyboxGenerator();
    6666            virtual ~SkyboxGenerator();
    67             void tick(float dt); // This is where the skybox generation happens.
     67            virtual void tick(float dt) override; // This is where the skybox generation happens.
    6868            static void createSkybox(void); // Generate the 6 faces of a skybox.
    6969            void setConfigValues(void); // Sets some config values.
     
    106106           
    107107            std::vector<std::string> names_; //!< The names of the image files for the skybox faces to be generated.
    108             std::vector< std::pair<int, int> > rotations_; //!< The rotation in yaw an pitch direction that is applied to the camera after a specific face has been generated.
     108            std::vector< std::pair<int, int>> rotations_; //!< The rotation in yaw an pitch direction that is applied to the camera after a specific face has been generated.
    109109           
    110110            // Storage variables
  • code/trunk/src/modules/docking/Dock.cc

    r10624 r11071  
    8787
    8888        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
    89         PlayerInfo* player = NULL;
     89        PlayerInfo* player = nullptr;
    9090
    9191        // Check whether it is a player trigger and extract pawn from it
    92         if(pTrigger != NULL)
     92        if(pTrigger != nullptr)
    9393        {
    9494            if(!pTrigger->isForPlayer()) {  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
     
    103103            return false;
    104104        }
    105         if(player == NULL)
     105        if(player == nullptr)
    106106        {
    107107            orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl;
     
    131131    {
    132132        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
    133         PlayerInfo* player = NULL;
     133        PlayerInfo* player = nullptr;
    134134
    135135        // Check whether it is a player trigger and extract pawn from it
    136         if(pTrigger != NULL)
     136        if(pTrigger != nullptr)
    137137        {
    138138            if(!pTrigger->isForPlayer()) {  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
     
    147147            return false;
    148148        }
    149         if(player == NULL)
     149        if(player == nullptr)
    150150        {
    151151            orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl;
     
    214214    {
    215215        PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
    216         for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
    217         {
    218             if(it->dock(player))
     216        for(Dock* dock : ObjectList<Dock>())
     217        {
     218            if(dock->dock(player))
    219219                break;
    220220        }
     
    224224    {
    225225        PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
    226         for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
    227         {
    228             if(it->undock(player))
     226        for(Dock* dock : ObjectList<Dock>())
     227        {
     228            if(dock->undock(player))
    229229                break;
    230230        }
     
    295295        int i = 0;
    296296        PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
    297         for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
    298         {
    299             if(it->candidates_.find(player) != it->candidates_.end())
     297        for(Dock* dock : ObjectList<Dock>())
     298        {
     299            if(dock->candidates_.find(player) != dock->candidates_.end())
    300300                i++;
    301301        }
     
    306306    {
    307307        PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
    308         for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
    309         {
    310             if(it->candidates_.find(player) != it->candidates_.end())
     308        for(Dock* dock : ObjectList<Dock>())
     309        {
     310            if(dock->candidates_.find(player) != dock->candidates_.end())
    311311            {
    312312                if(index == 0)
    313                     return *it;
     313                    return dock;
    314314                index--;
    315315            }
    316316        }
    317         return NULL;
     317        return nullptr;
    318318    }
    319319
     
    327327    const DockingEffect* Dock::getEffect(unsigned int i) const
    328328    {
    329         for (std::list<DockingEffect*>::const_iterator effect = this->effects_.begin(); effect != this->effects_.end(); ++effect)
     329        for (DockingEffect* effect : this->effects_)
    330330        {
    331331            if(i == 0)
    332                return *effect;
     332               return effect;
    333333            i--;
    334334        }
    335         return NULL;
     335        return nullptr;
    336336    }
    337337
     
    346346    const DockingAnimation* Dock::getAnimation(unsigned int i) const
    347347    {
    348         for (std::list<DockingAnimation*>::const_iterator animation = this->animations_.begin(); animation != this->animations_.end(); ++animation)
     348        for (DockingAnimation* animation : this->animations_)
    349349        {
    350350            if(i == 0)
    351                return *animation;
     351               return animation;
    352352            i--;
    353353        }
    354         return NULL;
     354        return nullptr;
    355355    }
    356356}
  • code/trunk/src/modules/docking/Dock.h

    r9939 r11071  
    6565
    6666            // XML interface
    67             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    68             virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
     67            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     68            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override;
    6969
    7070            // XML functions
  • code/trunk/src/modules/docking/DockToShip.cc

    r9974 r11071  
    7272
    7373        DockingTarget *target = DockingEffect::findTarget(this->target_);
    74         if (target == NULL) {
     74        if (target == nullptr) {
    7575            orxout(internal_warning, context::docking) << "Can't retrieve target for '" << this->target_ << "'.." << endl;
    7676            return false;
     
    7878
    7979        ControllableEntity *dockTo = (ControllableEntity*) target->getParent();
    80         if (dockTo == NULL) {
     80        if (dockTo == nullptr) {
    8181            orxout(internal_warning, context::docking) << "Parent is not a ControllableEntity.." << endl;
    8282            return false;
  • code/trunk/src/modules/docking/DockToShip.h

    r9667 r11071  
    6060            virtual ~DockToShip();
    6161
    62             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     62            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    6363            void setTargetId(const std::string& str);
    6464            const std::string& getTargetId() const;
    6565
    66             virtual bool docking(PlayerInfo* player); //!< Called when docking starts
    67             virtual bool release(PlayerInfo* player); //!< Called when player wants undock
     66            virtual bool docking(PlayerInfo* player) override; //!< Called when docking starts
     67            virtual bool release(PlayerInfo* player) override; //!< Called when player wants undock
    6868        private:
    6969            std::string target_;
  • code/trunk/src/modules/docking/DockingAnimation.cc

    r10624 r11071  
    4545        RegisterObject(DockingAnimation);
    4646
    47         this->parent_ = NULL;
     47        this->parent_ = nullptr;
    4848    }
    4949
     
    5757        bool check = true;
    5858
    59         for (std::list<DockingAnimation*>::iterator animation = animations.begin(); animation != animations.end(); animation++)
     59        for (DockingAnimation* animation : animations)
    6060        {
    6161            if(dock)
    62                 check &= (*animation)->docking(player);
     62                check &= animation->docking(player);
    6363            else
    64                 check &= (*animation)->release(player);
     64                check &= animation->release(player);
    6565        }
    6666
  • code/trunk/src/modules/docking/DockingController.cc

    r11052 r11071  
    4444        RegisterObject(DockingController);
    4545
    46         this->dock_ = NULL;
    47         this->player_ = NULL;
    48         this->entity_ = NULL;
     46        this->dock_ = nullptr;
     47        this->player_ = nullptr;
     48        this->entity_ = nullptr;
    4949    }
    5050
     
    122122        this->player_->startControl(this->entity_);
    123123        this->setActive(false);
    124         this->controllableEntity_ = NULL;
     124        this->controllableEntity_ = nullptr;
    125125
    126126        if (this->docking_)
  • code/trunk/src/modules/docking/DockingController.h

    r9667 r11071  
    4545            virtual ~DockingController();
    4646
    47             virtual void tick(float dt);
     47            virtual void tick(float dt) override;
    4848
    4949            void takeControl(bool docking);
     
    5353
    5454        protected:
    55             virtual void positionReached();
     55            virtual void positionReached() override;
    5656
    5757        private:
  • code/trunk/src/modules/docking/DockingEffect.cc

    r10624 r11071  
    5353        bool check = true;
    5454
    55         for (std::list<DockingEffect*>::iterator effect = effects.begin(); effect != effects.end(); effect++)
     55        for (DockingEffect* effect : effects)
    5656        {
    5757            if (dock)
    58                 check &= (*effect)->docking(player);
     58                check &= effect->docking(player);
    5959            else
    60                 check &= (*effect)->release(player);
     60                check &= effect->release(player);
    6161        }
    6262
     
    6565
    6666    DockingTarget *DockingEffect::findTarget(std::string name) {
    67         for (ObjectList<DockingTarget>::iterator it = ObjectList<DockingTarget>::begin(); it != ObjectList<DockingTarget>::end(); ++it)
     67        for (DockingTarget* target : ObjectList<DockingTarget>())
    6868        {
    69             if ((*it)->getName().compare(name) == 0)
    70                 return (*it);
     69            if (target->getName().compare(name) == 0)
     70                return target;
    7171        }
    72         return NULL;
     72        return nullptr;
    7373    }
    7474}
  • code/trunk/src/modules/docking/DockingTarget.cc

    r9667 r11071  
    3434#include "DockingTarget.h"
    3535#include "core/CoreIncludes.h"
    36 #include "core/XMLPort.h"
    3736
    3837
     
    4948    {
    5049    }
    51 
    52     void DockingTarget::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    53     {
    54         SUPER(DockingTarget, XMLPort, xmlelement, mode);
    55 
    56         orxout(verbose, context::docking) << "DockingTarget with name '" << this->getName() << "' created.." << endl;
    57     }
    58 
    5950}
    6051
  • code/trunk/src/modules/docking/DockingTarget.h

    r9667 r11071  
    5858            virtual ~DockingTarget();
    5959
    60             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    61 
    6260    };
    6361
  • code/trunk/src/modules/docking/MoveToDockingTarget.h

    r9667 r11071  
    5959            virtual ~MoveToDockingTarget();
    6060
    61             virtual bool docking(PlayerInfo* player); //!< Called when a player starts docking
    62             virtual bool release(PlayerInfo* player); //!< Called when player wants to undock
     61            virtual bool docking(PlayerInfo* player) override; //!< Called when a player starts docking
     62            virtual bool release(PlayerInfo* player) override; //!< Called when player wants to undock
    6363    };
    6464
  • code/trunk/src/modules/dodgerace/DodgeRace.cc

    r11052 r11071  
    5959        comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&DodgeRace::comboControll, this)));
    6060        this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
    61         this->center_ = 0;
     61        this->center_ = nullptr;
    6262
    6363        this->setHUDTemplate("DodgeRaceHUD");
     
    6767    {
    6868        level++;
    69         if (getPlayer() != NULL)
     69        if (getPlayer() != nullptr)
    7070        {
    7171            for (int i = 0; i < 7; i++)
     
    8989    void DodgeRace::tick(float dt)
    9090    {
    91         if (getPlayer() != NULL)
     91        if (getPlayer() != nullptr)
    9292        {
    9393            currentPosition = getPlayer()->getWorldPosition().x;
     
    138138    DodgeRaceShip* DodgeRace::getPlayer()
    139139    {
    140         if (player == NULL)
    141         {
    142             for (ObjectList<DodgeRaceShip>::iterator it = ObjectList<DodgeRaceShip>::begin(); it != ObjectList<DodgeRaceShip>::end(); ++it)
    143             {
    144                 player = *it;
     140        if (player == nullptr)
     141        {
     142            for (DodgeRaceShip* ship : ObjectList<DodgeRaceShip>())
     143            {
     144                player = ship;
    145145            }
    146146        }
     
    177177        this->bForceSpawn_ = false;
    178178
    179         if (this->center_ == NULL)  // abandon mission!
     179        if (this->center_ == nullptr)  // abandon mission!
    180180        {
    181181            orxout(internal_error) << "DodgeRace: No Centerpoint specified." << endl;
  • code/trunk/src/modules/dodgerace/DodgeRace.h

    r11052 r11071  
    6868            DodgeRace(Context* context);
    6969
    70             virtual void start();
    71             virtual void end();
     70            virtual void start() override;
     71            virtual void end() override;
    7272
    73             virtual void tick(float dt);
     73            virtual void tick(float dt) override;
    7474
    75             virtual void playerPreSpawn(PlayerInfo* player);
     75            virtual void playerPreSpawn(PlayerInfo* player) override;
    7676
    7777            void levelUp();
     
    8484            void setCenterpoint(DodgeRaceCenterPoint* center)
    8585                       { this->center_ = center; }
    86             virtual void addBots(unsigned int amount){} //<! overwrite function in order to bypass the addbots command
     86            virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command
    8787
    8888            // checks if multiplier should be reset.
  • code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.cc

    r10624 r11071  
    4949    }
    5050
    51     void DodgeRaceCenterPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    52     {
    53         SUPER(DodgeRaceCenterPoint, XMLPort, xmlelement, mode);
    54     }
    55 
    5651    void DodgeRaceCenterPoint::checkGametype()
    5752    {
    58         if (this->getGametype() != NULL && this->getGametype()->isA(Class(DodgeRace)))
     53        if (this->getGametype() != nullptr && this->getGametype()->isA(Class(DodgeRace)))
    5954        {
    6055            DodgeRace* DodgeRaceGametype = orxonox_cast<DodgeRace*>(this->getGametype());
  • code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.h

    r10624 r11071  
    5050            DodgeRaceCenterPoint(Context* context); //checks whether the gametype is actually DodgeRace.
    5151
    52             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    53 
    5452        private:
    5553            void checkGametype();
  • code/trunk/src/modules/dodgerace/DodgeRaceHUDinfo.cc

    r10624 r11071  
    4040        RegisterObject(DodgeRaceHUDinfo);
    4141
    42         this->DodgeRaceGame = 0;
     42        this->DodgeRaceGame = nullptr;
    4343        this->bShowPoints_ = true;
    4444    }
     
    8686        else
    8787        {
    88             this->DodgeRaceGame = 0;
     88            this->DodgeRaceGame = nullptr;
    8989        }
    9090    }
  • code/trunk/src/modules/dodgerace/DodgeRaceHUDinfo.h

    r10234 r11071  
    4444            DodgeRaceHUDinfo(Context* context);
    4545
    46             virtual void tick(float dt);
    47             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    48             virtual void changedOwner();
     46            virtual void tick(float dt) override;
     47            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     48            virtual void changedOwner() override;
    4949
    5050            inline void setShowPoints(bool value)
  • code/trunk/src/modules/dodgerace/DodgeRaceShip.cc

    r10624 r11071  
    9191        // Camera
    9292        Camera* camera = this->getCamera();
    93         if (camera != NULL)
     93        if (camera != nullptr)
    9494        {
    9595            // camera->setPosition(Vector3(-pos.z, -posforeward, 0));
     
    142142    }
    143143
    144     inline bool DodgeRaceShip::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
     144    inline bool DodgeRaceShip::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
    145145    {
    146146
     
    152152    DodgeRace* DodgeRaceShip::getGame()
    153153    {
    154         if (game == NULL)
     154        if (game == nullptr)
    155155        {
    156             for (ObjectList<DodgeRace>::iterator it = ObjectList<DodgeRace>::begin(); it != ObjectList<DodgeRace>::end(); ++it)
     156            for (DodgeRace* race : ObjectList<DodgeRace>())
    157157            {
    158                 game = *it;
     158                game = race;
    159159            }
    160160        }
  • code/trunk/src/modules/dodgerace/DodgeRaceShip.h

    r10624 r11071  
    5252            DodgeRaceShip(Context* context);
    5353
    54             virtual void tick(float dt);
     54            virtual void tick(float dt) override;
    5555
    5656            // overwrite for 2d movement
    57             virtual void moveFrontBack(const Vector2& value);
    58             virtual void moveRightLeft(const Vector2& value);
     57            virtual void moveFrontBack(const Vector2& value) override;
     58            virtual void moveRightLeft(const Vector2& value) override;
    5959
    6060            // Starts or stops fireing
    61             virtual void boost(bool bBoost);
     61            virtual void boost(bool bBoost) override;
    6262
    6363            //no rotation!
    64             virtual void rotateYaw(const Vector2& value){};
    65             virtual void rotatePitch(const Vector2& value){};
     64            virtual void rotateYaw(const Vector2& value) override{};
     65            virtual void rotatePitch(const Vector2& value) override{};
    6666
    6767            //return to main menu if game has ended.
    68             virtual void rotateRoll(const Vector2& value){if (getGame()) if (getGame()->bEndGame) getGame()->end();};
     68            virtual void rotateRoll(const Vector2& value) override{if (getGame()) if (getGame()->bEndGame) getGame()->end();};
    6969
    7070            virtual void updateLevel();
     71
     72            virtual inline bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
    7173
    7274            float speed, damping, posforeward;
     
    7476
    7577        protected:
    76             virtual void death();
     78            virtual void death() override;
    7779
    7880        private:
    79             virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
    8081            DodgeRace* getGame();
    8182            WeakPtr<DodgeRace> game;
  • code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc

    r10624 r11071  
    4949
    5050        this->setRadarObjectColour(ColourValue::Blue);
    51         this->setRadarObjectShape(RadarViewable::Triangle);
     51        this->setRadarObjectShape(RadarViewable::Shape::Triangle);
    5252        this->setRadarVisibility(false);
    5353    }
  • code/trunk/src/modules/gametypes/OldRaceCheckPoint.h

    r9667 r11071  
    4848            virtual ~OldRaceCheckPoint();
    4949
    50             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    51             virtual void tick(float dt);
     50            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     51            virtual void tick(float dt) override;
    5252
    5353            protected:
    54             virtual void triggered(bool bIsTriggered);
     54            virtual void triggered(bool bIsTriggered) override;
    5555            inline void setLast(bool isLast)
    5656                { this->bIsLast_ = isLast; }
     
    6464            inline float getTimeLimit()
    6565                { return this->bTimeLimit_;}
    66             inline const WorldEntity* getWorldEntity() const
     66            virtual inline const WorldEntity* getWorldEntity() const override
    6767                { return this; }
    6868
  • code/trunk/src/modules/gametypes/OldSpaceRace.h

    r9667 r11071  
    5555            virtual ~OldSpaceRace() {}
    5656
    57             virtual void start();
    58             virtual void end();
     57            virtual void start() override;
     58            virtual void end() override;
    5959
    6060            virtual void newCheckpointReached();
    61             virtual void addBots(unsigned int amount){} //<! overwrite function in order to bypass the addbots command.
     61            virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command.
    6262                                                        //<! This is only a temporary solution. Better: create racingBots.
    6363
  • code/trunk/src/modules/gametypes/RaceCheckPoint.cc

    r9973 r11071  
    5353
    5454        this->setRadarObjectColour(ColourValue::Blue);
    55         this->setRadarObjectShape(RadarViewable::Triangle);
     55        this->setRadarObjectShape(RadarViewable::Shape::Triangle);
    5656        this->setRadarVisibility(false);
    5757        this->settingsChanged();
     
    125125            }
    126126        }
    127         return NULL;
     127        return nullptr;
    128128    }
    129129
     
    146146    {
    147147        Vector3 checkpoints(-1,-1,-1); int count=0;
    148         for (std::set<int>::iterator it= nextCheckpoints_.begin();it!=nextCheckpoints_.end(); it++ )
     148        for (int nextCheckpoint : nextCheckpoints_)
    149149        {
    150150            switch (count)
    151151            {
    152                 case 0: checkpoints.x = static_cast<Ogre::Real>(*it); break;
    153                 case 1: checkpoints.y = static_cast<Ogre::Real>(*it); break;
    154                 case 2: checkpoints.z = static_cast<Ogre::Real>(*it); break;
     152                case 0: checkpoints.x = static_cast<Ogre::Real>(nextCheckpoint); break;
     153                case 1: checkpoints.y = static_cast<Ogre::Real>(nextCheckpoint); break;
     154                case 2: checkpoints.z = static_cast<Ogre::Real>(nextCheckpoint); break;
    155155            }
    156156            ++count;
  • code/trunk/src/modules/gametypes/RaceCheckPoint.h

    r9971 r11071  
    4848            virtual ~RaceCheckPoint();
    4949
    50             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     50            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    5151
    5252            inline void setCheckpointIndex(int checkpointIndex)
     
    9292        protected:
    9393
    94             virtual void fire(bool bIsTriggered, BaseObject* originator);
     94            virtual void fire(bool bIsTriggered, BaseObject* originator) override;
    9595
    96             inline const WorldEntity* getWorldEntity() const
     96            virtual inline const WorldEntity* getWorldEntity() const override
    9797            {
    9898                return this;
  • code/trunk/src/modules/gametypes/SpaceRace.cc

    r9804 r11071  
    8888            this->cantMove_ = true;
    8989
    90             for (ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it)
    91                 it->setActive(false);
     90            for (Engine* engine : ObjectList<Engine>())
     91                engine->setActive(false);
    9292        }
    9393
     
    9595        if (!this->isStartCountdownRunning() && this->cantMove_)
    9696        {
    97             for (ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it)
    98                 it->setActive(true);
     97            for (Engine* engine : ObjectList<Engine>())
     98                engine->setActive(true);
    9999
    100100            this->cantMove_= false;
  • code/trunk/src/modules/gametypes/SpaceRace.h

    r9667 r11071  
    5757            virtual ~SpaceRace() {}
    5858
    59             void tick(float dt);
     59            virtual void tick(float dt) override;
    6060
    61             virtual void end();
     61            virtual void end() override;
    6262
    6363            void newCheckpointReached(RaceCheckPoint* checkpoint, PlayerInfo* player);
     
    7070                { return this->clock_; }
    7171
    72             bool allowPawnHit(Pawn* victim, Pawn* originator);
    73             bool allowPawnDamage(Pawn* victim, Pawn* originator);
    74             bool allowPawnDeath(Pawn* victim, Pawn* originator);
     72            virtual bool allowPawnHit(Pawn* victim, Pawn* originator) override;
     73            virtual bool allowPawnDamage(Pawn* victim, Pawn* originator) override;
     74            virtual bool allowPawnDeath(Pawn* victim, Pawn* originator) override;
    7575
    7676        private:
  • code/trunk/src/modules/gametypes/SpaceRaceController.cc

    r10318 r11071  
    5959
    6060        virtualCheckPointIndex = -2;
    61         if (ObjectList<SpaceRaceManager>::size() != 1)
    62             orxout(internal_warning) << "Expected 1 instance of SpaceRaceManager but found " << ObjectList<SpaceRaceManager>::size() << endl;
    63         for (ObjectList<SpaceRaceManager>::iterator it = ObjectList<SpaceRaceManager>::begin(); it != ObjectList<SpaceRaceManager>::end(); ++it)
    64         {
    65             checkpoints = it->getAllCheckpoints();
    66             nextRaceCheckpoint_ = it->findCheckpoint(0);
     61        if (ObjectList<SpaceRaceManager>().size() != 1)
     62            orxout(internal_warning) << "Expected 1 instance of SpaceRaceManager but found " << ObjectList<SpaceRaceManager>().size() << endl;
     63        for (SpaceRaceManager* manager : ObjectList<SpaceRaceManager>())
     64        {
     65            checkpoints = manager->getAllCheckpoints();
     66            nextRaceCheckpoint_ = manager->findCheckpoint(0);
    6767        }
    6868
     
    9898                    RaceCheckPoint* point2 = findCheckpoint((*numb));
    9999
    100                     //if(point2 != NULL)
     100                    //if(point2 != nullptr)
    101101                    //placeVirtualCheckpoints((*it), point2);
    102102                }
     
    126126        staticRacePoints_ = findStaticCheckpoints(nextRaceCheckpoint_, checkpoints);
    127127        // initialisation of currentRaceCheckpoint_
    128         currentRaceCheckpoint_ = NULL;
     128        currentRaceCheckpoint_ = nullptr;
    129129
    130130        int i;
    131         for (i = -2; findCheckpoint(i) != NULL; i--)
     131        for (i = -2; findCheckpoint(i) != nullptr; i--)
    132132        {
    133133            continue;
     
    154154    {
    155155        std::map<RaceCheckPoint*, int> zaehler; // counts how many times the checkpoint was reached (for simulation)
    156         for (unsigned int i = 0; i < allCheckpoints.size(); i++)
    157         {
    158             zaehler.insert(std::pair<RaceCheckPoint*, int>(allCheckpoints[i],0));
     156        for (RaceCheckPoint* checkpoint : allCheckpoints)
     157        {
     158            zaehler.insert(std::pair<RaceCheckPoint*, int>(checkpoint,0));
    159159        }
    160160        int maxWays = rekSimulationCheckpointsReached(currentCheckpoint, zaehler);
    161161
    162162        std::vector<RaceCheckPoint*> returnVec;
    163         for (std::map<RaceCheckPoint*, int>::iterator iter = zaehler.begin(); iter != zaehler.end(); iter++)
    164         {
    165             if (iter->second == maxWays)
    166             {
    167                 returnVec.push_back(iter->first);
     163        for (const auto& mapEntry : zaehler)
     164        {
     165            if (mapEntry.second == maxWays)
     166            {
     167                returnVec.push_back(mapEntry.first);
    168168            }
    169169        }
     
    187187        {
    188188            int numberOfWays = 0; // counts number of ways from this Point to the last point
    189             for (std::set<int>::iterator it = currentCheckpoint->getNextCheckpoints().begin(); it!= currentCheckpoint->getNextCheckpoints().end(); ++it)
    190             {
    191                 if (currentCheckpoint == findCheckpoint(*it))
     189            for (int checkpointIndex : currentCheckpoint->getNextCheckpoints())
     190            {
     191                if (currentCheckpoint == findCheckpoint(checkpointIndex))
    192192                {
    193193                    //orxout() << currentCheckpoint->getCheckpointIndex()<<endl;
    194194                    continue;
    195195                }
    196                 if (findCheckpoint(*it) == NULL)
    197                     orxout(internal_warning) << "Problematic Point: " << (*it) << endl;
     196                if (findCheckpoint(checkpointIndex) == nullptr)
     197                    orxout(internal_warning) << "Problematic Point: " << checkpointIndex << endl;
    198198                else
    199                     numberOfWays += rekSimulationCheckpointsReached(findCheckpoint(*it), zaehler);
     199                    numberOfWays += rekSimulationCheckpointsReached(findCheckpoint(checkpointIndex), zaehler);
    200200            }
    201201            zaehler[currentCheckpoint] += numberOfWays;
     
    209209    float SpaceRaceController::distanceSpaceshipToCheckPoint(RaceCheckPoint* CheckPoint)
    210210    {
    211         if (this->getControllableEntity() != NULL)
     211        if (this->getControllableEntity() != nullptr)
    212212        {
    213213            return (CheckPoint->getPosition()- this->getControllableEntity()->getPosition()).length();
     
    223223    {
    224224        float minDistance = 0;
    225         RaceCheckPoint* minNextRaceCheckPoint = NULL;
     225        RaceCheckPoint* minNextRaceCheckPoint = nullptr;
    226226
    227227        // find the next checkpoint with the minimal distance
    228         for (std::set<int>::iterator it = raceCheckpoint->getNextCheckpoints().begin(); it != raceCheckpoint->getNextCheckpoints().end(); ++it)
    229         {
    230             RaceCheckPoint* nextRaceCheckPoint = findCheckpoint(*it);
     228        for (int checkpointIndex : raceCheckpoint->getNextCheckpoints())
     229        {
     230            RaceCheckPoint* nextRaceCheckPoint = findCheckpoint(checkpointIndex);
    231231            float distance = recCalculateDistance(nextRaceCheckPoint, this->getControllableEntity()->getPosition());
    232232
    233             if (distance < minDistance || minNextRaceCheckPoint == NULL)
     233            if (distance < minDistance || minNextRaceCheckPoint == nullptr)
    234234            {
    235235                minDistance = distance;
     
    255255        {
    256256            float minimum = std::numeric_limits<float>::max();
    257             for (std::set<int>::iterator it = currentCheckPoint->getNextCheckpoints().begin(); it != currentCheckPoint->getNextCheckpoints().end(); ++it)
     257            for (int checkpointIndex : currentCheckPoint->getNextCheckpoints())
    258258            {
    259259                int dist_currentCheckPoint_currentPosition = static_cast<int> ((currentPosition- currentCheckPoint->getPosition()).length());
    260260
    261                 minimum = std::min(minimum, dist_currentCheckPoint_currentPosition + recCalculateDistance(findCheckpoint(*it), currentCheckPoint->getPosition()));
     261                minimum = std::min(minimum, dist_currentCheckPoint_currentPosition + recCalculateDistance(findCheckpoint(checkpointIndex), currentCheckPoint->getPosition()));
    262262                // minimum of distanz from 'currentPosition' to the next static Checkpoint
    263263            }
     
    271271    RaceCheckPoint* SpaceRaceController::adjustNextPoint()
    272272    {
    273         if (currentRaceCheckpoint_ == NULL) // no Adjust possible
     273        if (currentRaceCheckpoint_ == nullptr) // no Adjust possible
    274274
    275275        {
     
    289289    RaceCheckPoint* SpaceRaceController::findCheckpoint(int index) const
    290290    {
    291         for (size_t i = 0; i < this->checkpoints_.size(); ++i)
    292             if (this->checkpoints_[i]->getCheckpointIndex() == index)
    293                 return this->checkpoints_[i];
    294         return NULL;
     291        for (RaceCheckPoint* checkpoint : this->checkpoints_)
     292            if (checkpoint->getCheckpointIndex() == index)
     293                return checkpoint;
     294        return nullptr;
    295295    }
    296296
     
    299299        orxout()<<"add VCP at"<<virtualCheckPointPosition.x<<", "<<virtualCheckPointPosition.y<<", "<<virtualCheckPointPosition.z<<endl;
    300300        RaceCheckPoint* newTempRaceCheckPoint;
    301         for (ObjectList<SpaceRaceManager>::iterator it = ObjectList<SpaceRaceManager>::begin(); it!= ObjectList<SpaceRaceManager>::end(); ++it)
     301        ObjectList<SpaceRaceManager> list;
     302        for (ObjectList<SpaceRaceManager>::iterator it = list.begin(); it!= list.end(); ++it)
    302303        {
    303304            newTempRaceCheckPoint = new RaceCheckPoint((*it));
     
    347348    void SpaceRaceController::tick(float dt)
    348349    {
    349         if (this->getControllableEntity() == NULL || this->getControllableEntity()->getPlayer() == NULL )
     350        if (this->getControllableEntity() == nullptr || this->getControllableEntity()->getPlayer() == nullptr )
    350351        {
    351352            //orxout()<< this->getControllableEntity() << " in tick"<<endl;
     
    414415        btScalar radiusObject;
    415416
    416         for (std::vector<StaticEntity*>::const_iterator it = allObjects.begin(); it != allObjects.end(); ++it)
    417         {
    418             for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape) != 0; everyShape++)
    419             {
    420                 btCollisionShape* currentShape = (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape();
    421                 if(currentShape == NULL)
     417        for (StaticEntity* object : allObjects)
     418        {
     419            for (int everyShape=0; object->getAttachedCollisionShape(everyShape) != nullptr; everyShape++)
     420            {
     421                btCollisionShape* currentShape = object->getAttachedCollisionShape(everyShape)->getCollisionShape();
     422                if(currentShape == nullptr)
    422423                continue;
    423424
     
    444445        for (std::vector<StaticEntity*>::iterator it = allObjects.begin(); it != allObjects.end(); ++it)
    445446        {
    446             for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape) != 0; everyShape++)
     447            for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape) != nullptr; everyShape++)
    447448            {
    448449                btCollisionShape* currentShape = (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape();
    449                 if(currentShape == NULL)
     450                if(currentShape == nullptr)
    450451                continue;
    451452
     
    488489        std::vector<StaticEntity*> problematicObjects;
    489490
    490         for (ObjectList<StaticEntity>::iterator it = ObjectList<StaticEntity>::begin(); it!= ObjectList<StaticEntity>::end(); ++it)
    491         {
    492 
    493             if (dynamic_cast<RaceCheckPoint*>(*it) != NULL)
     491        ObjectList<StaticEntity> list;
     492        for (ObjectList<StaticEntity>::iterator it = list.begin(); it!= list.end(); ++it)
     493        {
     494
     495            if (dynamic_cast<RaceCheckPoint*>(*it) != nullptr)
    494496            {
    495497                continue;
     
    537539        //                    btVector3 positionObject;
    538540        //                    btScalar radiusObject;
    539         //                    if((*it)==NULL)
     541        //                    if((*it)==nullptr)
    540542        //                    {   orxout()<<"Problempoint 1.1"<<endl; continue;}
    541543        //                    //TODO: Probably it points on a wrong object
    542         //                    for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++)
     544        //                    for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=nullptr; everyShape++)
    543545        //                    {
    544         //                        if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==NULL)
     546        //                        if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==nullptr)
    545547        //                        {    continue;}
    546548        //
     
    570572        //                        btVector3 positionObject;
    571573        //                        btScalar radiusObject;
    572         //                        if((*it)==NULL)
     574        //                        if((*it)==nullptr)
    573575        //                        {   orxout()<<"Problempoint 1"<<endl; continue;}
    574         //                        for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++)
     576        //                        for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=nullptr; everyShape++)
    575577        //                        {
    576         //                            if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==NULL)
     578        //                            if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==nullptr)
    577579        //                            {   orxout()<<"Problempoint 2.2"<<endl; continue;}
    578580        //                            (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()->getBoundingSphere(positionObject,radiusObject);
  • code/trunk/src/modules/gametypes/SpaceRaceController.h

    r10262 r11071  
    4242            SpaceRaceController(Context* context);
    4343            virtual ~SpaceRaceController();
    44             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    45             virtual void tick(float dt);
     44            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     45            virtual void tick(float dt) override;
    4646
    4747        private:
  • code/trunk/src/modules/gametypes/SpaceRaceManager.cc

    r10624 r11071  
    5454    SpaceRaceManager::~SpaceRaceManager()
    5555    {
    56         for (size_t i = 0; i < this->checkpoints_.size(); ++i)
    57         this->checkpoints_[i]->destroy();
     56        for (RaceCheckPoint* checkpoint : this->checkpoints_)
     57        checkpoint->destroy();
    5858    }
    5959
     
    7171        this->players_ = this->race_->getPlayers();
    7272
    73         if (this->checkpoints_[0] != NULL && !this->firstcheckpointvisible_)
     73        if (this->checkpoints_[0] != nullptr && !this->firstcheckpointvisible_)
    7474        {
    7575            this->checkpoints_[0]->setRadarVisibility(true);
     
    7777        }
    7878
    79         for ( std::map< PlayerInfo*, Player>::iterator it = players_.begin(); it != players_.end(); ++it)
     79        for (const auto& mapEntry : players_)
    8080        {
    8181
    82             for (size_t i = 0; i < this->checkpoints_.size(); ++i)
     82            for (RaceCheckPoint* checkpoint : this->checkpoints_)
    8383            {
    84                 if (this->checkpoints_[i]->playerWasHere(it->first)){
    85                 this->checkpointReached(this->checkpoints_[i], it->first /*this->checkpoints_[i]->getPlayer()*/);
     84                if (checkpoint->playerWasHere(mapEntry.first)){
     85                this->checkpointReached(checkpoint, mapEntry.first /*this->checkpoints_[i]->getPlayer()*/);
    8686                }
    8787            }
     
    100100        return this->checkpoints_[index];
    101101        else
    102         return 0;
     102        return nullptr;
    103103    }
    104104
     
    113113    RaceCheckPoint* SpaceRaceManager::findCheckpoint(int index) const
    114114    {
    115         for (size_t i = 0; i < this->checkpoints_.size(); ++i)
    116         if (this->checkpoints_[i]->getCheckpointIndex() == index)
    117         return this->checkpoints_[i];
    118         return 0;
     115        for (RaceCheckPoint* checkpoint : this->checkpoints_)
     116        if (checkpoint->getCheckpointIndex() == index)
     117        return checkpoint;
     118        return nullptr;
    119119    }
    120120
    121121    bool SpaceRaceManager::reachedValidCheckpoint(RaceCheckPoint* oldCheckpoint, RaceCheckPoint* newCheckpoint, PlayerInfo* player) const
    122122    {
    123         if (oldCheckpoint != NULL)
     123        if (oldCheckpoint != nullptr)
    124124        {
    125125            // the player already visited an old checkpoint; see which checkpoints are possible now
    126126            const std::set<int>& possibleCheckpoints = oldCheckpoint->getNextCheckpoints();
    127             for (std::set<int>::const_iterator it = possibleCheckpoints.begin(); it != possibleCheckpoints.end(); ++it)
    128             if (this->findCheckpoint(*it) == newCheckpoint)
     127            for (int possibleCheckpoint : possibleCheckpoints)
     128            if (this->findCheckpoint(possibleCheckpoint) == newCheckpoint)
    129129            return true;
    130130            return false;
     
    179179        {
    180180            const std::set<int>& oldVisible = oldCheckpoint->getNextCheckpoints();
    181             for (std::set<int>::const_iterator it = oldVisible.begin(); it != oldVisible.end(); ++it)
    182             this->findCheckpoint(*it)->setRadarVisibility(false);
     181            for (int checkpointIndex : oldVisible)
     182            this->findCheckpoint(checkpointIndex)->setRadarVisibility(false);
    183183        }
    184184
     
    188188
    189189            const std::set<int>& newVisible = newCheckpoint->getNextCheckpoints();
    190             for (std::set<int>::const_iterator it = newVisible.begin(); it != newVisible.end(); ++it)
    191             this->findCheckpoint(*it)->setRadarVisibility(true);
     190            for (int checkpointIndex : newVisible)
     191            this->findCheckpoint(checkpointIndex)->setRadarVisibility(true);
    192192        }
    193193    }
  • code/trunk/src/modules/gametypes/SpaceRaceManager.h

    r9667 r11071  
    5858            virtual ~SpaceRaceManager() ;
    5959
    60             void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     60            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    6161
    6262            void addCheckpoint(RaceCheckPoint* checkpoint);
     
    6969            std::vector<RaceCheckPoint*> getAllCheckpoints();
    7070
    71             void tick(float dt);
     71            virtual void tick(float dt) override;
    7272
    7373        protected:
  • code/trunk/src/modules/hover/FlagHUD.cc

    r11043 r11071  
    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/trunk/src/modules/hover/FlagHUD.h

    r11041 r11071  
    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/trunk/src/modules/hover/Hover.cc

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

    r11043 r11071  
    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/trunk/src/modules/hover/HoverFlag.cc

    r11043 r11071  
    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
    5555        this->enableCollisionCallback();
    5656        this->setCollisionResponse(true);
    57         this->setCollisionType(Static);
     57        this->setCollisionType(CollisionType::Static);
    5858    }
    5959
  • code/trunk/src/modules/hover/HoverFlag.h

    r11042 r11071  
    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/trunk/src/modules/hover/HoverOrigin.cc

    r11040 r11071  
    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/trunk/src/modules/hover/HoverOrigin.h

    r11041 r11071  
    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/trunk/src/modules/hover/HoverShip.h

    r11041 r11071  
    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/trunk/src/modules/hover/HoverWall.cc

    r11043 r11071  
    4646        RegisterObject(HoverWall);
    4747
    48         this->model_ = NULL;
    49         this->cs_ = NULL;
     48        this->model_ = nullptr;
     49        this->cs_ = nullptr;
    5050
    5151        this->enableCollisionCallback();
    5252        this->setCollisionResponse(true);
    53         this->setCollisionType(Static);
     53        this->setCollisionType(CollisionType::Static);
    5454    }
    5555
  • code/trunk/src/modules/hover/TimeHUD.cc

    r11043 r11071  
    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/trunk/src/modules/hover/TimeHUD.h

    r11041 r11071  
    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/trunk/src/modules/invader/Invader.cc

    r11052 r11071  
    6161        RegisterObject(Invader);
    6262        this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
    63         this->center_ = 0;
     63        this->center_ = nullptr;
    6464        bEndGame = false;
    6565        lives = 3;
     
    7878    {
    7979        level++;
    80         if (getPlayer() != NULL)
     80        if (getPlayer() != nullptr)
    8181        {
    8282            for (int i = 0; i < 7; i++)
     
    103103    InvaderShip* Invader::getPlayer()
    104104    {
    105         if (player == NULL)
     105        if (player == nullptr)
    106106        {
    107             for (ObjectList<InvaderShip>::iterator it = ObjectList<InvaderShip>::begin(); it != ObjectList<InvaderShip>::end(); ++it)
    108                 player = *it;
     107            for (InvaderShip* ship : ObjectList<InvaderShip>())
     108                player = ship;
    109109        }
    110110        return player;
     
    113113    void Invader::spawnEnemy()
    114114    {
    115         if (getPlayer() == NULL)
     115        if (getPlayer() == nullptr)
    116116            return;
    117117
     
    134134            newPawn->setPosition(player->getPosition() + Vector3(500.f + 100 * i, 0, float(rand())/RAND_MAX * 400 - 200));
    135135        }
     136    }
     137
     138    void Invader::setCenterpoint(InvaderCenterPoint* center)
     139    {
     140        this->center_ = center;
    136141    }
    137142
     
    160165        this->bForceSpawn_ = true;
    161166
    162         if (this->center_ == NULL)  // abandon mission!
     167        if (this->center_ == nullptr)  // abandon mission!
    163168        {
    164169            orxout(internal_error) << "Invader: No Centerpoint specified." << endl;
  • code/trunk/src/modules/invader/Invader.h

    r10624 r11071  
    3939
    4040#include "gametypes/Deathmatch.h"
    41 
    42 #include "InvaderCenterPoint.h"
    43 
    4441#include "tools/Timer.h"
    4542
     
    5249            Invader(Context* context);
    5350
    54             virtual void start();
    55             virtual void end();
    56             virtual void addBots(unsigned int amount){} //<! overwrite function in order to bypass the addbots command
     51            virtual void start() override;
     52            virtual void end() override;
     53            virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command
    5754
    5855            void spawnEnemy();
    5956
    60             void setCenterpoint(InvaderCenterPoint* center)
    61             { this->center_ = center; }
     57            void setCenterpoint(InvaderCenterPoint* center);
    6258
    6359            int getLives(){return this->lives;}
  • code/trunk/src/modules/invader/InvaderCenterPoint.cc

    r10624 r11071  
    4949    }
    5050
    51     void InvaderCenterPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    52     {
    53         SUPER(InvaderCenterPoint, XMLPort, xmlelement, mode);
    54     }
    55 
    5651    void InvaderCenterPoint::checkGametype()
    5752    {
    58         if (this->getGametype() != NULL && this->getGametype()->isA(Class(Invader)))
     53        if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Invader)))
    5954        {
    6055            Invader* InvaderGametype = orxonox_cast<Invader*>(this->getGametype());
  • code/trunk/src/modules/invader/InvaderCenterPoint.h

    r10624 r11071  
    4747            InvaderCenterPoint(Context* context); //checks whether the gametype is actually Invader.
    4848
    49             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    50 
    5149        private:
    5250            void checkGametype();
  • code/trunk/src/modules/invader/InvaderEnemy.cc

    r10625 r11071  
    3232*/
    3333
    34 #include "invader/InvaderPrereqs.h"
    3534#include "InvaderEnemy.h"
     35
     36#include "core/CoreIncludes.h"
     37#include "Invader.h"
    3638#include "InvaderShip.h"
    3739
     
    5456            removeHealth(2000);
    5557
    56         if (player != NULL)
     58        if (player != nullptr)
    5759        {
    5860            float newZ = 2/(pow(abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * (player->getPosition().z - getPosition().z);
     
    6264    }
    6365
    64     inline bool InvaderEnemy::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
     66    inline bool InvaderEnemy::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
    6567    {
    6668        if(orxonox_cast<InvaderShip*>(otherObject))
     
    7173    Invader* InvaderEnemy::getGame()
    7274    {
    73         if (game == NULL)
     75        if (game == nullptr)
    7476        {
    75             for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it)
    76                 game = *it;
     77            for (Invader* invader : ObjectList<Invader>())
     78                game = invader;
    7779        }
    7880        return game;
     
    8284    {
    8385        Pawn::damage(damage, healthdamage, shielddamage, originator, cs);
    84         if (getGame() && orxonox_cast<InvaderShip*>(originator) != NULL && getHealth() <= 0)
     86        if (getGame() && orxonox_cast<InvaderShip*>(originator) != nullptr && getHealth() <= 0)
    8587            getGame()->addPoints(42);
    8688    }
  • code/trunk/src/modules/invader/InvaderEnemy.h

    r10625 r11071  
    3737#include "invader/InvaderPrereqs.h"
    3838
    39 #include "worldentities/pawns/SpaceShip.h"
     39#include "worldentities/pawns/Pawn.h"
    4040
    4141namespace orxonox
     
    4646            InvaderEnemy(Context* context);
    4747
    48             virtual void tick(float dt);
    49             virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
    50             virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs);
     48            virtual void tick(float dt) override;
     49            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
     50            virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) override;
    5151            virtual void setPlayer(InvaderShip* player){this->player = player;}
    5252
  • code/trunk/src/modules/invader/InvaderEnemyShooter.cc

    r10628 r11071  
    3232*/
    3333
    34 #include "invader/InvaderPrereqs.h"
    3534#include "InvaderEnemyShooter.h"
    36 // #include "worldentities/pawns/SpaceShip.h"
     35
     36#include "core/CoreIncludes.h"
     37#include "core/command/Executor.h"
     38#include "Invader.h"
     39#include "InvaderShip.h"
    3740
    3841namespace orxonox
     
    5659            removeHealth(2000);
    5760
    58         if (player != NULL)
     61        if (player != nullptr)
    5962        {
    6063            float distPlayer = player->getPosition().z - getPosition().z;
     
    7477    {
    7578        Pawn::damage(damage, healthdamage, shielddamage, originator, cs);
    76         if (getGame() && orxonox_cast<InvaderShip*>(originator) != NULL && getHealth() <= 0)
     79        if (getGame() && orxonox_cast<InvaderShip*>(originator) != nullptr && getHealth() <= 0)
    7780            getGame()->addPoints(3*42);
    7881    }
  • code/trunk/src/modules/invader/InvaderEnemyShooter.h

    r10626 r11071  
    4747            InvaderEnemyShooter(Context* context);
    4848
    49             virtual void tick(float dt);
    50             virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs);
     49            virtual void tick(float dt) override;
     50            virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) override;
    5151        protected:
    5252            void shoot();
  • code/trunk/src/modules/invader/InvaderHUDinfo.cc

    r10624 r11071  
    3030#include "core/XMLPort.h"
    3131#include "util/Convert.h"
    32 // #include "Invader.h"
     32#include "Invader.h"
    3333
    3434namespace orxonox
     
    4040        RegisterObject(InvaderHUDinfo);
    4141
    42         this->InvaderGame = 0;
     42        this->InvaderGame = nullptr;
    4343        this->bShowLives_ = false;
    4444        this->bShowLevel_ = false;
     
    132132        else
    133133        {
    134             this->InvaderGame = 0;
     134            this->InvaderGame = nullptr;
    135135        }
    136136    }
  • code/trunk/src/modules/invader/InvaderHUDinfo.h

    r9957 r11071  
    4040            InvaderHUDinfo(Context* context);
    4141
    42             virtual void tick(float dt);
    43             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    44             virtual void changedOwner();
     42            virtual void tick(float dt) override;
     43            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     44            virtual void changedOwner() override;
    4545
    4646            inline void setShowLives(bool value)
  • code/trunk/src/modules/invader/InvaderShip.cc

    r10624 r11071  
    3737#include "core/XMLPort.h"
    3838#include "Invader.h"
     39#include "InvaderEnemy.h"
     40#include "graphics/Camera.h"
     41#include "weapons/projectiles/Projectile.h"
    3942
    4043namespace orxonox
     
    9295        // Camera
    9396        Camera* camera = this->getCamera();
    94         if (camera != NULL)
     97        if (camera != nullptr)
    9598        {
    9699            camera->setPosition(Vector3(-pos.z, -posforeward, 0));
     
    139142        isFireing = bBoost;
    140143    }
    141     inline bool InvaderShip::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
     144    void InvaderShip::rotateRoll(const Vector2& value)
     145    {
     146        if (getGame())
     147            if (getGame()->bEndGame)
     148                getGame()->end();
     149    }
     150    inline bool InvaderShip::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
    142151    {
    143152        // orxout() << "touch!!! " << endl; //<< otherObject << " at " << contactPoint;
     
    145154        Projectile* shot = orxonox_cast<Projectile*>(otherObject);
    146155        // ensure that this gets only called once per enemy.
    147         if (enemy != NULL && lastEnemy != enemy)
     156        if (enemy != nullptr && lastEnemy != enemy)
    148157        {
    149158            lastEnemy = enemy;
     
    156165        }
    157166        // was shot, decrease multiplier
    158         else if (shot != NULL  && lastShot != shot)
     167        else if (shot != nullptr  && lastShot != shot)
    159168        {
    160             if (getGame() && orxonox_cast<InvaderEnemy*>(shot->getShooter()) != NULL)
     169            if (getGame() && orxonox_cast<InvaderEnemy*>(shot->getShooter()) != nullptr)
    161170            {
    162171                if (getGame()->multiplier > 1)
     
    173182    Invader* InvaderShip::getGame()
    174183    {
    175         if (game == NULL)
     184        if (game == nullptr)
    176185        {
    177             for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it)
    178                 game = *it;
     186            for (Invader* invader : ObjectList<Invader>())
     187                game = invader;
    179188        }
    180189        return game;
  • code/trunk/src/modules/invader/InvaderShip.h

    r10624 r11071  
    3737#include "invader/InvaderPrereqs.h"
    3838
     39#include "weapons/WeaponsPrereqs.h"
    3940#include "worldentities/pawns/SpaceShip.h"
    40 #include "graphics/Camera.h"
    41 #include "weapons/projectiles/Projectile.h"
    4241
    4342namespace orxonox
     
    4847            InvaderShip(Context* context);
    4948
    50             virtual void tick(float dt);
     49            virtual void tick(float dt) override;
    5150
    5251            // overwrite for 2d movement
    53             virtual void moveFrontBack(const Vector2& value);
    54             virtual void moveRightLeft(const Vector2& value);
     52            virtual void moveFrontBack(const Vector2& value) override;
     53            virtual void moveRightLeft(const Vector2& value) override;
    5554
    5655            // Starts or stops fireing
    57             virtual void boost(bool bBoost);
     56            virtual void boost(bool bBoost) override;
    5857
    5958            //no rotation!
    60             virtual void rotateYaw(const Vector2& value){};
    61             virtual void rotatePitch(const Vector2& value){};
     59            virtual void rotateYaw(const Vector2& value) override{};
     60            virtual void rotatePitch(const Vector2& value) override{};
    6261            //return to main menu if game has ended.
    63             virtual void rotateRoll(const Vector2& value){if (getGame()) if (getGame()->bEndGame) getGame()->end();};
     62            virtual void rotateRoll(const Vector2& value) override;
    6463
    6564            virtual void updateLevel();
    6665
    67             virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
     66            virtual inline bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
    6867
    6968        protected:
    70             virtual void death();
     69            virtual void death() override;
    7170        private:
    7271            Invader* getGame();
  • code/trunk/src/modules/invader/InvaderWeapon.h

    r9943 r11071  
    3535#define _InvaderWeapon_H__
    3636
     37#include "invader/InvaderPrereqs.h"
     38
     39#include "weapons/WeaponsPrereqs.h"
    3740#include "weapons/weaponmodes/HsW01.h"
    38 #include "weapons/WeaponsPrereqs.h"
    39 
    40 #include "tools/Timer.h"
    4141
    4242namespace orxonox
     
    4848            virtual ~InvaderWeapon();
    4949        protected:
    50             virtual void shot();
     50            virtual void shot() override;
    5151            WeakPtr<Projectile> projectile;
    5252    };
  • code/trunk/src/modules/invader/InvaderWeaponEnemy.cc

    r9945 r11071  
    3434#include "InvaderWeaponEnemy.h"
    3535
     36#include "core/CoreIncludes.h"
     37#include "weapons/projectiles/Projectile.h"
     38
    3639namespace orxonox
    3740{
  • code/trunk/src/modules/invader/InvaderWeaponEnemy.h

    r9943 r11071  
    3535#define _InvaderWeaponEnemy_H__
    3636
    37 // #include "weapons/weaponmodes/HsW01.h"
    38 // #include "weapons/WeaponsPrereqs.h"
    39 #include "invader/InvaderWeapon.h"
     37#include "invader/InvaderPrereqs.h"
     38
     39#include "InvaderWeapon.h"
    4040#include "tools/Timer.h"
    4141
     
    4747            InvaderWeaponEnemy(Context* context);
    4848        protected:
    49             virtual void shot();
     49            virtual void shot() override;
    5050    };
    5151}
  • code/trunk/src/modules/jump/Jump.cc

    r10262 r11071  
    3434#include "Jump.h"
    3535#include "core/CoreIncludes.h"
    36 #include "core/EventIncludes.h"
    37 #include "core/command/Executor.h"
    38 #include "core/config/ConfigValueIncludes.h"
    39 #include "gamestates/GSLevel.h"
    40 #include "chat/ChatManager.h"
     36
    4137#include "JumpCenterpoint.h"
    4238#include "JumpPlatform.h"
     
    5652#include "JumpBoots.h"
    5753#include "JumpShield.h"
     54
     55#include "gamestates/GSLevel.h"
    5856#include "infos/PlayerInfo.h"
     57#include "graphics/Camera.h"
    5958
    6059namespace orxonox
     
    6665        RegisterObject(Jump);
    6766
    68         center_ = 0;
    69         figure_ = 0;
    70         camera = 0;
     67        center_ = nullptr;
     68        figure_ = nullptr;
     69        camera = nullptr;
    7170        setHUDTemplate("JumpHUD");
    72 
    73         setConfigValues();
    7471    }
    7572
     
    8683        SUPER(Jump, tick, dt);
    8784
    88         if (figure_ != NULL)
     85        if (figure_ != nullptr)
    8986        {
    9087            Vector3 figurePosition = figure_->getPosition();
     
    10198                if (screenShiftSinceLastUpdate_ > center_->getSectionLength())
    10299                {
    103                     if (sectionNumber_ > 2 && sectionNumber_%4 == 0 && rand()%2 == 0 && figure_->propellerActive_ == false && figure_->rocketActive_ == false && addAdventure(adventureNumber_) == true)
     100                    if (sectionNumber_ > 2 && sectionNumber_%4 == 0 && rand()%2 == 0 && figure_->propellerActive_ == nullptr && figure_->rocketActive_ == nullptr && addAdventure(adventureNumber_) == true)
    104101                    {
    105102                        screenShiftSinceLastUpdate_ -= 2*center_->getSectionLength();
     
    133130
    134131
    135             if (camera != NULL)
     132            if (camera != nullptr)
    136133            {
    137134                Vector3 cameraPosition = Vector3(0, totalScreenShift_, 0);
     
    144141        }
    145142
    146         ObjectList<JumpPlatform>::iterator beginPlatform = ObjectList<JumpPlatform>::begin();
    147         ObjectList<JumpPlatform>::iterator endPlatform = ObjectList<JumpPlatform>::end();
    148         ObjectList<JumpPlatform>::iterator itPlatform = beginPlatform;
     143        ObjectList<JumpPlatform> listPlatform;
     144        ObjectList<JumpPlatform>::iterator itPlatform = listPlatform.begin();
    149145        Vector3 platformPosition;
    150146
    151         while (itPlatform != endPlatform)
     147        while (itPlatform != listPlatform.end())
    152148        {
    153149            platformPosition = itPlatform->getPosition();
     
    166162
    167163        // Deleted deactivated platforms
    168         ObjectList<JumpPlatformDisappear>::iterator beginDisappear = ObjectList<JumpPlatformDisappear>::begin();
    169         ObjectList<JumpPlatformDisappear>::iterator endDisappear = ObjectList<JumpPlatformDisappear>::end();
    170         ObjectList<JumpPlatformDisappear>::iterator itDisappear = beginDisappear;
    171 
    172         while (itDisappear != endDisappear)
     164        ObjectList<JumpPlatformDisappear> listDisappear;
     165        ObjectList<JumpPlatformDisappear>::iterator itDisappear = listDisappear.begin();
     166
     167        while (itDisappear != listDisappear.end())
    173168        {
    174169            if (!itDisappear->isActive())
     
    185180        }
    186181
    187         ObjectList<JumpPlatformTimer>::iterator beginTimer = ObjectList<JumpPlatformTimer>::begin();
    188         ObjectList<JumpPlatformTimer>::iterator endTimer = ObjectList<JumpPlatformTimer>::end();
    189         ObjectList<JumpPlatformTimer>::iterator itTimer = beginTimer;
    190 
    191         while (itTimer != endTimer)
     182        ObjectList<JumpPlatformTimer> listTimer;
     183        ObjectList<JumpPlatformTimer>::iterator itTimer = listTimer.begin();
     184
     185        while (itTimer != listTimer.end())
    192186        {
    193187            if (!itTimer->isActive())
     
    204198        }
    205199
    206         ObjectList<JumpProjectile>::iterator beginProjectile = ObjectList<JumpProjectile>::begin();
    207         ObjectList<JumpProjectile>::iterator endProjectile = ObjectList<JumpProjectile>::end();
    208         ObjectList<JumpProjectile>::iterator itProjectile = beginProjectile;
     200        ObjectList<JumpProjectile> listProjectile;
     201        ObjectList<JumpProjectile>::iterator itProjectile = listProjectile.begin();
    209202        Vector3 projectilePosition;
    210203
    211         while (itProjectile != endProjectile)
     204        while (itProjectile != listProjectile.end())
    212205        {
    213206            projectilePosition = itProjectile->getPosition();
     
    225218        }
    226219
    227         ObjectList<JumpEnemy>::iterator beginEnemy = ObjectList<JumpEnemy>::begin();
    228         ObjectList<JumpEnemy>::iterator endEnemy = ObjectList<JumpEnemy>::end();
    229         ObjectList<JumpEnemy>::iterator itEnemy = beginEnemy;
     220        ObjectList<JumpEnemy> listEnemy;
     221        ObjectList<JumpEnemy>::iterator itEnemy = listEnemy.begin();
    230222        Vector3 enemyPosition;
    231223
    232         while (itEnemy != endEnemy)
     224        while (itEnemy != listEnemy.end())
    233225        {
    234226            enemyPosition = itEnemy->getPosition();
     
    246238        }
    247239
    248         ObjectList<JumpItem>::iterator beginItem = ObjectList<JumpItem>::begin();
    249         ObjectList<JumpItem>::iterator endItem = ObjectList<JumpItem>::end();
    250         ObjectList<JumpItem>::iterator itItem = beginItem;
     240        ObjectList<JumpItem> listItem;
     241        ObjectList<JumpItem>::iterator itItem = listItem.begin();
    251242        Vector3 itemPosition;
    252243
    253         while (itItem != endItem)
     244        while (itItem != listItem.end())
    254245        {
    255246            itemPosition = itItem->getPosition();
     
    273264    void Jump::cleanup()
    274265    {
    275         camera = 0;
     266        camera = nullptr;
    276267    }
    277268
    278269    void Jump::start()
    279270    {
    280         if (center_ != NULL) // There needs to be a JumpCenterpoint, i.e. the area the game takes place.
    281         {
    282             if (figure_ == NULL)
     271        if (center_ != nullptr) // There needs to be a JumpCenterpoint, i.e. the area the game takes place.
     272        {
     273            if (figure_ == nullptr)
    283274            {
    284275                figure_ = new JumpFigure(center_->getContext());
     
    301292        Deathmatch::start();
    302293
    303         if (figure_ != NULL)
     294        if (figure_ != nullptr)
    304295        {
    305296            camera = figure_->getCamera();
     
    328319        assert(player);
    329320
    330         if (figure_->getPlayer() == NULL)
     321        if (figure_->getPlayer() == nullptr)
    331322        {
    332323            player->startControl(figure_);
     
    337328    PlayerInfo* Jump::getPlayer() const
    338329    {
    339         if (this->figure_ != NULL)
     330        if (this->figure_ != nullptr)
    340331        {
    341332            return this->figure_->getPlayer();
     
    343334        else
    344335        {
    345             return 0;
     336            return nullptr;
    346337        }
    347338    }
     
    349340    void Jump::addPlatform(JumpPlatform* newPlatform, std::string platformTemplate, float xPosition, float zPosition)
    350341    {
    351         if (newPlatform != NULL && center_ != NULL)
     342        if (newPlatform != nullptr && center_ != nullptr)
    352343        {
    353344            newPlatform->addTemplate(platformTemplate);
     
    417408    {
    418409        JumpProjectile* newProjectile = new JumpProjectile(center_->getContext());
    419         if (newProjectile != NULL && center_ != NULL)
     410        if (newProjectile != nullptr && center_ != nullptr)
    420411        {
    421412            newProjectile->addTemplate(center_->getProjectileTemplate());
     
    430421    {
    431422        JumpSpring* newSpring = new JumpSpring(center_->getContext());
    432         if (newSpring != NULL && center_ != NULL)
     423        if (newSpring != nullptr && center_ != nullptr)
    433424        {
    434425            newSpring->addTemplate(center_->getSpringTemplate());
     
    443434    {
    444435        JumpSpring* newSpring = new JumpSpring(center_->getContext());
    445         if (newSpring != NULL && center_ != NULL)
     436        if (newSpring != nullptr && center_ != nullptr)
    446437        {
    447438            newSpring->addTemplate(center_->getSpringTemplate());
     
    456447    {
    457448        JumpRocket* newRocket = new JumpRocket(center_->getContext());
    458         if (newRocket != NULL && center_ != NULL)
     449        if (newRocket != nullptr && center_ != nullptr)
    459450        {
    460451            newRocket->addTemplate(center_->getRocketTemplate());
     
    469460    {
    470461        JumpRocket* newRocket = new JumpRocket(center_->getContext());
    471         if (newRocket != NULL && center_ != NULL)
     462        if (newRocket != nullptr && center_ != nullptr)
    472463        {
    473464            newRocket->addTemplate(center_->getRocketTemplate());
     
    482473    {
    483474        JumpPropeller* newPropeller = new JumpPropeller(center_->getContext());
    484         if (newPropeller != NULL && center_ != NULL)
     475        if (newPropeller != nullptr && center_ != nullptr)
    485476        {
    486477            newPropeller->addTemplate(center_->getPropellerTemplate());
     
    495486    {
    496487        JumpPropeller* newPropeller = new JumpPropeller(center_->getContext());
    497         if (newPropeller != NULL && center_ != NULL)
     488        if (newPropeller != nullptr && center_ != nullptr)
    498489        {
    499490            newPropeller->addTemplate(center_->getPropellerTemplate());
     
    508499    {
    509500        JumpBoots* newBoots = new JumpBoots(center_->getContext());
    510         if (newBoots != NULL && center_ != NULL)
     501        if (newBoots != nullptr && center_ != nullptr)
    511502        {
    512503            newBoots->addTemplate(center_->getBootsTemplate());
     
    521512    {
    522513        JumpBoots* newBoots = new JumpBoots(center_->getContext());
    523         if (newBoots != NULL && center_ != NULL)
     514        if (newBoots != nullptr && center_ != nullptr)
    524515        {
    525516            newBoots->addTemplate(center_->getBootsTemplate());
     
    534525    {
    535526        JumpShield* newShield = new JumpShield(center_->getContext());
    536         if (newShield != NULL && center_ != NULL)
     527        if (newShield != nullptr && center_ != nullptr)
    537528        {
    538529            newShield->addTemplate(center_->getShieldTemplate());
     
    547538    {
    548539        JumpShield* newShield = new JumpShield(center_->getContext());
    549         if (newShield != NULL && center_ != NULL)
     540        if (newShield != nullptr && center_ != nullptr)
    550541        {
    551542            newShield->addTemplate(center_->getShieldTemplate());
     
    560551    {
    561552        JumpEnemy* newEnemy = new JumpEnemy(center_->getContext());
    562         if (newEnemy != NULL && center_ != NULL)
     553        if (newEnemy != nullptr && center_ != nullptr)
    563554        {
    564555            switch (type)
     
    619610        const int numJ = 4;
    620611
    621         enum PlatformType
    622         {
    623             PLATFORM_EMPTY, PLATFORM_STATIC, PLATFORM_HMOVE, PLATFORM_VMOVE, PLATFORM_DISAPPEAR, PLATFORM_TIMER, PLATFORM_FAKE
     612        enum class PlatformType
     613        {
     614            EMPTY, STATIC, HMOVE, VMOVE, DISAPPEAR, TIMER, FAKE
    624615        };
    625616
    626         enum ItemType
    627         {
    628             ITEM_NOTHING, ITEM_SPRING, ITEM_PROPELLER, ITEM_ROCKET, ITEM_BOOTS, ITEM_SHIELD
     617        enum class ItemType
     618        {
     619            NOTHING, SPRING, PROPELLER, ROCKET, BOOTS, SHIELD
    629620        };
    630621
     
    640631            for (int j = 0; j < numJ; ++j)
    641632            {
    642                 matrix[i][j].type = PLATFORM_EMPTY;
     633                matrix[i][j].type = PlatformType::EMPTY;
    643634                matrix[i][j].done = false;
    644635            }
     
    646637        PlatformType platformtype1;
    647638        PlatformType platformtype2;
    648         ItemType itemType = ITEM_NOTHING;
     639        ItemType itemType = ItemType::NOTHING;
    649640
    650641        if (rand()%2 == 0)
    651642        {
    652             itemType = ITEM_SPRING;
     643            itemType = ItemType::SPRING;
    653644        }
    654645        else if (rand()%2 == 0 && sectionNumber_ > 3)
     
    657648            {
    658649            case 0:
    659                 itemType = ITEM_PROPELLER;
     650                itemType = ItemType::PROPELLER;
    660651                break;
    661652            case 1:
    662                 itemType = ITEM_ROCKET;
     653                itemType = ItemType::ROCKET;
    663654                break;
    664655            case 2:
    665                 itemType = ITEM_BOOTS;
     656                itemType = ItemType::BOOTS;
    666657                break;
    667658            case 3:
    668                 itemType = ITEM_SHIELD;
     659                itemType = ItemType::SHIELD;
    669660                break;
    670661            default:
     
    676667        {
    677668        case 0:
    678             platformtype1 = PLATFORM_STATIC;
    679             platformtype2 = PLATFORM_STATIC;
     669            platformtype1 = PlatformType::STATIC;
     670            platformtype2 = PlatformType::STATIC;
    680671            break;
    681672        case 1:
    682             platformtype1 = PLATFORM_STATIC;
    683             platformtype2 = PLATFORM_STATIC;
     673            platformtype1 = PlatformType::STATIC;
     674            platformtype2 = PlatformType::STATIC;
    684675            break;
    685676        case 2:
    686             platformtype1 = PLATFORM_STATIC;
    687             platformtype2 = PLATFORM_HMOVE;
     677            platformtype1 = PlatformType::STATIC;
     678            platformtype2 = PlatformType::HMOVE;
    688679            break;
    689680        case 3:
    690             platformtype1 = PLATFORM_STATIC;
    691             platformtype2 = PLATFORM_DISAPPEAR;
     681            platformtype1 = PlatformType::STATIC;
     682            platformtype2 = PlatformType::DISAPPEAR;
    692683            break;
    693684        case 4:
    694             platformtype1 = PLATFORM_STATIC;
    695             platformtype2 = PLATFORM_VMOVE;
     685            platformtype1 = PlatformType::STATIC;
     686            platformtype2 = PlatformType::VMOVE;
    696687            break;
    697688        case 5:
    698             platformtype1 = PLATFORM_STATIC;
    699             platformtype2 = PLATFORM_TIMER;
     689            platformtype1 = PlatformType::STATIC;
     690            platformtype2 = PlatformType::TIMER;
    700691            break;
    701692        case 6:
    702             platformtype1 = PLATFORM_HMOVE;
    703             platformtype2 = PLATFORM_STATIC;
     693            platformtype1 = PlatformType::HMOVE;
     694            platformtype2 = PlatformType::STATIC;
    704695            break;
    705696        case 7:
    706             platformtype1 = PLATFORM_HMOVE;
    707             platformtype2 = PLATFORM_HMOVE;
     697            platformtype1 = PlatformType::HMOVE;
     698            platformtype2 = PlatformType::HMOVE;
    708699            break;
    709700        case 8:
    710             platformtype1 = PLATFORM_HMOVE;
    711             platformtype2 = PLATFORM_HMOVE;
     701            platformtype1 = PlatformType::HMOVE;
     702            platformtype2 = PlatformType::HMOVE;
    712703            break;
    713704        case 9:
    714             platformtype1 = PLATFORM_HMOVE;
    715             platformtype2 = PLATFORM_DISAPPEAR;
     705            platformtype1 = PlatformType::HMOVE;
     706            platformtype2 = PlatformType::DISAPPEAR;
    716707            break;
    717708        case 10:
    718             platformtype1 = PLATFORM_HMOVE;
    719             platformtype2 = PLATFORM_VMOVE;
     709            platformtype1 = PlatformType::HMOVE;
     710            platformtype2 = PlatformType::VMOVE;
    720711            break;
    721712        case 11:
    722             platformtype1 = PLATFORM_HMOVE;
    723             platformtype2 = PLATFORM_TIMER;
     713            platformtype1 = PlatformType::HMOVE;
     714            platformtype2 = PlatformType::TIMER;
    724715            break;
    725716        case 12:
    726             platformtype1 = PLATFORM_DISAPPEAR;
    727             platformtype2 = PLATFORM_STATIC;
     717            platformtype1 = PlatformType::DISAPPEAR;
     718            platformtype2 = PlatformType::STATIC;
    728719            break;
    729720        case 13:
    730             platformtype1 = PLATFORM_DISAPPEAR;
    731             platformtype2 = PLATFORM_HMOVE;
     721            platformtype1 = PlatformType::DISAPPEAR;
     722            platformtype2 = PlatformType::HMOVE;
    732723            break;
    733724        case 14:
    734             platformtype1 = PLATFORM_DISAPPEAR;
    735             platformtype2 = PLATFORM_DISAPPEAR;
     725            platformtype1 = PlatformType::DISAPPEAR;
     726            platformtype2 = PlatformType::DISAPPEAR;
    736727            break;
    737728        case 15:
    738             platformtype1 = PLATFORM_DISAPPEAR;
    739             platformtype2 = PLATFORM_DISAPPEAR;
     729            platformtype1 = PlatformType::DISAPPEAR;
     730            platformtype2 = PlatformType::DISAPPEAR;
    740731            break;
    741732        case 16:
    742             platformtype1 = PLATFORM_DISAPPEAR;
    743             platformtype2 = PLATFORM_VMOVE;
     733            platformtype1 = PlatformType::DISAPPEAR;
     734            platformtype2 = PlatformType::VMOVE;
    744735            break;
    745736        case 17:
    746             platformtype1 = PLATFORM_DISAPPEAR;
    747             platformtype2 = PLATFORM_TIMER;
     737            platformtype1 = PlatformType::DISAPPEAR;
     738            platformtype2 = PlatformType::TIMER;
    748739            break;
    749740        case 18:
    750             platformtype1 = PLATFORM_VMOVE;
    751             platformtype2 = PLATFORM_STATIC;
     741            platformtype1 = PlatformType::VMOVE;
     742            platformtype2 = PlatformType::STATIC;
    752743            break;
    753744        case 19:
    754             platformtype1 = PLATFORM_VMOVE;
    755             platformtype2 = PLATFORM_HMOVE;
     745            platformtype1 = PlatformType::VMOVE;
     746            platformtype2 = PlatformType::HMOVE;
    756747            break;
    757748        case 20:
    758             platformtype1 = PLATFORM_VMOVE;
    759             platformtype2 = PLATFORM_DISAPPEAR;
     749            platformtype1 = PlatformType::VMOVE;
     750            platformtype2 = PlatformType::DISAPPEAR;
    760751            break;
    761752        case 21:
    762             platformtype1 = PLATFORM_VMOVE;
    763             platformtype2 = PLATFORM_VMOVE;
     753            platformtype1 = PlatformType::VMOVE;
     754            platformtype2 = PlatformType::VMOVE;
    764755            break;
    765756        case 22:
    766             platformtype1 = PLATFORM_VMOVE;
    767             platformtype2 = PLATFORM_VMOVE;
     757            platformtype1 = PlatformType::VMOVE;
     758            platformtype2 = PlatformType::VMOVE;
    768759            break;
    769760        case 23:
    770             platformtype1 = PLATFORM_VMOVE;
    771             platformtype2 = PLATFORM_TIMER;
     761            platformtype1 = PlatformType::VMOVE;
     762            platformtype2 = PlatformType::TIMER;
    772763            break;
    773764        case 24:
    774             platformtype1 = PLATFORM_TIMER;
    775             platformtype2 = PLATFORM_STATIC;
     765            platformtype1 = PlatformType::TIMER;
     766            platformtype2 = PlatformType::STATIC;
    776767            break;
    777768        case 25:
    778             platformtype1 = PLATFORM_TIMER;
    779             platformtype2 = PLATFORM_HMOVE;
     769            platformtype1 = PlatformType::TIMER;
     770            platformtype2 = PlatformType::HMOVE;
    780771            break;
    781772        case 26:
    782             platformtype1 = PLATFORM_TIMER;
    783             platformtype2 = PLATFORM_DISAPPEAR;
     773            platformtype1 = PlatformType::TIMER;
     774            platformtype2 = PlatformType::DISAPPEAR;
    784775            break;
    785776        case 27:
    786             platformtype1 = PLATFORM_TIMER;
    787             platformtype2 = PLATFORM_VMOVE;
     777            platformtype1 = PlatformType::TIMER;
     778            platformtype2 = PlatformType::VMOVE;
    788779            break;
    789780        case 28:
    790             platformtype1 = PLATFORM_TIMER;
    791             platformtype2 = PLATFORM_TIMER;
     781            platformtype1 = PlatformType::TIMER;
     782            platformtype2 = PlatformType::TIMER;
    792783            break;
    793784        default:
    794             platformtype1 = PLATFORM_TIMER;
    795             platformtype2 = PLATFORM_TIMER;
     785            platformtype1 = PlatformType::TIMER;
     786            platformtype2 = PlatformType::TIMER;
    796787            break;
    797788        }
     
    816807        if (platformtype1 == platformtype2 && sectionNumber_ > 10 && rand()%2 == 0)
    817808        {
    818             matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    819             matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
     809            matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     810            matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
    820811        }
    821812
     
    825816            if (rand()%2 == 0)
    826817            {
    827                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    828             }
    829             else
    830             {
    831                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     818                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     819            }
     820            else
     821            {
     822                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    832823            }
    833824        }
     
    836827            if (rand()%2 == 0)
    837828            {
    838                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    839             }
    840             else
    841             {
    842                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     829                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     830            }
     831            else
     832            {
     833                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    843834            }
    844835            if (rand()%2 == 0)
    845836            {
    846                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    847             }
    848             else
    849             {
    850                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     837                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     838            }
     839            else
     840            {
     841                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    851842            }
    852843        }
     
    855846            if (rand()%2 == 0)
    856847            {
    857                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    858             }
    859             else
    860             {
    861                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     848                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     849            }
     850            else
     851            {
     852                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    862853            }
    863854            if (rand()%2 == 0)
    864855            {
    865                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    866             }
    867             else
    868             {
    869                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     856                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     857            }
     858            else
     859            {
     860                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    870861            }
    871862            if (rand()%2 == 0)
    872863            {
    873                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    874             }
    875             else
    876             {
    877                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     864                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     865            }
     866            else
     867            {
     868                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    878869            }
    879870        }
     
    898889                    switch(matrix[i][j].type)
    899890                    {
    900                     case PLATFORM_EMPTY:
     891                    case PlatformType::EMPTY:
    901892                        matrix[i][j].done = true;
    902893                        break;
    903                     case PLATFORM_STATIC:
     894                    case PlatformType::STATIC:
    904895                        xPosition = randomXPosition(numJ, j);
    905896                        zPosition = sectionBegin + i*sectionLength/numI;
     
    907898                        matrix[i][j].done = true;
    908899                        break;
    909                     case PLATFORM_FAKE:
     900                    case PlatformType::FAKE:
    910901                        xPosition = randomXPosition(numJ, j);
    911902                        zPosition = sectionBegin + i*sectionLength/numI;
     
    913904                        matrix[i][j].done = true;
    914905                        break;
    915                     case PLATFORM_TIMER:
     906                    case PlatformType::TIMER:
    916907                        xPosition = randomXPosition(numJ, j);
    917908                        zPosition = sectionBegin + i*sectionLength/numI;
     
    919910                        matrix[i][j].done = true;
    920911                        break;
    921                     case PLATFORM_DISAPPEAR:
     912                    case PlatformType::DISAPPEAR:
    922913                        xPosition = randomXPosition(numJ, j);
    923914                        zPosition = sectionBegin + i*sectionLength/numI;
     
    925916                        matrix[i][j].done = true;
    926917                        break;
    927                     case PLATFORM_HMOVE:
     918                    case PlatformType::HMOVE:
    928919                        xVelocity = randomSpeed();
    929                         if (j <= numJ-3 && matrix[i][j+1].type == PLATFORM_HMOVE && matrix[i][j+2].type == PLATFORM_HMOVE && rand()%2 == 0)
     920                        if (j <= numJ-3 && matrix[i][j+1].type == PlatformType::HMOVE && matrix[i][j+2].type == PlatformType::HMOVE && rand()%2 == 0)
    930921                        {
    931922                            leftBoundary = randomXPositionLeft(numJ, j);
     
    938929                            matrix[i][j+2].done = true;
    939930                        }
    940                         else if (j <= numJ-2 && matrix[i][j+1].type == PLATFORM_HMOVE && rand()%2 == 0)
     931                        else if (j <= numJ-2 && matrix[i][j+1].type == PlatformType::HMOVE && rand()%2 == 0)
    941932                        {
    942933                            leftBoundary = randomXPositionLeft(numJ, j);
     
    958949                        }
    959950                        break;
    960                     case PLATFORM_VMOVE:
     951                    case PlatformType::VMOVE:
    961952                        zVelocity = randomSpeed();
    962                         if (i <= numI-3 && matrix[i+1][j].type == PLATFORM_VMOVE && matrix[i+2][j].type == PLATFORM_VMOVE && rand()%2 == 0)
     953                        if (i <= numI-3 && matrix[i+1][j].type == PlatformType::VMOVE && matrix[i+2][j].type == PlatformType::VMOVE && rand()%2 == 0)
    963954                        {
    964955                            lowerBoundary = randomZPositionLower(numI, i, sectionBegin, sectionEnd);
     
    971962                            matrix[i+2][j].done = true;
    972963                        }
    973                         else if (i <= numI-2 && matrix[i+1][j].type == PLATFORM_VMOVE && rand()%2 == 0)
     964                        else if (i <= numI-2 && matrix[i+1][j].type == PlatformType::VMOVE && rand()%2 == 0)
    974965                        {
    975966                            lowerBoundary = randomZPositionLower(numI, i, sectionBegin, sectionEnd);
     
    10091000                switch (itemType)
    10101001                {
    1011                 case ITEM_ROCKET:
     1002                case ItemType::ROCKET:
    10121003                    addRocket(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0);
    10131004                    break;
    1014                 case ITEM_PROPELLER:
     1005                case ItemType::PROPELLER:
    10151006                    addPropeller(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0);
    10161007                    break;
    1017                 case ITEM_BOOTS:
     1008                case ItemType::BOOTS:
    10181009                    addBoots(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0);
    10191010                    break;
    1020                 case ITEM_SHIELD:
     1011                case ItemType::SHIELD:
    10211012                    addShield(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0);
    10221013                    break;
     
    10291020                switch (itemType)
    10301021                {
    1031                 case ITEM_ROCKET:
     1022                case ItemType::ROCKET:
    10321023                    addRocket(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed());
    10331024                    break;
    1034                 case ITEM_PROPELLER:
     1025                case ItemType::PROPELLER:
    10351026                    addPropeller(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed());
    10361027                    break;
    1037                 case ITEM_BOOTS:
     1028                case ItemType::BOOTS:
    10381029                    addBoots(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed());
    10391030                    break;
    1040                 case ITEM_SHIELD:
     1031                case ItemType::SHIELD:
    10411032                    addShield(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed());
    10421033                    break;
     
    10541045                switch (itemType)
    10551046                {
    1056                 case ITEM_SPRING:
     1047                case ItemType::SPRING:
    10571048                    addSpring(itemPlatform);
    10581049                    break;
    1059                 case ITEM_ROCKET:
     1050                case ItemType::ROCKET:
    10601051                    addRocket(itemPlatform);
    10611052                    break;
    1062                 case ITEM_PROPELLER:
     1053                case ItemType::PROPELLER:
    10631054                    addPropeller(itemPlatform);
    10641055                    break;
    1065                 case ITEM_BOOTS:
     1056                case ItemType::BOOTS:
    10661057                    addBoots(itemPlatform);
    10671058                    break;
    1068                 case ITEM_SHIELD:
     1059                case ItemType::SHIELD:
    10691060                    addShield(itemPlatform);
    10701061                    break;
     
    12731264    float Jump::getFuel() const
    12741265    {
    1275         if (this->figure_ != NULL)
    1276         {
    1277             if (this->figure_->rocketActive_ != NULL)
     1266        if (this->figure_ != nullptr)
     1267        {
     1268            if (this->figure_->rocketActive_ != nullptr)
    12781269            {
    12791270                return this->figure_->rocketActive_->getFuelState();
    12801271            }
    1281             else if (this->figure_->propellerActive_ != NULL)
     1272            else if (this->figure_->propellerActive_ != nullptr)
    12821273            {
    12831274                return this->figure_->propellerActive_->getFuelState();
    12841275            }
    1285             else if (this->figure_->shieldActive_ != NULL)
     1276            else if (this->figure_->shieldActive_ != nullptr)
    12861277            {
    12871278                return this->figure_->shieldActive_->getFuelState();
    12881279            }
    1289             else if (this->figure_->bootsActive_ != NULL)
     1280            else if (this->figure_->bootsActive_ != nullptr)
    12901281            {
    12911282                return this->figure_->bootsActive_->getFuelState();
     
    13001291        return figure_->dead_;
    13011292    }
     1293
     1294    void Jump::setCenterpoint(JumpCenterpoint* center)
     1295    {
     1296        center_ = center;
     1297    }
     1298
    13021299}
  • code/trunk/src/modules/jump/Jump.h

    r10262 r11071  
    3131
    3232#include "jump/JumpPrereqs.h"
    33 #include "tools/Timer.h"
    34 #include "graphics/Camera.h"
    3533#include "gametypes/Deathmatch.h"
    36 #include "JumpCenterpoint.h"
    37 #include <list>
    3834
    3935namespace orxonox
     
    4440            Jump(Context* context);
    4541            virtual ~Jump();
    46             virtual void tick(float dt);
    47             virtual void start();
    48             virtual void end();
    49             virtual void spawnPlayer(PlayerInfo* player);
     42            virtual void tick(float dt) override;
     43            virtual void start() override;
     44            virtual void end() override;
     45            virtual void spawnPlayer(PlayerInfo* player) override;
    5046            int getScore(PlayerInfo* player) const;
    5147            float getFuel() const;
    5248            bool getDead(PlayerInfo* player) const;
    53             void setCenterpoint(JumpCenterpoint* center)
    54                 { center_ = center; }
     49            void setCenterpoint(JumpCenterpoint* center);
    5550            PlayerInfo* getPlayer() const;
    5651
  • code/trunk/src/modules/jump/JumpBoots.cc

    r10262 r11071  
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "core/GameMode.h"
    38 #include "graphics/Model.h"
    39 #include "gametypes/Gametype.h"
    40 
    4137#include "JumpFigure.h"
    42 
    43 #include "sound/WorldSound.h"
    44 #include "core/XMLPort.h"
    4538
    4639namespace orxonox
     
    6760    }
    6861
    69     void JumpBoots::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    70     {
    71         SUPER(JumpBoots, XMLPort, xmlelement, mode);
    72     }
    73 
    7462    void JumpBoots::tick(float dt)
    7563    {
     
    7866        Vector3 rocketPosition = getWorldPosition();
    7967
    80         if (attachedToFigure_ == false && figure_ != NULL)
     68        if (attachedToFigure_ == false && figure_ != nullptr)
    8169        {
    8270            Vector3 figurePosition = figure_->getWorldPosition();
  • code/trunk/src/modules/jump/JumpBoots.h

    r10262 r11071  
    3030#define _JumpBoots_H__
    3131
    32 #include "jump/JumpPrereqs.h"
    33 #include "util/Math.h"
    34 #include "worldentities/MovableEntity.h"
    35 
     32#include "JumpPrereqs.h"
     33#include "JumpItem.h"
    3634
    3735namespace orxonox
     
    4240            JumpBoots(Context* context);
    4341            virtual ~JumpBoots();
    44             virtual void tick(float dt);
    45             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    46             virtual void touchFigure();
     42            virtual void tick(float dt) override;
     43            virtual void touchFigure() override;
    4744            virtual float getFuelState();
    4845        protected:
  • code/trunk/src/modules/jump/JumpCenterpoint.cc

    r10624 r11071  
    3333
    3434#include "JumpCenterpoint.h"
     35
    3536#include "core/CoreIncludes.h"
    3637#include "core/XMLPort.h"
     
    8283    void JumpCenterpoint::checkGametype()
    8384    {
    84         if (getGametype() != NULL && this->getGametype()->isA(Class(Jump)))
     85        if (getGametype() != nullptr && this->getGametype()->isA(Class(Jump)))
    8586        {
    8687            Jump* jumpGametype = orxonox_cast<Jump*>(this->getGametype());
  • code/trunk/src/modules/jump/JumpCenterpoint.h

    r10624 r11071  
    3131
    3232#include "jump/JumpPrereqs.h"
    33 
    34 #include <string>
    35 
    36 #include <util/Math.h>
    37 
    3833#include "worldentities/StaticEntity.h"
    3934
     
    113108            JumpCenterpoint(Context* context); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually Jump.
    114109            virtual ~JumpCenterpoint() {}
    115             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method to create a JumpCenterpoint through XML.
     110            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method to create a JumpCenterpoint through XML.
    116111            void setPlatformStaticTemplate(const std::string& balltemplate)
    117112                { this->platformStaticTemplate_ = balltemplate; }
  • code/trunk/src/modules/jump/JumpEnemy.cc

    r10624 r11071  
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "core/GameMode.h"
    38 #include "graphics/Model.h"
    39 #include "gametypes/Gametype.h"
    40 
     37#include "core/XMLPort.h"
    4138#include "JumpFigure.h"
    42 
    43 #include "sound/WorldSound.h"
    44 #include "core/XMLPort.h"
    4539
    4640namespace orxonox
     
    5751
    5852        dead_ = false;
    59         figure_ = 0;
     53        figure_ = nullptr;
    6054        width_ = 0.0;
    6155        height_ = 0.0;
     
    125119        Vector3 enemyPosition = getPosition();
    126120
    127         if (figure_ != NULL)
     121        if (figure_ != nullptr)
    128122        {
    129123            Vector3 figurePosition = figure_->getPosition();
  • code/trunk/src/modules/jump/JumpEnemy.h

    r10624 r11071  
    3737
    3838#include "jump/JumpPrereqs.h"
    39 
    40 #include "util/Math.h"
    41 
    4239#include "worldentities/MovableEntity.h"
    43 
    4440
    4541namespace orxonox
     
    5046            JumpEnemy(Context* context);
    5147            virtual ~JumpEnemy();
    52             virtual void tick(float dt);
    53             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     48            virtual void tick(float dt) override;
     49            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    5450            void setFieldDimension(float width, float height)
    5551                { this->fieldWidth_ = width; this->fieldHeight_ = height; }
  • code/trunk/src/modules/jump/JumpFigure.cc

    r10262 r11071  
    3636#include "core/CoreIncludes.h"
    3737#include "core/XMLPort.h"
     38#include "graphics/Model.h"
     39#include "JumpRocket.h"
     40#include "JumpPropeller.h"
     41#include "JumpBoots.h"
     42#include "JumpShield.h"
    3843
    3944namespace orxonox
     
    4651
    4752        // initialize variables
    48         leftHand_ = NULL;
    49         rightHand_ = NULL;
     53        leftHand_ = nullptr;
     54        rightHand_ = nullptr;
    5055        fieldHeight_ = 0;
    5156        fieldWidth_ = 0;
     
    7075        animateHands_ = false;
    7176        turnUp_ = false;
    72         rocketActive_ = NULL;
    73         propellerActive_ = NULL;
    74         bootsActive_ = NULL;
    75         shieldActive_ = NULL;
     77        rocketActive_ = nullptr;
     78        propellerActive_ = nullptr;
     79        bootsActive_ = nullptr;
     80        shieldActive_ = nullptr;
    7681        rocketSpeed_ = 0.0;
    7782        propellerSpeed_ = 0.0;
     
    106111            // Move up/down
    107112            Vector3 velocity = getVelocity();
    108             if (rocketActive_ != NULL)
     113            if (rocketActive_ != nullptr)
    109114            {
    110115                velocity.z = rocketSpeed_;
    111116            }
    112             else if (propellerActive_ != NULL)
     117            else if (propellerActive_ != nullptr)
    113118            {
    114119                velocity.z = propellerSpeed_;
     
    139144                }
    140145
    141                 if (leftHand_ != NULL)
     146                if (leftHand_ != nullptr)
    142147                {
    143148                    leftHand_->setOrientation(Vector3(0.0, 1.0, 0.0), Degree(-handAngle_));
    144149                }
    145                 if (rightHand_ != NULL)
     150                if (rightHand_ != nullptr)
    146151                {
    147152                    rightHand_->setOrientation(Vector3(0.0, 1.0, 0.0), Degree(handAngle_));
     
    207212        {
    208213            Vector3 velocity = getVelocity();
    209             if (bootsActive_ == NULL)
     214            if (bootsActive_ == nullptr)
    210215            {
    211216                velocity.z = 1.2f*jumpSpeed_;
     
    234239    void JumpFigure::CollisionWithEnemy(JumpEnemy* enemy)
    235240    {
    236         if (rocketActive_ == NULL && propellerActive_ == NULL && shieldActive_ == NULL)
     241        if (rocketActive_ == nullptr && propellerActive_ == nullptr && shieldActive_ == nullptr)
    237242        {
    238243            dead_ = true;
     
    242247    bool JumpFigure::StartRocket(JumpRocket* rocket)
    243248    {
    244         if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)
     249        if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr)
    245250        {
    246251            attach(rocket);
     
    261266        detach(rocket);
    262267        rocket->destroy();
    263         rocketActive_ = NULL;
     268        rocketActive_ = nullptr;
    264269    }
    265270
    266271    bool JumpFigure::StartPropeller(JumpPropeller* propeller)
    267272    {
    268         if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)
     273        if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr)
    269274        {
    270275            attach(propeller);
     
    285290        detach(propeller);
    286291        propeller->destroy();
    287         propellerActive_ = NULL;
     292        propellerActive_ = nullptr;
    288293    }
    289294
    290295    bool JumpFigure::StartBoots(JumpBoots* boots)
    291296    {
    292         if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)
     297        if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr)
    293298        {
    294299            attach(boots);
     
    309314        detach(boots);
    310315        boots->destroy();
    311         bootsActive_ = NULL;
     316        bootsActive_ = nullptr;
    312317    }
    313318
    314319    bool JumpFigure::StartShield(JumpShield* shield)
    315320    {
    316         if (shieldActive_ == false)
     321        if (shieldActive_ == nullptr)
    317322        {
    318323            attach(shield);
     
    333338        detach(shield);
    334339        shield->destroy();
    335         shieldActive_ = NULL;
     340        shieldActive_ = nullptr;
    336341    }
    337342
  • code/trunk/src/modules/jump/JumpFigure.h

    r10262 r11071  
    4040            JumpFigure(Context* context); //!< Constructor. Registers and initializes the object.
    4141            virtual ~JumpFigure() {}
    42             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    43             virtual void tick(float dt);
    44             virtual void moveFrontBack(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
    45             virtual void moveRightLeft(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
    46             virtual void rotateYaw(const Vector2& value);
    47             virtual void rotatePitch(const Vector2& value);
    48             virtual void rotateRoll(const Vector2& value);
     42            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     43            virtual void tick(float dt) override;
     44            virtual void moveFrontBack(const Vector2& value) override; //!< Overloaded the function to steer the bat up and down.
     45            virtual void moveRightLeft(const Vector2& value) override; //!< Overloaded the function to steer the bat up and down.
     46            virtual void rotateYaw(const Vector2& value) override;
     47            virtual void rotatePitch(const Vector2& value) override;
     48            virtual void rotateRoll(const Vector2& value) override;
    4949            void fire(unsigned int firemode);
    50             virtual void fired(unsigned int firemode);
     50            virtual void fired(unsigned int firemode) override;
    5151            virtual void JumpFromPlatform(JumpPlatform* platform);
    5252            virtual void JumpFromSpring(JumpSpring* spring);
  • code/trunk/src/modules/jump/JumpItem.cc

    r10624 r11071  
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "core/GameMode.h"
    38 #include "graphics/Model.h"
    39 #include "gametypes/Gametype.h"
    40 
     37#include "core/XMLPort.h"
    4138#include "JumpFigure.h"
    42 
    43 #include "sound/WorldSound.h"
    44 #include "core/XMLPort.h"
    4539
    4640namespace orxonox
     
    5448        attachedToFigure_ = false;
    5549
    56         figure_ = 0;
     50        figure_ = nullptr;
    5751        height_ = 0.0;
    5852        width_ = 0.0;
  • code/trunk/src/modules/jump/JumpItem.h

    r10624 r11071  
    3737
    3838#include "jump/JumpPrereqs.h"
    39 
    40 #include "util/Math.h"
    41 
    4239#include "worldentities/MovableEntity.h"
    4340
     
    5047            JumpItem(Context* context);
    5148            virtual ~JumpItem();
    52             virtual void tick(float dt);
    53             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     49            virtual void tick(float dt) override;
     50            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    5451            virtual void setProperties(float newLeftBoundary, float newRightBoundary, float newLowerBoundary, float newUpperBoundary, float newHSpeed, float newVSpeed);
    5552            virtual void setFigure(JumpFigure* newFigure);
  • code/trunk/src/modules/jump/JumpPlatform.cc

    r10632 r11071  
    3636#include "core/CoreIncludes.h"
    3737#include "core/GameMode.h"
    38 #include "graphics/Model.h"
    39 #include "gametypes/Gametype.h"
    40 
     38#include "core/XMLPort.h"
     39#include "sound/WorldSound.h"
    4140#include "JumpFigure.h"
    42 
    43 #include "sound/WorldSound.h"
    44 #include "core/XMLPort.h"
    4541
    4642namespace orxonox
     
    5248        RegisterObject(JumpPlatform);
    5349
    54         figure_ = 0;
     50        figure_ = nullptr;
    5551
    5652        setPosition(Vector3(0,0,0));
     
    9086        Vector3 platformPosition = this->getPosition();
    9187
    92         if (figure_ != NULL)
     88        if (figure_ != nullptr)
    9389        {
    9490            Vector3 figurePosition = figure_->getPosition();
  • code/trunk/src/modules/jump/JumpPlatform.h

    r10632 r11071  
    3636#define _JumpPlatform_H__
    3737
    38 #include "jump/JumpPrereqs.h"
    39 #include "util/Math.h"
     38#include "JumpPrereqs.h"
    4039#include "worldentities/MovableEntity.h"
    4140
     
    4746            JumpPlatform(Context* context);
    4847            virtual ~JumpPlatform();
    49             virtual void tick(float dt);
    50             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     48            virtual void tick(float dt) override;
     49            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    5150            void setFigure(JumpFigure* newFigure);
    5251            virtual void touchFigure();
  • code/trunk/src/modules/jump/JumpPlatformDisappear.cc

    r10262 r11071  
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "core/GameMode.h"
    38 
    39 #include "gametypes/Gametype.h"
    40 
    4137#include "JumpFigure.h"
    42 
    43 #include "sound/WorldSound.h"
    44 #include "core/XMLPort.h"
    4538
    4639namespace orxonox
     
    5851    {
    5952
    60     }
    61 
    62     void JumpPlatformDisappear::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    63     {
    64         SUPER(JumpPlatformDisappear, XMLPort, xmlelement, mode);
    65     }
    66 
    67     void JumpPlatformDisappear::tick(float dt)
    68     {
    69         SUPER(JumpPlatformDisappear, tick, dt);
    7053    }
    7154
  • code/trunk/src/modules/jump/JumpPlatformDisappear.h

    r10262 r11071  
    3636#define _JumpPlatformDisappear_H__
    3737
    38 #include "jump/JumpPrereqs.h"
    39 #include "util/Math.h"
    40 #include "worldentities/MovableEntity.h"
     38#include "JumpPrereqs.h"
     39#include "JumpPlatform.h"
    4140
    4241namespace orxonox
     
    4746            JumpPlatformDisappear(Context* context);
    4847            virtual ~JumpPlatformDisappear();
    49             virtual void tick(float dt);
    50             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5148            virtual void setProperties(bool active);
    5249            virtual bool isActive();
    53             virtual void touchFigure();
     50            virtual void touchFigure() override;
    5451
    5552        protected:
  • code/trunk/src/modules/jump/JumpPlatformFake.cc

    r10262 r11071  
    3333
    3434#include "JumpPlatformFake.h"
     35
    3536#include "core/CoreIncludes.h"
    36 #include "core/GameMode.h"
    37 #include "gametypes/Gametype.h"
    38 #include "JumpFigure.h"
    39 #include "sound/WorldSound.h"
    40 #include "core/XMLPort.h"
    4137
    4238namespace orxonox
     
    5349
    5450    }
    55 
    56     void JumpPlatformFake::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    57     {
    58         SUPER(JumpPlatformFake, XMLPort, xmlelement, mode);
    59     }
    60 
    61     void JumpPlatformFake::tick(float dt)
    62     {
    63         SUPER(JumpPlatformFake, tick, dt);
    64     }
    65 
    6651}
  • code/trunk/src/modules/jump/JumpPlatformFake.h

    r10262 r11071  
    3636#define _JumpPlatformFake_H__
    3737
    38 #include "jump/JumpPrereqs.h"
    39 
    40 #include "util/Math.h"
    41 
    42 #include "worldentities/MovableEntity.h"
    43 
     38#include "JumpPrereqs.h"
     39#include "JumpPlatform.h"
    4440
    4541namespace orxonox
     
    5046            JumpPlatformFake(Context* context);
    5147            virtual ~JumpPlatformFake();
    52             virtual void tick(float dt);
    53             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5448    };
    5549}
  • code/trunk/src/modules/jump/JumpPlatformHMove.cc

    r10262 r11071  
    3333
    3434#include "JumpPlatformHMove.h"
     35
    3536#include "core/CoreIncludes.h"
    36 #include "core/GameMode.h"
    37 #include "gametypes/Gametype.h"
    3837#include "JumpFigure.h"
    39 #include "sound/WorldSound.h"
    40 #include "core/XMLPort.h"
    4138
    4239namespace orxonox
     
    5451    {
    5552
    56     }
    57 
    58     void JumpPlatformHMove::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    59     {
    60         SUPER(JumpPlatformHMove, XMLPort, xmlelement, mode);
    6153    }
    6254
  • code/trunk/src/modules/jump/JumpPlatformHMove.h

    r10262 r11071  
    3030#define _JumpPlatformHMove_H__
    3131
    32 #include "jump/JumpPrereqs.h"
    33 
    34 #include "util/Math.h"
    35 
    36 #include "worldentities/MovableEntity.h"
    37 
     32#include "JumpPrereqs.h"
     33#include "JumpPlatform.h"
    3834
    3935namespace orxonox
     
    4541            JumpPlatformHMove(Context* context);
    4642            virtual ~JumpPlatformHMove();
    47             virtual void tick(float dt);
    48             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     43            virtual void tick(float dt) override;
    4944            virtual void setProperties(float leftBoundary, float rightBoundary, float speed);
    50             virtual void touchFigure();
     45            virtual void touchFigure() override;
    5146
    5247        protected:
  • code/trunk/src/modules/jump/JumpPlatformStatic.cc

    r10262 r11071  
    3333
    3434#include "JumpPlatformStatic.h"
     35
    3536#include "core/CoreIncludes.h"
    36 #include "core/GameMode.h"
    37 #include "gametypes/Gametype.h"
    3837#include "JumpFigure.h"
    39 #include "sound/WorldSound.h"
    40 #include "core/XMLPort.h"
    4138
    4239namespace orxonox
     
    5552    }
    5653
    57     //xml port for loading sounds
    58     void JumpPlatformStatic::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    59     {
    60         SUPER(JumpPlatformStatic, XMLPort, xmlelement, mode);
    61     }
    62 
    63     void JumpPlatformStatic::tick(float dt)
    64     {
    65         SUPER(JumpPlatformStatic, tick, dt);
    66     }
    67 
    6854    void JumpPlatformStatic::touchFigure()
    6955    {
  • code/trunk/src/modules/jump/JumpPlatformStatic.h

    r10262 r11071  
    3030#define _JumpPlatformStatic_H__
    3131
    32 #include "jump/JumpPrereqs.h"
    33 
    34 #include "util/Math.h"
    35 
    36 #include "worldentities/MovableEntity.h"
    37 
     32#include "JumpPrereqs.h"
     33#include "JumpPlatform.h"
    3834
    3935namespace orxonox
     
    4541            virtual ~JumpPlatformStatic();
    4642
    47             virtual void tick(float dt);
    48             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    49 
    50             virtual void touchFigure();
     43            virtual void touchFigure() override;
    5144    };
    5245}
  • code/trunk/src/modules/jump/JumpPlatformTimer.cc

    r10262 r11071  
    3333
    3434#include "JumpPlatformTimer.h"
     35
    3536#include "core/CoreIncludes.h"
    36 #include "core/GameMode.h"
    37 #include "gametypes/Gametype.h"
     37#include "core/XMLPort.h"
     38#include "graphics/ParticleSpawner.h"
    3839#include "JumpFigure.h"
    39 #include "sound/WorldSound.h"
    40 #include "core/XMLPort.h"
    4140
    4241namespace orxonox
     
    4847        RegisterObject(JumpPlatformTimer);
    4948
    50         particleSpawner_ = NULL;
     49        particleSpawner_ = nullptr;
    5150
    5251        setProperties(3.0);
     
    7271
    7372        time_ -= dt;
    74         if (time_ < effectStartTime_ && particleSpawner_ == NULL)
     73        if (time_ < effectStartTime_ && particleSpawner_ == nullptr)
    7574        {
    7675
  • code/trunk/src/modules/jump/JumpPlatformTimer.h

    r10262 r11071  
    3636#define _JumpPlatformTimer_H__
    3737
    38 #include "jump/JumpPrereqs.h"
    39 
    40 #include "util/Math.h"
    41 
    42 #include "worldentities/MovableEntity.h"
    43 #include "graphics/ParticleSpawner.h"
    44 
     38#include "JumpPrereqs.h"
     39#include "JumpPlatform.h"
    4540
    4641namespace orxonox
     
    5146            JumpPlatformTimer(Context* context);
    5247            virtual ~JumpPlatformTimer();
    53             virtual void tick(float dt);
    54             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     48            virtual void tick(float dt) override;
     49            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    5550            virtual void setProperties(float time);
    5651            virtual bool isActive(void);
    57             virtual void touchFigure();
     52            virtual void touchFigure() override;
    5853
    5954            void setEffectPath(const std::string& effectPath)
  • code/trunk/src/modules/jump/JumpPlatformVMove.cc

    r10262 r11071  
    3333
    3434#include "JumpPlatformVMove.h"
     35
    3536#include "core/CoreIncludes.h"
    36 #include "core/GameMode.h"
    37 #include "gametypes/Gametype.h"
    3837#include "JumpFigure.h"
    39 #include "sound/WorldSound.h"
    40 #include "core/XMLPort.h"
    4138
    4239namespace orxonox
     
    5451    {
    5552
    56     }
    57 
    58     void JumpPlatformVMove::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    59     {
    60         SUPER(JumpPlatformVMove, XMLPort, xmlelement, mode);
    6153    }
    6254
  • code/trunk/src/modules/jump/JumpPlatformVMove.h

    r10262 r11071  
    3030#define _JumpPlatformVMove_H__
    3131
    32 #include "jump/JumpPrereqs.h"
    33 #include "util/Math.h"
    34 #include "worldentities/MovableEntity.h"
     32#include "JumpPrereqs.h"
     33#include "JumpPlatform.h"
    3534
    3635namespace orxonox
     
    4140            JumpPlatformVMove(Context* context);
    4241            virtual ~JumpPlatformVMove();
    43             virtual void tick(float dt);
    44             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     42            virtual void tick(float dt) override;
    4543            virtual void setProperties(float leftBoundary, float rightBoundary, float speed);
    46             virtual void touchFigure();
     44            virtual void touchFigure() override;
    4745
    4846        protected:
  • code/trunk/src/modules/jump/JumpProjectile.cc

    r10624 r11071  
    3333
    3434#include "JumpProjectile.h"
     35
    3536#include "core/CoreIncludes.h"
    36 #include "core/GameMode.h"
    37 #include "graphics/Model.h"
    38 #include "gametypes/Gametype.h"
    3937#include "JumpFigure.h"
    40 #include "sound/WorldSound.h"
    41 #include "core/XMLPort.h"
     38#include "JumpEnemy.h"
    4239
    4340namespace orxonox
     
    4946        RegisterObject(JumpProjectile);
    5047
    51         figure_ = 0;
     48        figure_ = nullptr;
    5249        setPosition(Vector3(0,0,0));
    5350        setVelocity(Vector3(0,0,250.0));
     
    6057    }
    6158
    62     void JumpProjectile::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    63     {
    64         SUPER(JumpProjectile, XMLPort, xmlelement, mode);
    65     }
    66 
    6759    void JumpProjectile::tick(float dt)
    6860    {
     
    7163        Vector3 projectilePosition = getPosition();
    7264
    73         for (ObjectList<JumpEnemy>::iterator it = ObjectList<JumpEnemy>::begin(); it != ObjectList<JumpEnemy>::end(); ++it)
     65        for (JumpEnemy* enemy : ObjectList<JumpEnemy>())
    7466        {
    75             Vector3 enemyPosition = it->getPosition();
    76             float enemyWidth = it->getWidth();
    77             float enemyHeight = it->getHeight();
     67            Vector3 enemyPosition = enemy->getPosition();
     68            float enemyWidth = enemy->getWidth();
     69            float enemyHeight = enemy->getHeight();
    7870
    7971            if(projectilePosition.x > enemyPosition.x-enemyWidth && projectilePosition.x < enemyPosition.x+enemyWidth && projectilePosition.z > enemyPosition.z-enemyHeight && projectilePosition.z < enemyPosition.z+enemyHeight)
    8072            {
    81                 it->dead_ = true;
     73                enemy->dead_ = true;
    8274            }
    8375        }
  • code/trunk/src/modules/jump/JumpProjectile.h

    r10624 r11071  
    4343            virtual ~JumpProjectile();
    4444
    45             virtual void tick(float dt);
    46 
    47             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     45            virtual void tick(float dt) override;
    4846
    4947            void setFieldDimension(float width, float height)
  • code/trunk/src/modules/jump/JumpPropeller.cc

    r10262 r11071  
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "core/GameMode.h"
    38 #include "graphics/Model.h"
    39 #include "gametypes/Gametype.h"
    40 
    4137#include "JumpFigure.h"
    42 
    43 #include "sound/WorldSound.h"
    44 #include "core/XMLPort.h"
    4538
    4639namespace orxonox
     
    6760    }
    6861
    69     void JumpPropeller::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    70     {
    71         SUPER(JumpPropeller, XMLPort, xmlelement, mode);
    72     }
    73 
    7462    void JumpPropeller::tick(float dt)
    7563    {
     
    7866        Vector3 PropellerPosition = getWorldPosition();
    7967
    80         if (attachedToFigure_ == false && figure_ != NULL)
     68        if (attachedToFigure_ == false && figure_ != nullptr)
    8169        {
    8270            Vector3 figurePosition = figure_->getWorldPosition();
  • code/trunk/src/modules/jump/JumpPropeller.h

    r10262 r11071  
    3030#define _JumpPropeller_H__
    3131
    32 #include "jump/JumpPrereqs.h"
    33 
    34 #include "util/Math.h"
    35 
    36 #include "worldentities/MovableEntity.h"
    37 
     32#include "JumpPrereqs.h"
     33#include "JumpItem.h"
    3834
    3935namespace orxonox
     
    4440            JumpPropeller(Context* context);
    4541            virtual ~JumpPropeller();
    46             virtual void tick(float dt);
    47             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    48             virtual void touchFigure();
     42            virtual void tick(float dt) override;
     43            virtual void touchFigure() override;
    4944            virtual float getFuelState();
    5045        protected:
  • code/trunk/src/modules/jump/JumpRocket.cc

    r10262 r11071  
    3333
    3434#include "JumpRocket.h"
     35
    3536#include "core/CoreIncludes.h"
    36 #include "core/GameMode.h"
    37 #include "graphics/Model.h"
    38 #include "gametypes/Gametype.h"
    3937#include "JumpFigure.h"
    40 #include "sound/WorldSound.h"
    41 #include "core/XMLPort.h"
    4238
    4339namespace orxonox
     
    6460    }
    6561
    66     void JumpRocket::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    67     {
    68         SUPER(JumpRocket, XMLPort, xmlelement, mode);
    69     }
    70 
    7162    void JumpRocket::tick(float dt)
    7263    {
     
    7566        Vector3 rocketPosition = getWorldPosition();
    7667
    77         if (attachedToFigure_ == false && figure_ != NULL)
     68        if (attachedToFigure_ == false && figure_ != nullptr)
    7869        {
    7970            Vector3 figurePosition = figure_->getWorldPosition();
  • code/trunk/src/modules/jump/JumpRocket.h

    r10262 r11071  
    3030#define _JumpRocket_H__
    3131
    32 #include "jump/JumpPrereqs.h"
    33 #include "util/Math.h"
    34 #include "worldentities/MovableEntity.h"
     32#include "JumpPrereqs.h"
     33#include "JumpItem.h"
    3534
    3635namespace orxonox
     
    4140            JumpRocket(Context* context);
    4241            virtual ~JumpRocket();
    43             virtual void tick(float dt);
    44             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    45             virtual void touchFigure();
     42            virtual void tick(float dt) override;
     43            virtual void touchFigure() override;
    4644            virtual float getFuelState();
    4745        protected:
  • code/trunk/src/modules/jump/JumpScore.cc

    r10624 r11071  
    3333
    3434#include "JumpScore.h"
     35
    3536#include "core/CoreIncludes.h"
    3637#include "core/XMLPort.h"
     
    3839#include "infos/PlayerInfo.h"
    3940#include "Jump.h"
    40 #include "sound/WorldSound.h"
    4141
    4242namespace orxonox
     
    4848        RegisterObject(JumpScore);
    4949
    50         owner_ = NULL;
     50        owner_ = nullptr;
    5151        showScore_ = false;
    5252        showFuel_ = false;
     
    7373        SUPER(JumpScore, tick, dt);
    7474
    75         if (owner_ != NULL)
     75        if (owner_ != nullptr)
    7676        {
    7777            if (!owner_->hasEnded())
     
    7979                player_ = owner_->getPlayer();
    8080
    81                 if (player_ != NULL)
     81                if (player_ != nullptr)
    8282                {
    8383                    if (showScore_ == true)
     
    116116        SUPER(JumpScore, changedOwner);
    117117
    118         if (this->getOwner() != NULL && this->getOwner()->getGametype())
     118        if (this->getOwner() != nullptr && this->getOwner()->getGametype())
    119119        {
    120120            this->owner_ = orxonox_cast<Jump*>(this->getOwner()->getGametype());
     
    122122        else
    123123        {
    124             this->owner_ = NULL;
     124            this->owner_ = nullptr;
    125125        }
    126126    }
  • code/trunk/src/modules/jump/JumpScore.h

    r10262 r11071  
    4444            virtual ~JumpScore();
    4545
    46             virtual void tick(float dt);
    47             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    48             virtual void changedOwner();
     46            virtual void tick(float dt) override;
     47            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     48            virtual void changedOwner() override;
    4949
    5050            void setShowScore(const bool showScore)
  • code/trunk/src/modules/jump/JumpShield.cc

    r10262 r11071  
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "core/GameMode.h"
    38 #include "graphics/Model.h"
    39 #include "gametypes/Gametype.h"
    40 
    4137#include "JumpFigure.h"
    42 
    43 #include "sound/WorldSound.h"
    44 #include "core/XMLPort.h"
    4538
    4639namespace orxonox
     
    6760    }
    6861
    69     void JumpShield::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    70     {
    71         SUPER(JumpShield, XMLPort, xmlelement, mode);
    72     }
    73 
    7462    void JumpShield::tick(float dt)
    7563    {
     
    7866        Vector3 shieldPosition = getWorldPosition();
    7967
    80         if (attachedToFigure_ == false && figure_ != NULL)
     68        if (attachedToFigure_ == false && figure_ != nullptr)
    8169        {
    8270            Vector3 figurePosition = figure_->getWorldPosition();
  • code/trunk/src/modules/jump/JumpShield.h

    r10262 r11071  
    3030#define _JumpShield_H__
    3131
    32 #include "jump/JumpPrereqs.h"
    33 
    34 #include "util/Math.h"
    35 
    36 #include "worldentities/MovableEntity.h"
    37 
     32#include "JumpPrereqs.h"
     33#include "JumpItem.h"
    3834
    3935namespace orxonox
     
    4440            JumpShield(Context* context);
    4541            virtual ~JumpShield();
    46             virtual void tick(float dt);
    47             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    48             virtual void touchFigure();
     42            virtual void tick(float dt) override;
     43            virtual void touchFigure() override;
    4944            virtual float getFuelState();
    5045        protected:
  • code/trunk/src/modules/jump/JumpSpring.cc

    r10262 r11071  
    3333
    3434#include "JumpSpring.h"
     35
    3536#include "core/CoreIncludes.h"
    36 #include "core/GameMode.h"
    37 #include "graphics/Model.h"
    38 #include "gametypes/Gametype.h"
    3937#include "JumpFigure.h"
    40 #include "sound/WorldSound.h"
    41 #include "core/XMLPort.h"
    4238
    4339namespace orxonox
     
    6359    }
    6460
    65     void JumpSpring::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    66     {
    67         SUPER(JumpSpring, XMLPort, xmlelement, mode);
    68     }
    69 
    7061    void JumpSpring::tick(float dt)
    7162    {
     
    8071        Vector3 springPosition = getWorldPosition();
    8172
    82         if (figure_ != NULL)
     73        if (figure_ != nullptr)
    8374        {
    8475            Vector3 figurePosition = figure_->getWorldPosition();
     
    10394    void JumpSpring::accelerateFigure()
    10495    {
    105         if (figure_ != 0)
     96        if (figure_ != nullptr)
    10697        {
    10798            figure_->JumpFromSpring(this);
  • code/trunk/src/modules/jump/JumpSpring.h

    r10262 r11071  
    3030#define _JumpSpring_H__
    3131
    32 #include "jump/JumpPrereqs.h"
    33 
    34 #include "util/Math.h"
    35 
    36 #include "worldentities/MovableEntity.h"
    37 
     32#include "JumpPrereqs.h"
     33#include "JumpItem.h"
    3834
    3935namespace orxonox
     
    4440            JumpSpring(Context* context);
    4541            virtual ~JumpSpring();
    46             virtual void tick(float dt);
    47             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     42            virtual void tick(float dt) override;
    4843            virtual void accelerateFigure();
    49             virtual void touchFigure();
     44            virtual void touchFigure() override;
    5045        protected:
    5146            float stretch_;
  • code/trunk/src/modules/mini4dgame/Mini4Dgame.cc

    r10624 r11071  
    6666        RegisterObject(Mini4Dgame);
    6767
    68         this->board_ = 0;
     68        this->board_ = nullptr;
    6969
    7070        // Set the type of Bots for this particular Gametype.
     
    8888    void Mini4Dgame::cleanup()
    8989    {
    90         if(this->board_ != NULL)// Destroy the board, if present.
     90        if(this->board_ != nullptr)// Destroy the board, if present.
    9191        {
    9292            //this->board_->destroy();
    93             this->board_ = 0;
     93            this->board_ = nullptr;
    9494        }
    9595    }
     
    101101    void Mini4Dgame::start()
    102102    {
    103         if (this->board_ != NULL) // There needs to be a Mini4DgameCenterpoint, i.e. the area the game takes place.
     103        if (this->board_ != nullptr) // There needs to be a Mini4DgameCenterpoint, i.e. the area the game takes place.
    104104        {
    105105            /*
    106             if (this->board_ == NULL)
     106            if (this->board_ == nullptr)
    107107            {
    108108                this->board_ = new Mini4DgameBoard(this->board_->getContext());
     
    155155    {
    156156        // first spawn human players to assign always the left bat to the player in singleplayer
    157         for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    158             if (it->first->isHumanPlayer() && (it->first->isReadyToSpawn() || this->bForceSpawn_))
    159                 this->spawnPlayer(it->first);
     157        for (const auto& mapEntry : this->players_)
     158            if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
     159                this->spawnPlayer(mapEntry.first);
    160160        // now spawn bots
    161         for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    162             if (!it->first->isHumanPlayer() && (it->first->isReadyToSpawn() || this->bForceSpawn_))
    163                 this->spawnPlayer(it->first);
     161        for (const auto& mapEntry : this->players_)
     162            if (!mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
     163                this->spawnPlayer(mapEntry.first);
    164164    }
    165165
     
    174174        assert(player);
    175175
    176         if(false)//this->player_ == NULL)
     176        if(false)//this->player_ == nullptr)
    177177        {
    178178            //this->player_ = player;
     
    183183    void Mini4Dgame::undoStone()//Vector4 move, const int playerColor)
    184184    {
    185         ObjectList<Mini4DgameBoard>::iterator it = ObjectList<Mini4DgameBoard>::begin();
     185        ObjectList<Mini4DgameBoard>::iterator it = ObjectList<Mini4DgameBoard>().begin();
    186186        it->undoMove();
    187187    }
     
    191191    {
    192192        Mini4DgamePosition move = Mini4DgamePosition(x,y,z,w);
    193         ObjectList<Mini4DgameBoard>::iterator it = ObjectList<Mini4DgameBoard>::begin();
     193        ObjectList<Mini4DgameBoard>::iterator it = ObjectList<Mini4DgameBoard>().begin();
    194194        it->makeMove(move);
    195195    }
  • code/trunk/src/modules/mini4dgame/Mini4Dgame.h

    r10230 r11071  
    4141namespace orxonox
    4242{
    43 
    44     namespace mini4DgamePlayerColor
    45     {
    46         enum color
    47         {
    48             none,
    49             red,
    50             blue,
    51             green
    52         };
    53     }
    54 
    5543    /**
    5644    @brief
     
    6553            virtual ~Mini4Dgame(); //!< Destructor. Cleans up, if initialized.
    6654
    67             virtual void start(void); //!< Starts the Mini4Dgame minigame.
    68             virtual void end(void); ///!< Ends the Mini4Dgame minigame.
     55            virtual void start(void) override; //!< Starts the Mini4Dgame minigame.
     56            virtual void end(void) override; ///!< Ends the Mini4Dgame minigame.
    6957
    70             virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player.
     58            virtual void spawnPlayer(PlayerInfo* player) override; //!< Spawns the input player.
    7159
    7260            void setGameboard(Mini4DgameBoard* board)
     
    8472
    8573        protected:
    86             virtual void spawnPlayersIfRequested(); //!< Spawns player.
     74            virtual void spawnPlayersIfRequested() override; //!< Spawns player.
    8775
    8876
  • code/trunk/src/modules/mini4dgame/Mini4DgameAI.cc

    r10230 r11071  
    6060
    6161        this->setConfigValues();
    62         this->center_ = 0;
     62        this->center_ = nullptr;
    6363    }
    6464
     
    104104                for(int k=0;k<4;k++){
    105105                    for(int l=0;l<4;l++){
    106                         if (this->board_[i][j][k][l]==mini4DgamePlayerColor::none)
     106                        if (this->board_[i][j][k][l]==Mini4DgamePlayerColor::none)
    107107                            possibleMoves.push_back(Vector4(i,j,k,l));
    108108                    }
     
    112112        return possibleMoves;
    113113    }
    114 
    115     /**
    116     @brief
    117         Is called each tick.
    118         Implements the behavior of the PongAI (i.e. its intelligence).
    119     @param dt
    120         The time that has elapsed since the last tick.
    121     */
    122     void Mini4DgameAI::tick(float dt)
    123     {
    124 
    125     }
    126114}
  • code/trunk/src/modules/mini4dgame/Mini4DgameAI.h

    r10230 r11071  
    3939#include <list>
    4040
    41 #include "tools/interfaces/Tickable.h"
    42 
    4341#include "controllers/Controller.h"
    4442#include "Mini4DgameCenterpoint.h"
     
    5553        Oliver Richter
    5654    */
    57     class _Mini4DgameExport Mini4DgameAI : public Controller, public Tickable
     55    class _Mini4DgameExport Mini4DgameAI : public Controller
    5856    {
    5957        public:
     
    7371            Vector4 makeMove(float timeout);
    7472
    75 
    76             virtual void tick(float dt);
    77 
    7873            void setCenterpoint(Mini4DgameCenterpoint* center)
    7974                            { this->center_ = center; }
     
    8176        protected:
    8277
    83             std::list<std::pair<Timer*, char> > reactionTimers_; //!< A list of reaction timers and the directions that take effect when their timer expires.
     78            std::list<std::pair<Timer*, char>> reactionTimers_; //!< A list of reaction timers and the directions that take effect when their timer expires.
    8479            Mini4DgameCenterpoint* center_;
    8580
     
    8883            std::list<Vector4> getPossibleMoves();
    8984            void copyBoard();
    90             mini4DgamePlayerColor::color board_[4][4][4][4];
     85            Mini4DgamePlayerColor board_[4][4][4][4];
    9186    };
    9287}
  • code/trunk/src/modules/mini4dgame/Mini4DgameBoard.cc

    r10624 r11071  
    4040#include "graphics/BlinkingBillboard.h"
    4141
    42 #include "core/XMLPort.h"
    43 
    4442#include "Mini4Dgame.h"
    4543
     
    6361                for(int k=0;k<4;k++){
    6462                    for(int l=0;l<4;l++){
    65                         this->board[i][j][k][l]=mini4DgamePlayerColor::none;
    66                         this->blinkingBillboards[i][j][k][l] = 0;
     63                        this->board[i][j][k][l]=Mini4DgamePlayerColor::none;
     64                        this->blinkingBillboards[i][j][k][l] = nullptr;
    6765                    }
    6866                }
     
    7169        this->player_toggle_ = false;
    7270        this->checkGametype();
    73     }
    74 
    75 
    76     //xml port for loading sounds
    77     void Mini4DgameBoard::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    78     {
    79         SUPER(Mini4DgameBoard, XMLPort, xmlelement, mode);
    8071    }
    8172
     
    8879        return (move.x<4 && move.y<4 && move.z<4 && move.w<4
    8980                && move.x>=0 && move.y>=0 && move.z>=0 && move.w>=0
    90                 && this->board[move.x][move.y][move.z][move.w] == mini4DgamePlayerColor::none);
     81                && this->board[move.x][move.y][move.z][move.w] == Mini4DgamePlayerColor::none);
    9182    }
    9283
     
    9586        const Mini4DgamePosition& move = moves.back();
    9687        moves.pop_back();
    97         this->board[move.x][move.y][move.z][move.w] = mini4DgamePlayerColor::none;
     88        this->board[move.x][move.y][move.z][move.w] = Mini4DgamePlayerColor::none;
    9889        this->blinkingBillboards[move.x][move.y][move.z][move.w]->destroy();
    99         this->blinkingBillboards[move.x][move.y][move.z][move.w] = 0;
     90        this->blinkingBillboards[move.x][move.y][move.z][move.w] = nullptr;
    10091        if(player_toggle_){
    10192            this->player_toggle_ = false;
     
    124115
    125116            moves.push_back(move);
    126             mini4DgamePlayerColor::color playerColor = mini4DgamePlayerColor::none;
     117            Mini4DgamePlayerColor playerColor = Mini4DgamePlayerColor::none;
    127118            if(player_toggle_){
    128                 playerColor = mini4DgamePlayerColor::blue;
     119                playerColor = Mini4DgamePlayerColor::blue;
    129120                this->player_toggle_ = false;
    130121            }else{
    131                 playerColor = mini4DgamePlayerColor::green;
     122                playerColor = Mini4DgamePlayerColor::green;
    132123                this->player_toggle_ = true;
    133124            }
    134125
    135             this->board[move.x][move.y][move.z][move.w] = (mini4DgamePlayerColor::color) playerColor;
     126            this->board[move.x][move.y][move.z][move.w] = playerColor;
    136127
    137128            BlinkingBillboard* bb = new BlinkingBillboard(this->getContext());
     
    155146
    156147            switch(playerColor){
    157             case mini4DgamePlayerColor::red:
     148            case Mini4DgamePlayerColor::red:
    158149                bb->setColour(ColourValue(1,0,0)); break;
    159             case mini4DgamePlayerColor::green:
     150            case Mini4DgamePlayerColor::green:
    160151                bb->setColour(ColourValue(0,1,0)); break;
    161             case mini4DgamePlayerColor::blue:
     152            case Mini4DgamePlayerColor::blue:
    162153                bb->setColour(ColourValue(0,0,1)); break;
    163154            default: break;
     
    169160
    170161            Mini4DgameWinner winner = this->getWinner();
    171             if(winner.color_ != mini4DgamePlayerColor::none)
     162            if(winner.color_ != Mini4DgamePlayerColor::none)
    172163            {
    173164                orxout(user_status) << "Mini4Dgame: win!!!!!!!" << endl;
     
    197188    {
    198189        Mini4DgameWinner winner;
    199         winner.color_ = mini4DgamePlayerColor::none;
     190        winner.color_ = Mini4DgamePlayerColor::none;
    200191
    201192        //check diagonals rows-columns-height-numbers
    202193        for(int i=1; i<4; i++)
    203194        {
    204             if(this->board[i][i][i][i]==mini4DgamePlayerColor::none || this->board[0][0][0][0] != this->board[i][i][i][i])
     195            if(this->board[i][i][i][i]==Mini4DgamePlayerColor::none || this->board[0][0][0][0] != this->board[i][i][i][i])
    205196                break;
    206197            if(i==3)
     
    218209        for(int i=1; i<4; i++)
    219210        {
    220             if(this->board[3-i][i][i][i]==mini4DgamePlayerColor::none || this->board[3][0][0][0] != this->board[3-i][i][i][i])
     211            if(this->board[3-i][i][i][i]==Mini4DgamePlayerColor::none || this->board[3][0][0][0] != this->board[3-i][i][i][i])
    221212                break;
    222213            if(i==3)
     
    234225        for(int i=1; i<4; i++)
    235226        {
    236             if(this->board[i][3-i][i][i]==mini4DgamePlayerColor::none || this->board[0][3][0][0] != this->board[i][3-i][i][i])
     227            if(this->board[i][3-i][i][i]==Mini4DgamePlayerColor::none || this->board[0][3][0][0] != this->board[i][3-i][i][i])
    237228                break;
    238229            if(i==3)
     
    250241        for(int i=1; i<4; i++)
    251242        {
    252             if(this->board[i][i][3-i][i]==mini4DgamePlayerColor::none || this->board[0][0][3][0] != this->board[i][i][3-i][i])
     243            if(this->board[i][i][3-i][i]==Mini4DgamePlayerColor::none || this->board[0][0][3][0] != this->board[i][i][3-i][i])
    253244                break;
    254245            if(i==3)
     
    266257        for(int i=1; i<4; i++)
    267258        {
    268             if(this->board[i][i][i][3-i]==mini4DgamePlayerColor::none || this->board[0][0][0][3] != this->board[i][i][i][3-i])
     259            if(this->board[i][i][i][3-i]==Mini4DgamePlayerColor::none || this->board[0][0][0][3] != this->board[i][i][i][3-i])
    269260                break;
    270261            if(i==3)
     
    282273        for(int i=1; i<4; i++)
    283274        {
    284             if(this->board[3-i][3-i][i][i]==mini4DgamePlayerColor::none || this->board[3][3][0][0] != this->board[3-i][3-i][i][i])
     275            if(this->board[3-i][3-i][i][i]==Mini4DgamePlayerColor::none || this->board[3][3][0][0] != this->board[3-i][3-i][i][i])
    285276                break;
    286277            if(i==3)
     
    298289        for(int i=1; i<4; i++)
    299290        {
    300             if(this->board[3-i][i][3-i][i]==mini4DgamePlayerColor::none || this->board[3][0][3][0] != this->board[3-i][i][3-i][i])
     291            if(this->board[3-i][i][3-i][i]==Mini4DgamePlayerColor::none || this->board[3][0][3][0] != this->board[3-i][i][3-i][i])
    301292                break;
    302293            if(i==3)
     
    314305        for(int i=1; i<4; i++)
    315306        {
    316             if(this->board[3-i][i][i][3-i]==mini4DgamePlayerColor::none || this->board[3][0][0][3] != this->board[3-i][i][i][3-i])
     307            if(this->board[3-i][i][i][3-i]==Mini4DgamePlayerColor::none || this->board[3][0][0][3] != this->board[3-i][i][i][3-i])
    317308                break;
    318309            if(i==3)
     
    334325            for(int i=1; i<4; i++)
    335326            {
    336                 if(this->board[i][i][i][l]==mini4DgamePlayerColor::none || this->board[0][0][0][l] != this->board[i][i][i][l])
     327                if(this->board[i][i][i][l]==Mini4DgamePlayerColor::none || this->board[0][0][0][l] != this->board[i][i][i][l])
    337328                    break;
    338329                if(i==3)
     
    350341            for(int i=1; i<4; i++)
    351342            {
    352                 if(this->board[3-i][i][i][l]==mini4DgamePlayerColor::none || this->board[3][0][0][l] != this->board[3-i][i][i][l])
     343                if(this->board[3-i][i][i][l]==Mini4DgamePlayerColor::none || this->board[3][0][0][l] != this->board[3-i][i][i][l])
    353344                    break;
    354345                if(i==3)
     
    366357            for(int i=1; i<4; i++)
    367358            {
    368                 if(this->board[i][3-i][i][l]==mini4DgamePlayerColor::none || this->board[0][3][0][l] != this->board[i][3-i][i][l])
     359                if(this->board[i][3-i][i][l]==Mini4DgamePlayerColor::none || this->board[0][3][0][l] != this->board[i][3-i][i][l])
    369360                    break;
    370361                if(i==3)
     
    382373            for(int i=1; i<4; i++)
    383374            {
    384                 if(this->board[i][i][3-i][l]==mini4DgamePlayerColor::none || this->board[0][0][3][l] != this->board[i][i][3-i][l])
     375                if(this->board[i][i][3-i][l]==Mini4DgamePlayerColor::none || this->board[0][0][3][l] != this->board[i][i][3-i][l])
    385376                    break;
    386377                if(i==3)
     
    403394            for(int i=1; i<4; i++)
    404395            {
    405                 if(this->board[i][i][l][i]==mini4DgamePlayerColor::none || this->board[0][0][l][0] != this->board[i][i][l][i])
     396                if(this->board[i][i][l][i]==Mini4DgamePlayerColor::none || this->board[0][0][l][0] != this->board[i][i][l][i])
    406397                    break;
    407398                if(i==3)
     
    419410            for(int i=1; i<4; i++)
    420411            {
    421                 if(this->board[3-i][i][l][i]==mini4DgamePlayerColor::none || this->board[3][0][l][0] != this->board[3-i][i][l][i])
     412                if(this->board[3-i][i][l][i]==Mini4DgamePlayerColor::none || this->board[3][0][l][0] != this->board[3-i][i][l][i])
    422413                    break;
    423414                if(i==3)
     
    435426            for(int i=1; i<4; i++)
    436427            {
    437                 if(this->board[i][3-i][l][i]==mini4DgamePlayerColor::none || this->board[0][3][l][0] != this->board[i][3-i][l][i])
     428                if(this->board[i][3-i][l][i]==Mini4DgamePlayerColor::none || this->board[0][3][l][0] != this->board[i][3-i][l][i])
    438429                    break;
    439430                if(i==3)
     
    451442            for(int i=1; i<4; i++)
    452443            {
    453                 if(this->board[i][i][l][3-i]==mini4DgamePlayerColor::none || this->board[0][0][l][3] != this->board[i][i][l][3-i])
     444                if(this->board[i][i][l][3-i]==Mini4DgamePlayerColor::none || this->board[0][0][l][3] != this->board[i][i][l][3-i])
    454445                    break;
    455446                if(i==3)
     
    472463            for(int i=1; i<4; i++)
    473464            {
    474                 if(this->board[i][l][i][i]==mini4DgamePlayerColor::none || this->board[0][l][0][0] != this->board[i][l][i][i])
     465                if(this->board[i][l][i][i]==Mini4DgamePlayerColor::none || this->board[0][l][0][0] != this->board[i][l][i][i])
    475466                    break;
    476467                if(i==3)
     
    488479            for(int i=1; i<4; i++)
    489480            {
    490                 if(this->board[3-i][l][i][i]==mini4DgamePlayerColor::none || this->board[3][l][0][0] != this->board[3-i][l][i][i])
     481                if(this->board[3-i][l][i][i]==Mini4DgamePlayerColor::none || this->board[3][l][0][0] != this->board[3-i][l][i][i])
    491482                    break;
    492483                if(i==3)
     
    504495            for(int i=1; i<4; i++)
    505496            {
    506                 if(this->board[i][l][3-i][i]==mini4DgamePlayerColor::none || this->board[0][l][3][0] != this->board[i][l][3-i][i])
     497                if(this->board[i][l][3-i][i]==Mini4DgamePlayerColor::none || this->board[0][l][3][0] != this->board[i][l][3-i][i])
    507498                    break;
    508499                if(i==3)
     
    520511            for(int i=1; i<4; i++)
    521512            {
    522                 if(this->board[i][l][i][3-i]==mini4DgamePlayerColor::none || this->board[0][l][0][3] != this->board[i][l][i][3-i])
     513                if(this->board[i][l][i][3-i]==Mini4DgamePlayerColor::none || this->board[0][l][0][3] != this->board[i][l][i][3-i])
    523514                    break;
    524515                if(i==3)
     
    541532            for(int i=1; i<4; i++)
    542533            {
    543                 if(this->board[l][i][i][i]==mini4DgamePlayerColor::none || this->board[l][0][0][0] != this->board[l][i][i][i])
     534                if(this->board[l][i][i][i]==Mini4DgamePlayerColor::none || this->board[l][0][0][0] != this->board[l][i][i][i])
    544535                    break;
    545536                if(i==3)
     
    557548            for(int i=1; i<4; i++)
    558549            {
    559                 if(this->board[l][3-i][i][i]==mini4DgamePlayerColor::none || this->board[l][3][0][0] != this->board[l][3-i][i][i])
     550                if(this->board[l][3-i][i][i]==Mini4DgamePlayerColor::none || this->board[l][3][0][0] != this->board[l][3-i][i][i])
    560551                    break;
    561552                if(i==3)
     
    573564            for(int i=1; i<4; i++)
    574565            {
    575                 if(this->board[l][i][3-i][i]==mini4DgamePlayerColor::none || this->board[l][0][3][0] != this->board[l][i][3-i][i])
     566                if(this->board[l][i][3-i][i]==Mini4DgamePlayerColor::none || this->board[l][0][3][0] != this->board[l][i][3-i][i])
    576567                    break;
    577568                if(i==3)
     
    589580            for(int i=1; i<4; i++)
    590581            {
    591                 if(this->board[l][i][i][3-i]==mini4DgamePlayerColor::none || this->board[l][0][0][3] != this->board[l][i][i][3-i])
     582                if(this->board[l][i][i][3-i]==Mini4DgamePlayerColor::none || this->board[l][0][0][3] != this->board[l][i][i][3-i])
    592583                    break;
    593584                if(i==3)
     
    611602                for(int i=1; i<4; i++)
    612603                {
    613                     if(this->board[i][i][k][l]==mini4DgamePlayerColor::none || this->board[0][0][k][l] != this->board[i][i][k][l])
     604                    if(this->board[i][i][k][l]==Mini4DgamePlayerColor::none || this->board[0][0][k][l] != this->board[i][i][k][l])
    614605                        break;
    615606                    if(i==3)
     
    627618                for(int i=1; i<4; i++)
    628619                {
    629                     if(this->board[3-i][i][k][l]==mini4DgamePlayerColor::none || this->board[3][0][k][l] != this->board[3-i][i][k][l])
     620                    if(this->board[3-i][i][k][l]==Mini4DgamePlayerColor::none || this->board[3][0][k][l] != this->board[3-i][i][k][l])
    630621                        break;
    631622                    if(i==3)
     
    644635                for(int i=1; i<4; i++)
    645636                {
    646                     if(this->board[i][k][i][l]==mini4DgamePlayerColor::none || this->board[0][k][0][l] != this->board[i][k][i][l])
     637                    if(this->board[i][k][i][l]==Mini4DgamePlayerColor::none || this->board[0][k][0][l] != this->board[i][k][i][l])
    647638                        break;
    648639                    if(i==3)
     
    660651                for(int i=1; i<4; i++)
    661652                {
    662                     if(this->board[3-i][k][i][l]==mini4DgamePlayerColor::none || this->board[3][k][0][l] != this->board[3-i][k][i][l])
     653                    if(this->board[3-i][k][i][l]==Mini4DgamePlayerColor::none || this->board[3][k][0][l] != this->board[3-i][k][i][l])
    663654                        break;
    664655                    if(i==3)
     
    677668                for(int i=1; i<4; i++)
    678669                {
    679                     if(this->board[i][k][l][i]==mini4DgamePlayerColor::none || this->board[0][k][l][0] != this->board[i][k][l][i])
     670                    if(this->board[i][k][l][i]==Mini4DgamePlayerColor::none || this->board[0][k][l][0] != this->board[i][k][l][i])
    680671                        break;
    681672                    if(i==3)
     
    693684                for(int i=1; i<4; i++)
    694685                {
    695                     if(this->board[3-i][k][l][i]==mini4DgamePlayerColor::none || this->board[3][k][l][0] != this->board[3-i][k][l][i])
     686                    if(this->board[3-i][k][l][i]==Mini4DgamePlayerColor::none || this->board[3][k][l][0] != this->board[3-i][k][l][i])
    696687                        break;
    697688                    if(i==3)
     
    710701                for(int i=1; i<4; i++)
    711702                {
    712                     if(this->board[k][i][i][l]==mini4DgamePlayerColor::none || this->board[k][0][0][l] != this->board[k][i][i][l])
     703                    if(this->board[k][i][i][l]==Mini4DgamePlayerColor::none || this->board[k][0][0][l] != this->board[k][i][i][l])
    713704                        break;
    714705                    if(i==3)
     
    726717                for(int i=1; i<4; i++)
    727718                {
    728                     if(this->board[k][3-i][i][l]==mini4DgamePlayerColor::none || this->board[k][3][0][l] != this->board[k][3-i][i][l])
     719                    if(this->board[k][3-i][i][l]==Mini4DgamePlayerColor::none || this->board[k][3][0][l] != this->board[k][3-i][i][l])
    729720                        break;
    730721                    if(i==3)
     
    743734                for(int i=1; i<4; i++)
    744735                {
    745                     if(this->board[k][i][l][i]==mini4DgamePlayerColor::none || this->board[k][0][l][0] != this->board[k][i][l][i])
     736                    if(this->board[k][i][l][i]==Mini4DgamePlayerColor::none || this->board[k][0][l][0] != this->board[k][i][l][i])
    746737                        break;
    747738                    if(i==3)
     
    759750                for(int i=1; i<4; i++)
    760751                {
    761                     if(this->board[k][3-i][l][i]==mini4DgamePlayerColor::none || this->board[k][3][l][0] != this->board[k][3-i][l][i])
     752                    if(this->board[k][3-i][l][i]==Mini4DgamePlayerColor::none || this->board[k][3][l][0] != this->board[k][3-i][l][i])
    762753                        break;
    763754                    if(i==3)
     
    776767                for(int i=1; i<4; i++)
    777768                {
    778                     if(this->board[k][l][i][i]==mini4DgamePlayerColor::none || this->board[k][l][0][0] != this->board[k][l][i][i])
     769                    if(this->board[k][l][i][i]==Mini4DgamePlayerColor::none || this->board[k][l][0][0] != this->board[k][l][i][i])
    779770                        break;
    780771                    if(i==3)
     
    792783                for(int i=1; i<4; i++)
    793784                {
    794                     if(this->board[k][l][3-i][i]==mini4DgamePlayerColor::none || this->board[k][l][3][0] != this->board[k][l][3-i][i])
     785                    if(this->board[k][l][3-i][i]==Mini4DgamePlayerColor::none || this->board[k][l][3][0] != this->board[k][l][3-i][i])
    795786                        break;
    796787                    if(i==3)
     
    813804            for(int k=0;k<4;k++){
    814805                for(int l=0;l<4;l++){
    815                     if(this->board[0][j][k][l]!= mini4DgamePlayerColor::none
     806                    if(this->board[0][j][k][l]!= Mini4DgamePlayerColor::none
    816807                       && this->board[0][j][k][l]==this->board[1][j][k][l]
    817808                       && this->board[1][j][k][l]==this->board[2][j][k][l]
     
    835826            for(int k=0;k<4;k++){
    836827                for(int l=0;l<4;l++){
    837                     if(this->board[i][0][k][l]!= mini4DgamePlayerColor::none
     828                    if(this->board[i][0][k][l]!= Mini4DgamePlayerColor::none
    838829                               && this->board[i][0][k][l]==this->board[i][1][k][l]
    839830                               && this->board[i][1][k][l]==this->board[i][2][k][l]
     
    857848            for(int j=0;j<4;j++){
    858849                for(int l=0;l<4;l++){
    859                     if(this->board[i][j][0][l]!= mini4DgamePlayerColor::none
     850                    if(this->board[i][j][0][l]!= Mini4DgamePlayerColor::none
    860851                                       && this->board[i][j][0][l]==this->board[i][j][1][l]
    861852                                       && this->board[i][j][1][l]==this->board[i][j][2][l]
     
    879870            for(int j=0;j<4;j++){
    880871                for(int k=0;k<4;k++){
    881                     if(this->board[i][j][k][0]!= mini4DgamePlayerColor::none
     872                    if(this->board[i][j][k][0]!= Mini4DgamePlayerColor::none
    882873                                       && this->board[i][j][k][0]==this->board[i][j][k][1]
    883874                                       && this->board[i][j][k][1]==this->board[i][j][k][2]
     
    905896    void Mini4DgameBoard::checkGametype()
    906897    {
    907         if (this->getGametype() != NULL && this->getGametype()->isA(Class(Mini4Dgame)))
     898        if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Mini4Dgame)))
    908899        {
    909900            Mini4Dgame* Mini4DgameGametype = orxonox_cast<Mini4Dgame*>(this->getGametype());
  • code/trunk/src/modules/mini4dgame/Mini4DgameBoard.h

    r10624 r11071  
    4242namespace orxonox
    4343{
     44    enum class Mini4DgamePlayerColor
     45    {
     46        none,
     47        red,
     48        blue,
     49        green
     50    };
    4451
    4552    struct Mini4DgamePosition
     
    5865        int winningHeight[4];
    5966        int winningNumber[4];
    60         int color_;
     67        Mini4DgamePlayerColor color_;
    6168    };
    6269
     
    7481            //virtual ~Mini4DgameBoard();
    7582
    76             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    77 
    7883            bool isValidMove(const Mini4DgamePosition& move);
    7984            void undoMove();
     
    8893            bool player_toggle_;
    8994            BlinkingBillboard* blinkingBillboards[4][4][4][4];
    90             int board[4][4][4][4]; //!< The logical board where the game takes place. board[row][column][height][number]
     95            Mini4DgamePlayerColor board[4][4][4][4]; //!< The logical board where the game takes place. board[row][column][height][number]
    9196    };
    9297}
  • code/trunk/src/modules/notifications/NotificationDispatcher.cc

    r10624 r11071  
    113113        // TODO: Needed?
    114114        const std::string message = this->createNotificationMessage();
    115         NotificationListener::sendNotification(message, this->getSender(), notificationMessageType::info, notificationSendMode::local);
     115        NotificationListener::sendNotification(message, this->getSender(), NotificationMessageType::info, NotificationSendMode::local);
    116116
    117117        // Broadcast
     
    144144            const std::string message = this->createNotificationMessage();
    145145            // TODO: Make the type configurable.
    146             NotificationListener::sendNotification(message, this->getSender(), notificationMessageType::info, notificationSendMode::network, clientId);
     146            NotificationListener::sendNotification(message, this->getSender(), NotificationMessageType::info, NotificationSendMode::network, clientId);
    147147        }
    148148        else if(GameMode::isServer())
     
    177177
    178178        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
    179         PlayerInfo* player = NULL;
     179        PlayerInfo* player = nullptr;
    180180
    181181        // If the trigger is a PlayerTrigger.
    182         if(pTrigger != NULL)
     182        if(pTrigger != nullptr)
    183183        {
    184184            if(!pTrigger->isForPlayer())  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
     
    190190            return false;
    191191
    192         if(player == NULL)
     192        if(player == nullptr)
    193193        {
    194194            orxout(verbose, context::notifications) << "The NotificationDispatcher was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << endl;
  • code/trunk/src/modules/notifications/NotificationDispatcher.h

    r9667 r11071  
    7979            virtual ~NotificationDispatcher(); //!< Destructor.
    8080
    81             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a NotificationDispatcher object through XML.
    82             virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
     81            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a NotificationDispatcher object through XML.
     82            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override;
    8383
    8484            /**
  • code/trunk/src/modules/notifications/NotificationManager.cc

    r10624 r11071  
    6969    {
    7070        // Destroys all Notifications.
    71         for(std::multimap<std::time_t, Notification*>::iterator it = this->allNotificationsList_.begin(); it!= this->allNotificationsList_.end(); it++)
    72             it->second->destroy();
     71        for(const auto& mapEntry : this->allNotificationsList_)
     72            mapEntry.second->destroy();
    7373        this->allNotificationsList_.clear();
    7474
     
    106106        Returns true if successful.
    107107    */
    108     bool NotificationManager::registerNotification(const std::string& message, const std::string& sender, notificationMessageType::Value type)
     108    bool NotificationManager::registerNotification(const std::string& message, const std::string& sender, NotificationMessageType type)
    109109    {
    110110        // TODO: Do something with the type.
     
    124124        Returns true if the command was successfully executed.
    125125    */
    126     bool NotificationManager::executeCommand(notificationCommand::Value command, const std::string& sender)
     126    bool NotificationManager::executeCommand(NotificationCommand command, const std::string& sender)
    127127    {
    128128        bool commandExecuted = false;
    129         if(command == notificationCommand::clear)
     129        if(command == NotificationCommand::clear)
    130130        {
    131131            if(this->commandClear(sender))
     
    152152        bool executed = false;
    153153        // Clear all NotificationQueues that have the input sender as target.
    154         for(std::map<const std::string, NotificationQueue*>::iterator it = this->queues_.begin(); it != this->queues_.end(); it++) // Iterate through all NotificationQueues.
    155         {
    156             const std::set<std::string>& set = it->second->getTargetsSet();
     154        for(const auto& mapEntry : this->queues_) // Iterate through all NotificationQueues.
     155        {
     156            const std::set<std::string>& set = mapEntry.second->getTargetsSet();
    157157            // If either the sender is 'all', the NotificationQueue has as target all or the NotificationQueue has the input sender as a target.
    158158            if(all || set.find(NotificationListener::ALL) != set.end() || set.find(sender) != set.end())
    159                 executed = it->second->tidy() || executed;
     159                executed = mapEntry.second->tidy() || executed;
    160160        }
    161161
     
    187187
    188188        // Insert the Notification in all NotificationQueues that have its sender as target.
    189         for(std::map<const std::string, NotificationQueue*>::iterator it = this->queues_.begin(); it != this->queues_.end(); it++) // Iterate through all NotificationQueues.
    190         {
    191             const std::set<std::string>& set = it->second->getTargetsSet();
     189        for(const auto& mapEntry : this->queues_) // Iterate through all NotificationQueues.
     190        {
     191            const std::set<std::string>& set = mapEntry.second->getTargetsSet();
    192192            bool bAll = set.find(NotificationListener::ALL) != set.end();
    193193            // If either the Notification has as sender 'all', the NotificationQueue displays all Notifications or the NotificationQueue has the sender of the Notification as target.
     
    195195            {
    196196                if(!bAll)
    197                     this->notificationLists_[it->second->getName()]->insert(std::pair<std::time_t, Notification*>(time, notification)); // Insert the Notification in the notifications list of the current NotificationQueue.
    198                 it->second->update(notification, time); // Update the NotificationQueue.
     197                    this->notificationLists_[mapEntry.second->getName()]->insert(std::pair<std::time_t, Notification*>(time, notification)); // Insert the Notification in the notifications list of the current NotificationQueue.
     198                mapEntry.second->update(notification, time); // Update the NotificationQueue.
    199199            }
    200200        }
     
    334334        // If all senders are the target of the NotificationQueue, then the list of Notifications for that specific NotificationQueue is the same as the list of all Notifications.
    335335        bool bAll = set.find(NotificationListener::ALL) != set.end();
    336         std::multimap<std::time_t, Notification*>* map = NULL;
     336        std::multimap<std::time_t, Notification*>* map = nullptr;
    337337        if(bAll)
    338338            this->notificationLists_[queue->getName()] = &this->allNotificationsList_;
     
    345345
    346346        // Iterate through all Notifications to determine whether any of them should belong to the newly registered NotificationQueue.
    347         for(std::multimap<std::time_t, Notification*>::iterator it = this->allNotificationsList_.begin(); it != this->allNotificationsList_.end(); it++)
    348         {
    349             if(!bAll && set.find(it->second->getSender()) != set.end()) // Checks whether the listener has the sender of the current Notification as target.
    350                 map->insert(std::pair<std::time_t, Notification*>(it->first, it->second));
     347        for(const auto& mapEntry : this->allNotificationsList_)
     348        {
     349            if(!bAll && set.find(mapEntry.second->getSender()) != set.end()) // Checks whether the listener has the sender of the current Notification as target.
     350                map->insert(std::pair<std::time_t, Notification*>(mapEntry.first, mapEntry.second));
    351351        }
    352352
     
    395395        The name of the NotificationQueue.
    396396    @return
    397         Returns a pointer to the NotificationQueue with the input name. Returns NULL if no NotificationQueue with such a name exists.
     397        Returns a pointer to the NotificationQueue with the input name. Returns nullptr if no NotificationQueue with such a name exists.
    398398    */
    399399    NotificationQueue* NotificationManager::getQueue(const std::string & name)
    400400    {
    401401        std::map<const std::string, NotificationQueue*>::iterator it = this->queues_.find(name);
    402         // Returns NULL if no such NotificationQueue exists.
     402        // Returns nullptr if no such NotificationQueue exists.
    403403        if(it == this->queues_.end())
    404             return NULL;
     404            return nullptr;
    405405
    406406        return (*it).second;
     
    437437
    438438    */
    439     Notification::Notification(const std::string& message, const std::string& sender, notificationMessageType::Value type)
     439    Notification::Notification(const std::string& message, const std::string& sender, NotificationMessageType type)
    440440    {
    441441        this->initialize();
  • code/trunk/src/modules/notifications/NotificationManager.h

    r9667 r11071  
    6262    {
    6363        public:
    64             Notification(const std::string& message, const std::string& sender, notificationMessageType::Value type);
     64            Notification(const std::string& message, const std::string& sender, NotificationMessageType type);
    6565            virtual ~Notification();
    6666
     
    8989            @return Returns an enum with the type of the Notification.
    9090            */
    91             inline notificationMessageType::Value getType(void) const
     91            inline NotificationMessageType getType(void) const
    9292                { return this->type_; }
    9393
     
    9595            std::string message_; //!< The Notification message.
    9696            std::string sender_; //!< The sender of the notification.
    97             notificationMessageType::Value type_; //!< The type of the notification.
     97            NotificationMessageType type_; //!< The type of the notification.
    9898
    9999            void initialize(void); //!< Registers the object and sets some default values.
     
    120120            virtual ~NotificationManager();
    121121
    122             virtual void preDestroy(void); // Is called before the object is destroyed.
     122            virtual void preDestroy(void) override; // Is called before the object is destroyed.
    123123
    124124            /**
     
    128128            static NotificationManager& getInstance() { return Singleton<NotificationManager>::getInstance(); } // tolua_export
    129129
    130             virtual bool registerNotification(const std::string& message, const std::string& sender, notificationMessageType::Value type);
    131             virtual bool executeCommand(notificationCommand::Value command, const std::string& sender);
     130            virtual bool registerNotification(const std::string& message, const std::string& sender, NotificationMessageType type) override;
     131            virtual bool executeCommand(NotificationCommand command, const std::string& sender) override;
    132132
    133133            bool registerNotification(Notification* notification); // Registers a Notification within the NotificationManager.
  • code/trunk/src/modules/notifications/NotificationQueue.cc

    r9667 r11071  
    206206        {
    207207            // Add all Notifications that have been created after this NotificationQueue was created.
    208             for(std::multimap<std::time_t, Notification*>::iterator it = notifications->begin(); it != notifications->end(); it++)
     208            for(const auto& mapEntry : *notifications)
    209209            {
    210                 if(it->first >= this->creationTime_)
    211                     this->push(it->second, it->first);
     210                if(mapEntry.first >= this->creationTime_)
     211                    this->push(mapEntry.second, mapEntry.first);
    212212            }
    213213        }
     
    336336        this->ordering_.clear();
    337337        // Delete all NotificationContainers in the list.
    338         for(std::vector<NotificationContainer*>::iterator it = this->notifications_.begin(); it != this->notifications_.end(); it++)
    339             delete *it;
     338        for(NotificationContainer* notification : this->notifications_)
     339            delete notification;
    340340
    341341        this->notifications_.clear();
     
    426426        bool first = true;
    427427        // Iterate through the set of targets.
    428         for(std::set<std::string>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); it++)
     428        for(const std::string& target : this->targets_)
    429429        {
    430430            if(!first)
     
    432432            else
    433433                first = false;
    434             stream << *it;
     434            stream << target;
    435435        }
    436436
  • code/trunk/src/modules/notifications/NotificationQueue.h

    r9667 r11071  
    9797            virtual ~NotificationQueue();
    9898
    99             virtual void tick(float dt); // To update from time to time.
    100             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    101 
    102             virtual void changedName(void);
     99            virtual void tick(float dt) override; // To update from time to time.
     100            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     101
     102            virtual void changedName(void) override;
    103103           
    104104            void update(void); // Updates the NotificationQueue.
  • code/trunk/src/modules/notifications/NotificationQueueCEGUI.cc

    r10258 r11071  
    290290        The name of the NotificationQueueCEGUI to be got.
    291291    @return
    292         Returns a pointer to the NotificationQueueCEGUI, or NULL if it doesn't exist.
     292        Returns a pointer to the NotificationQueueCEGUI, or nullptr if it doesn't exist.
    293293    */
    294294    /*static*/ NotificationQueueCEGUI* NotificationQueueCEGUI::getQueue(const std::string& name)
    295295    {
    296296        NotificationQueue* queue = NotificationManager::getInstance().getQueue(name);
    297         if(queue == NULL || !queue->isA(Class(NotificationQueueCEGUI)))
    298             return NULL;
     297        if(queue == nullptr || !queue->isA(Class(NotificationQueueCEGUI)))
     298            return nullptr;
    299299        return static_cast<NotificationQueueCEGUI*>(queue);
    300300    }
  • code/trunk/src/modules/notifications/NotificationQueueCEGUI.h

    r9667 r11071  
    7373            virtual ~NotificationQueueCEGUI();
    7474
    75             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     75            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    7676
    77             virtual void changedName(void);
     77            virtual void changedName(void) override;
    7878
    7979            void destroy(bool noGraphics = false); // Destroys the NotificationQueue.
     
    136136            void registerVariables();
    137137           
    138             virtual void create(void); // Creates the NotificationQueue in lua.
     138            virtual void create(void) override; // Creates the NotificationQueue in lua.
    139139           
    140             virtual void notificationPushed(Notification* notification); // Is called by the NotificationQueue when a Notification was pushed
    141             virtual void notificationPopped(void); // Is called by the NotificationQueue when a Notification was popped.
    142             virtual void notificationRemoved(unsigned int index); // Is called when a Notification was removed.
     140            virtual void notificationPushed(Notification* notification) override; // Is called by the NotificationQueue when a Notification was pushed
     141            virtual void notificationPopped(void) override; // Is called by the NotificationQueue when a Notification was popped.
     142            virtual void notificationRemoved(unsigned int index) override; // Is called when a Notification was removed.
    143143           
    144             virtual void clear(bool noGraphics = false); // Clears the NotificationQueue by removing all NotificationContainers.
     144            virtual void clear(bool noGraphics = false) override; // Clears the NotificationQueue by removing all NotificationContainers.
    145145
    146146        protected:
  • code/trunk/src/modules/objects/Attacher.cc

    r9667 r11071  
    4040        RegisterObject(Attacher);
    4141
    42         this->target_ = 0;
     42        this->target_ = nullptr;
    4343    }
    4444
     
    6161        SUPER(Attacher, changedActivity);
    6262
    63         for (std::list<WorldEntity*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
    64             (*it)->setActive(this->isActive());
     63        for (WorldEntity* object : this->objects_)
     64            object->setActive(this->isActive());
    6565    }
    6666
     
    6969        SUPER(Attacher, changedVisibility);
    7070
    71         for (std::list<WorldEntity*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
    72             (*it)->setVisible(this->isVisible());
     71        for (WorldEntity* object : this->objects_)
     72            object->setVisible(this->isVisible());
    7373    }
    7474
     
    8383    {
    8484        unsigned int i = 0;
    85         for (std::list<WorldEntity*>::const_iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
     85        for (WorldEntity* object : this->objects_)
    8686        {
    8787            if (i == index)
    88                 return (*it);
     88                return object;
    8989
    9090            ++i;
    9191        }
    92         return 0;
     92        return nullptr;
    9393    }
    9494
     
    9696    {
    9797        this->targetname_ = target;
    98         this->target_ = 0;
     98        this->target_ = nullptr;
    9999
    100100        if (this->targetname_.empty())
    101101            return;
    102102
    103         for (ObjectList<WorldEntity>::iterator it = ObjectList<WorldEntity>::begin(); it != ObjectList<WorldEntity>::end(); ++it)
     103        for (WorldEntity* worldEntity : ObjectList<WorldEntity>())
    104104        {
    105             if (it->getName() == this->targetname_)
     105            if (worldEntity->getName() == this->targetname_)
    106106            {
    107                 this->target_ = *it;
    108                 this->attachToParent(*it);
     107                this->target_ = worldEntity;
     108                this->attachToParent(worldEntity);
    109109            }
    110110        }
  • code/trunk/src/modules/objects/Attacher.h

    r9667 r11071  
    5151            virtual ~Attacher() {}
    5252
    53             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     53            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    5454
    55             virtual void processEvent(Event& event);
    56             virtual void changedActivity();
    57             virtual void changedVisibility();
     55            virtual void processEvent(Event& event) override;
     56            virtual void changedActivity() override;
     57            virtual void changedVisibility() override;
    5858
    5959            void addObject(WorldEntity* object);
     
    6464                { return this->targetname_; }
    6565
    66             void loadedNewXMLName(BaseObject* object);
     66            virtual void loadedNewXMLName(BaseObject* object) override;
    6767
    6868        private:
  • code/trunk/src/modules/objects/ForceField.cc

    r9945 r11071  
    6767        this->setMassDiameter(0);   //! We allow point-masses
    6868        this->setLength(2000);
    69         this->mode_ = forceFieldMode::tube;
     69        this->mode_ = ForceFieldMode::tube;
    7070       
    7171        this->registerVariables();
     
    115115    void ForceField::tick(float dt)
    116116    {
    117         if(this->mode_ == forceFieldMode::tube)
    118         {
    119             // Iterate over all objects that could possibly be affected by the ForceField.
    120             for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
     117        if(this->mode_ == ForceFieldMode::tube)
     118        {
     119            // Iterate over all objects that could possibly be affected by the ForceField.
     120            for (MobileEntity* mobileEntity : ObjectList<MobileEntity>())
    121121            {
    122122                // The direction of the orientation of the force field.
     
    125125
    126126                // Vector from the center of the force field to the object its acting on.
    127                 Vector3 distanceVector = it->getWorldPosition() - (this->getWorldPosition() + (this->halfLength_ * direction));
     127                Vector3 distanceVector = mobileEntity->getWorldPosition() - (this->getWorldPosition() + (this->halfLength_ * direction));
    128128
    129129                // The object is outside a ball around the center with radius length/2 of the ForceField.
     
    132132
    133133                // The distance of the object form the orientation vector. (Or rather the smallest distance from the orientation vector)
    134                 float distanceFromDirectionVector = ((it->getWorldPosition() - this->getWorldPosition()).crossProduct(direction)).length();
     134                float distanceFromDirectionVector = ((mobileEntity->getWorldPosition() - this->getWorldPosition()).crossProduct(direction)).length();
    135135
    136136                // If the object in a tube of radius 'radius' around the direction of orientation.
     
    140140                // Apply a force to the object in the direction of the orientation.
    141141                // The force is highest when the object is directly on the direction vector, with a linear decrease, finally reaching zero, when distanceFromDirectionVector = radius.
    142                 it->applyCentralForce((this->radius_ - distanceFromDirectionVector)/this->radius_ * this->velocity_ * direction);
    143             }
    144         }
    145         else if(this->mode_ == forceFieldMode::sphere)
    146         {
    147             // Iterate over all objects that could possibly be affected by the ForceField.
    148             for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
    149             {
    150                 Vector3 distanceVector = it->getWorldPosition() - this->getWorldPosition();
     142                mobileEntity->applyCentralForce((this->radius_ - distanceFromDirectionVector)/this->radius_ * this->velocity_ * direction);
     143            }
     144        }
     145        else if(this->mode_ == ForceFieldMode::sphere)
     146        {
     147            // Iterate over all objects that could possibly be affected by the ForceField.
     148            for (MobileEntity* mobileEntity : ObjectList<MobileEntity>())
     149            {
     150                Vector3 distanceVector = mobileEntity->getWorldPosition() - this->getWorldPosition();
    151151                float distance = distanceVector.length();
    152152                // If the object is within 'radius' distance.
     
    155155                    distanceVector.normalise();
    156156                    // Apply a force proportional to the velocity, with highest force at the origin of the sphere, linear decreasing until reaching a distance of 'radius' from the origin, where the force reaches zero.
    157                     it->applyCentralForce((this->radius_ - distance)/this->radius_ * this->velocity_ * distanceVector);
    158                 }
    159             }
    160         }
    161         else if(this->mode_ == forceFieldMode::invertedSphere)
    162         {
    163             // Iterate over all objects that could possibly be affected by the ForceField.
    164             for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
    165             {
    166                 Vector3 distanceVector = this->getWorldPosition() - it->getWorldPosition();
     157                    mobileEntity->applyCentralForce((this->radius_ - distance)/this->radius_ * this->velocity_ * distanceVector);
     158                }
     159            }
     160        }
     161        else if(this->mode_ == ForceFieldMode::invertedSphere)
     162        {
     163            // Iterate over all objects that could possibly be affected by the ForceField.
     164            for (MobileEntity* mobileEntity : ObjectList<MobileEntity>())
     165            {
     166                Vector3 distanceVector = this->getWorldPosition() - mobileEntity->getWorldPosition();
    167167                float distance = distanceVector.length();
    168168                // If the object is within 'radius' distance and no more than 'length' away from the boundary of the sphere.
     
    172172                    distanceVector.normalise();
    173173                    // Apply a force proportional to the velocity, with highest force at the boundary of the sphere, linear decreasing until reaching a distance of 'radius-length' from the origin, where the force reaches zero.
    174                     it->applyCentralForce((distance-range)/range * this->velocity_ * distanceVector);
    175                 }
    176             }
    177         }
    178         else if(this->mode_ == forceFieldMode::newtonianGravity)
    179         {
    180             // Iterate over all objects that could possibly be affected by the ForceField.
    181             for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
    182             {
    183                 Vector3 distanceVector = it->getWorldPosition() - this->getWorldPosition();
     174                    mobileEntity->applyCentralForce((distance-range)/range * this->velocity_ * distanceVector);
     175                }
     176            }
     177        }
     178        else if(this->mode_ == ForceFieldMode::newtonianGravity)
     179        {
     180            // Iterate over all objects that could possibly be affected by the ForceField.
     181            for (MobileEntity* mobileEntity : ObjectList<MobileEntity>())
     182            {
     183                Vector3 distanceVector = mobileEntity->getWorldPosition() - this->getWorldPosition();
    184184                float distance = distanceVector.length();
    185185                // If the object is within 'radius' distance and especially further away than massRadius_
     
    197197                   
    198198                    // Note: this so called force is actually an acceleration!
    199                     it->applyCentralForce((-1) * (ForceField::attenFactor_ * ForceField::gravConstant_ * this->getMass()) / (distance * distance) * distanceVector);
    200                 }
    201             }
    202         }
    203         else if(this->mode_ == forceFieldMode::homogen)
    204         {
    205             // Iterate over all objects that could possibly be affected by the ForceField.
    206             for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
    207             {
    208                 Vector3 distanceVector = it->getWorldPosition() - this->getWorldPosition();
     199                    mobileEntity->applyCentralForce((-1) * (ForceField::attenFactor_ * ForceField::gravConstant_ * this->getMass()) / (distance * distance) * distanceVector);
     200                }
     201            }
     202        }
     203        else if(this->mode_ == ForceFieldMode::homogen)
     204        {
     205            // Iterate over all objects that could possibly be affected by the ForceField.
     206            for (MobileEntity* mobileEntity : ObjectList<MobileEntity>())
     207            {
     208                Vector3 distanceVector = mobileEntity->getWorldPosition() - this->getWorldPosition();
    209209                float distance = distanceVector.length();
    210210                if (distance < this->radius_ && distance > this->massRadius_)
     
    212212                    // Add a Acceleration in forceDirection_.
    213213                    // Vector3(0,0,0) is the direction, where the force should work.
    214                     it->addAcceleration(forceDirection_ , Vector3(0,0,0));
     214                    mobileEntity->addAcceleration(forceDirection_ , Vector3(0,0,0));
    215215                }
    216216            }
     
    227227    {
    228228        if(mode == ForceField::modeTube_s)
    229             this->mode_ = forceFieldMode::tube;
     229            this->mode_ = ForceFieldMode::tube;
    230230        else if(mode == ForceField::modeSphere_s)
    231             this->mode_ = forceFieldMode::sphere;
     231            this->mode_ = ForceFieldMode::sphere;
    232232        else if(mode == ForceField::modeInvertedSphere_s)
    233             this->mode_ = forceFieldMode::invertedSphere;
     233            this->mode_ = ForceFieldMode::invertedSphere;
    234234        else if(mode == ForceField::modeNewtonianGravity_s)
    235             this->mode_ = forceFieldMode::newtonianGravity;
     235            this->mode_ = ForceFieldMode::newtonianGravity;
    236236
    237237        else if(mode == ForceField::modeHomogen_s)
    238             this->mode_ = forceFieldMode::homogen;
     238            this->mode_ = ForceFieldMode::homogen;
    239239
    240240        else
    241241        {
    242242            orxout(internal_warning) << "Wrong mode '" << mode << "' in ForceField. Setting to 'tube'." << endl;
    243             this->mode_ = forceFieldMode::tube;
     243            this->mode_ = ForceFieldMode::tube;
    244244        }
    245245    }
     
    255255        switch(this->mode_)
    256256        {
    257             case forceFieldMode::tube:
     257            case ForceFieldMode::tube:
    258258                return ForceField::modeTube_s;
    259             case forceFieldMode::sphere:
     259            case ForceFieldMode::sphere:
    260260                return ForceField::modeSphere_s;
    261             case forceFieldMode::invertedSphere:
     261            case ForceFieldMode::invertedSphere:
    262262                return ForceField::modeInvertedSphere_s;
    263             case forceFieldMode::newtonianGravity:
     263            case ForceFieldMode::newtonianGravity:
    264264                return ForceField::modeNewtonianGravity_s;
    265265
    266             case forceFieldMode::homogen:
     266            case ForceFieldMode::homogen:
    267267                return ForceField::modeHomogen_s;
    268268
  • code/trunk/src/modules/objects/ForceField.h

    r10622 r11071  
    5252    @ingroup Objects
    5353    */
    54     namespace forceFieldMode
    55     {
    56         enum Value {
    57             tube, //!< The ForceField has a tube shape.
    58             sphere, //!< The ForceField has a spherical shape.
    59             invertedSphere, //!< The ForceField has a spherical shape but "inverted" behavior.
    60             newtonianGravity, //!< The ForceField imitates Newtonian gravitation for use in stellar bodies.
    61             homogen //!< Local homogenous Force field with changeable direction for the Space Station
    62         };
    63     }
     54    enum class ForceFieldMode {
     55        tube, //!< The ForceField has a tube shape.
     56        sphere, //!< The ForceField has a spherical shape.
     57        invertedSphere, //!< The ForceField has a spherical shape but "inverted" behavior.
     58        newtonianGravity, //!< The ForceField imitates Newtonian gravitation for use in stellar bodies.
     59        homogen //!< Local homogenous Force field with changeable direction for the Space Station
     60    };
    6461
    6562    /**
     
    9289            virtual ~ForceField();
    9390
    94             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Creates a ForceField object through XML.
     91            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Creates a ForceField object through XML.
    9592            void registerVariables(); //!< Registers the variables that should get synchronised over the network
    96             virtual void tick(float dt); //!< A method that is called every tick.
     93            virtual void tick(float dt) override; //!< A method that is called every tick.
    9794           
    9895
     
    172169            float massRadius_; //!< The radius of the stellar body for the Newtonian ForceField.
    173170            float halfLength_; //!< Half of the length of the ForceField.
    174             int mode_; //!< The mode of the ForceField.
     171            ForceFieldMode mode_; //!< The mode of the ForceField.
    175172           
    176173            //! Gravitational constant for Newtonian ForceFields.
  • code/trunk/src/modules/objects/Planet.h

    r10624 r11071  
    5252            virtual ~Planet();
    5353
    54             virtual void tick(float dt);
     54            virtual void tick(float dt) override;
    5555
    56             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     56            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    5757
    58             virtual void changedVisibility();
     58            virtual void changedVisibility() override;
    5959
    6060            inline void setMeshSource(const std::string& meshname)
  • code/trunk/src/modules/objects/Script.cc

    r10624 r11071  
    140140
    141141        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
    142         PlayerInfo* player = NULL;
     142        PlayerInfo* player = nullptr;
    143143
    144144        // If the trigger is a PlayerTrigger.
    145         if(pTrigger != NULL)
     145        if(pTrigger != nullptr)
    146146        {
    147147            if(!pTrigger->isForPlayer())  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
     
    153153            return false;
    154154
    155         if(player == NULL)  //TODO: Will this ever happen? If not, change in NotificationDispatcher as well.
     155        if(player == nullptr)  //TODO: Will this ever happen? If not, change in NotificationDispatcher as well.
    156156        {
    157157            orxout(internal_warning) << "The Script was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << endl;
     
    196196            {
    197197                const std::map<unsigned int, PlayerInfo*> clients = PlayerManager::getInstance().getClients();
    198                 for(std::map<unsigned int, PlayerInfo*>::const_iterator it = clients.begin(); it != clients.end(); it++)
     198                for(const auto& mapEntry : clients)
    199199                {
    200                     callStaticNetworkFunction(&Script::executeHelper, it->first, this->getCode(), this->getMode(), this->getNeedsGraphics());
     200                    callStaticNetworkFunction(&Script::executeHelper, mapEntry.first, this->getCode(), this->getMode(), this->getNeedsGraphics());
    201201                    if(this->times_ != Script::INF) // Decrement the number of remaining executions.
    202202                    {
  • code/trunk/src/modules/objects/Script.h

    r9667 r11071  
    5151    @brief The mode a specific @ref orxonox::Script "Script" is in.
    5252    */
    53     namespace ScriptMode
     53    enum class ScriptMode
    5454    {
    55         enum Value
    56         {
    57             normal, //!< The @ref orxonox::Script "Scripts'" code is executed through the @ref orxonox::CommandExecutor "CommandExecutor".
    58             lua //!< The @ref orxonox::Script "Scripts'" code is executed through lua.
    59         };
    60     }
     55        normal, //!< The @ref orxonox::Script "Scripts'" code is executed through the @ref orxonox::CommandExecutor "CommandExecutor".
     56        lua //!< The @ref orxonox::Script "Scripts'" code is executed through lua.
     57    };
    6158
    6259    /**
     
    9895            virtual ~Script();
    9996
    100             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a Script object through XML.
    101             virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); //!< Creates a port that can be used to channel events and react to them.
     97            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a Script object through XML.
     98            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Creates a port that can be used to channel events and react to them.
    10299
    103100            bool trigger(bool triggered, BaseObject* trigger); //!< Is called when an event comes in trough the event port.
     
    168165                { return this->forAll_; }
    169166
    170             virtual void clientConnected(unsigned int clientId); //!< Callback that is called when a new client has connected.
    171             virtual void clientDisconnected(unsigned int clientid) {}
     167            virtual void clientConnected(unsigned int clientId) override; //!< Callback that is called when a new client has connected.
     168            virtual void clientDisconnected(unsigned int clientid) override {}
    172169
    173170        private:
     
    178175
    179176            std::string code_; //!< The code that is executed by this Script.
    180             ScriptMode::Value mode_; //!< The mode the Script is in. Determines whether the code is executed the normal way or in lua.
     177            ScriptMode mode_; //!< The mode the Script is in. Determines whether the code is executed the normal way or in lua.
    181178            std::string modeStr_; //!< The mode the Script is in, as a string. Is used for networking purposes.
    182179            bool onLoad_; //!< Whether the Scripts code is executed upon loading (creation) of this Script.
     
    193190            @param mode The mode of the Script.
    194191            */
    195             inline void setMode(ScriptMode::Value mode)
     192            inline void setMode(ScriptMode mode)
    196193                { this->mode_ = mode; }
    197194    };
  • code/trunk/src/modules/objects/SpaceBoundaries.cc

    r10624 r11071  
    5959            this->pawnsIn_.clear();
    6060
    61             for( std::vector<BillboardAdministration>::iterator current = this->billboards_.begin(); current != this->billboards_.end(); current++)
     61            for(BillboardAdministration& billboard : this->billboards_)
    6262            {
    63                 if( current->billy != NULL)
    64                 {
    65                     delete current->billy;
     63                if( billboard.billy != nullptr)
     64                {
     65                    delete billboard.billy;
    6666                }
    6767            }
     
    7373    {
    7474        pawnsIn_.clear();
    75         for(ObjectList<Pawn>::iterator current = ObjectList<Pawn>::begin(); current != ObjectList<Pawn>::end(); ++current)
    76         {
    77             Pawn* currentPawn = *current;
     75        for(Pawn* currentPawn : ObjectList<Pawn>())
     76        {
    7877            if( this->reaction_ == 0 )
    7978            {
     
    127126    void SpaceBoundaries::setBillboardOptions(Billboard *billy)
    128127    {
    129         if(billy != NULL)
     128        if(billy != nullptr)
    130129        {
    131130            billy->setMaterial("Grid");
     
    138137    void SpaceBoundaries::removeAllBillboards()
    139138    {
    140         for( std::vector<BillboardAdministration>::iterator current = this->billboards_.begin(); current != this->billboards_.end(); current++ )
    141         {
    142             current->usedYet = false;
    143             current->billy->setVisible(false);
     139        for(BillboardAdministration& billboard : this->billboards_)
     140        {
     141            billboard.usedYet = false;
     142            billboard.billy->setVisible(false);
    144143        }
    145144    }
     
    208207        float distance;
    209208        bool humanItem;
    210         for( std::list<WeakPtr<Pawn> >::iterator current = pawnsIn_.begin(); current != pawnsIn_.end(); current++ )
    211         {
    212             Pawn* currentPawn = *current;
     209        for(Pawn* currentPawn : pawnsIn_)
     210        {
    213211            if( currentPawn && currentPawn->getNode() )
    214212            {
     
    250248    float SpaceBoundaries::computeDistance(WorldEntity *item)
    251249    {
    252         if(item != NULL)
     250        if(item != nullptr)
    253251        {
    254252            Vector3 itemPosition = item->getWorldPosition();
     
    310308    bool SpaceBoundaries::isHumanPlayer(Pawn *item)
    311309    {
    312         if(item != NULL)
     310        if(item != nullptr)
    313311        {
    314312            if(item->getPlayer())
  • code/trunk/src/modules/objects/SpaceBoundaries.h

    r9667 r11071  
    9393            int getReaction();
    9494
    95             void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     95            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    9696
    97             void tick(float dt);
     97            virtual void tick(float dt) override;
    9898
    9999        private:
     
    101101
    102102            // Variabeln::
    103             std::list<WeakPtr<Pawn> > pawnsIn_; //!< List of the pawns that this instance of SpaceBoundaries has to handle.
     103            std::list<WeakPtr<Pawn>> pawnsIn_; //!< List of the pawns that this instance of SpaceBoundaries has to handle.
    104104
    105105            std::vector<BillboardAdministration> billboards_;
  • code/trunk/src/modules/objects/Turret.cc

    r10622 r11071  
    278278            //slower the closer it is to the destination
    279279            Quaternion drot = Quaternion::nlerp(dt*this->rotationThrust_/20.f, Quaternion::IDENTITY, this->rotation_);
    280             this->rotate(drot, WorldEntity::World);
     280            this->rotate(drot, WorldEntity::TransformSpace::World);
    281281            this->rotation_ = Quaternion::IDENTITY;
    282282        }
  • code/trunk/src/modules/objects/Turret.h

    r11052 r11071  
    6161            virtual ~Turret();
    6262
    63             virtual void rotatePitch(const Vector2& value);
    64             virtual void rotateYaw(const Vector2& value);
    65             virtual void rotateRoll(const Vector2& value);
     63            virtual void rotatePitch(const Vector2& value) override;
     64            virtual void rotateYaw(const Vector2& value) override;
     65            virtual void rotateRoll(const Vector2& value) override;
    6666            virtual float isInRange(const WorldEntity* target);
    6767            virtual void aimAtPosition(const Vector3 &position);
    6868
    69             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    70             virtual void tick(float dt);
     69            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     70            virtual void tick(float dt) override;
    7171
    7272            /** @brief Sets the maximum distance the turret is allowed to shoot. @param radius The distance*/
  • code/trunk/src/modules/objects/controllers/TeamTargetProxy.cc

    r10262 r11071  
    2828
    2929#include "TeamTargetProxy.h"
     30#include "core/CoreIncludes.h"
    3031#include "worldentities/ControllableEntity.h"
    3132#include "worldentities/pawns/Pawn.h"
  • code/trunk/src/modules/objects/controllers/TurretController.cc

    r10622 r11071  
    3030#include "worldentities/pawns/Pawn.h"
    3131#include "objects/Turret.h"
     32#include "core/object/ObjectList.h"
     33#include "core/CoreIncludes.h"
    3234
    3335 namespace orxonox
     
    8183        {
    8284            this->forgetTarget();
    83             turret->setTarget(0);
     85            turret->setTarget(nullptr);
    8486        }
    8587
     
    99101        float minScore = FLT_MAX;
    100102        float tempScore;
    101         Pawn* minScorePawn = 0;
    102 
    103         for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
    104         {
    105             Pawn* entity = orxonox_cast<Pawn*>(*it);
    106             if (!entity || FormationController::sameTeam(turret, entity, this->getGametype()))
     103        Pawn* minScorePawn = nullptr;
     104
     105        for (Pawn* pawn : ObjectList<Pawn>())
     106        {
     107            if (!pawn || FormationController::sameTeam(turret, pawn, this->getGametype()))
    107108                continue;
    108             tempScore = turret->isInRange(entity);
     109            tempScore = turret->isInRange(pawn);
    109110            if(tempScore != -1.f)
    110111            {
     
    112113                {
    113114                    minScore = tempScore;
    114                     minScorePawn = entity;
     115                    minScorePawn = pawn;
    115116                }
    116117            }
  • code/trunk/src/modules/objects/eventsystem/EventDispatcher.cc

    r9667 r11071  
    4545    {
    4646        if (this->isInitialized())
    47             for (std::list<BaseObject*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)
    48                 (*it)->destroy();
     47            for (BaseObject* target : this->targets_)
     48                target->destroy();
    4949    }
    5050
     
    6161    void EventDispatcher::processEvent(Event& event)
    6262    {
    63         for (std::list<BaseObject*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)
    64             (*it)->processEvent(event);
     63        for (BaseObject* target : this->targets_)
     64            target->processEvent(event);
    6565    }
    6666
     
    7373    {
    7474        unsigned int i = 0;
    75         for (std::list<BaseObject*>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)
     75        for (BaseObject* target : this->targets_)
    7676        {
    7777            if (i == index)
    78                 return (*it);
     78                return target;
    7979            ++i;
    8080        }
    81         return 0;
     81        return nullptr;
    8282    }
    8383}
  • code/trunk/src/modules/objects/eventsystem/EventFilter.cc

    r9667 r11071  
    7070        {
    7171            bool success = false;
    72             for (std::list<EventName*>::const_iterator it = this->names_.begin(); it != this->names_.end(); ++it)
     72            for (EventName* name : this->names_)
    7373            {
    74                 if ((*it)->getName() == event.name_)
     74                if (name->getName() == event.name_)
    7575                {
    7676                    success = true;
     
    9696    {
    9797        unsigned int i = 0;
    98         for (std::list<BaseObject*>::const_iterator it = this->sources_.begin(); it != this->sources_.end(); ++it)
     98        for (BaseObject* source : this->sources_)
    9999        {
    100100            if (i == index)
    101                 return (*it);
     101                return source;
    102102            ++i;
    103103        }
    104         return 0;
     104        return nullptr;
    105105    }
    106106
     
    113113    {
    114114        unsigned int i = 0;
    115         for (std::list<EventName*>::const_iterator it = this->names_.begin(); it != this->names_.end(); ++it)
     115        for (EventName* name : this->names_)
    116116        {
    117117            if (i == index)
    118                 return (*it);
     118                return name;
    119119            ++i;
    120120        }
    121         return 0;
     121        return nullptr;
    122122    }
    123123}
  • code/trunk/src/modules/objects/eventsystem/EventListener.cc

    r9667 r11071  
    7878            return;
    7979
    80         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
    81             if (it->getName() == this->eventName_)
    82                 this->addEventSource(*it, "");
     80        for (BaseObject* object : ObjectList<BaseObject>())
     81            if (object->getName() == this->eventName_)
     82                this->addEventSource(object, "");
    8383    }
    8484
  • code/trunk/src/modules/objects/eventsystem/EventTarget.cc

    r9667 r11071  
    7373        this->target_ = name;
    7474
    75         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
    76             if (it->getName() == this->target_)
    77                 this->addEventTarget(*it);
     75        for (BaseObject* object : ObjectList<BaseObject>())
     76            if (object->getName() == this->target_)
     77                this->addEventTarget(object);
    7878    }
    7979
  • code/trunk/src/modules/objects/triggers/CheckPoint.cc

    r10624 r11071  
    5656
    5757        this->setRadarObjectColour(ColourValue::Green);
    58         this->setRadarObjectShape(RadarViewable::Dot);
     58        this->setRadarObjectShape(RadarViewable::Shape::Dot);
    5959        this->setRadarVisibility(false);
    6060
  • code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc

    r10624 r11071  
    5858
    5959        this->distance_ = 100.0f;
    60         this->setBeaconModeDirect(distanceMultiTriggerBeaconMode::off);
     60        this->setBeaconModeDirect(DistanceMultiTriggerBeaconMode::off);
    6161        this->targetName_ = "";
    6262        this->beaconMask_.exclude(Class(BaseObject));
     
    9797    {
    9898
    99         std::queue<MultiTriggerState*>* queue = NULL;
     99        std::queue<MultiTriggerState*>* queue = nullptr;
    100100
    101101        // Check for objects that were in range but no longer are. Iterate through all objects, that are in range.
    102         for(std::set<WeakPtr<WorldEntity> >::iterator it = this->range_.begin(); it != this->range_.end(); )
     102        for(std::set<WeakPtr<WorldEntity>>::iterator it = this->range_.begin(); it != this->range_.end(); )
    103103        {
    104104            WorldEntity* entity = *it;
    105105
    106106            // If the entity no longer exists.
    107             if(entity == NULL)
     107            if(entity == nullptr)
    108108            {
    109109                this->range_.erase(it++);
     
    118118
    119119                // If no queue has been created, yet.
    120                 if(queue == NULL)
     120                if(queue == nullptr)
    121121                    queue = new std::queue<MultiTriggerState*>();
    122122
     
    136136        ClassTreeMask targetMask = this->getTargetMask();
    137137        // If we are in identify-mode another target mask has to be applies to find the DistanceTriggerBeacons.
    138         if(this->beaconMode_ == distanceMultiTriggerBeaconMode::identify)
     138        if(this->beaconMode_ == DistanceMultiTriggerBeaconMode::identify)
    139139            targetMask = this->beaconMask_;
    140140
     
    145145
    146146            // If the DistanceMultiTrigger is in identify-mode and the DistanceTriggerBeacon attached to the object has the wrong name we ignore it.
    147             if(this->beaconMode_ == distanceMultiTriggerBeaconMode::identify)
     147            if(this->beaconMode_ == DistanceMultiTriggerBeaconMode::identify)
    148148            {
    149149                if(entity->getName() != this->targetName_)
     
    155155           
    156156            // If the DistanceMultiTrigger is in exclude mode and the DistanceTriggerBeacon attached to the object has the right name, we ignore it.
    157             if(this->beaconMode_ == distanceMultiTriggerBeaconMode::exclude)
     157            if(this->beaconMode_ == DistanceMultiTriggerBeaconMode::exclude)
    158158            {
    159159               
    160                 const std::set<WorldEntity*> attached = entity->getAttachedObjects();
     160                const std::set<WorldEntity*> attachedObjects = entity->getAttachedObjects();
    161161                bool found = false;
    162                 for(std::set<WorldEntity*>::const_iterator it = attached.begin(); it != attached.end(); it++)
     162                for(WorldEntity* attachedObject : attachedObjects)
    163163                {
    164                     if((*it)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(*it)->getName() == this->targetName_)
     164                    if(attachedObject->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(attachedObject)->getName() == this->targetName_)
    165165                    {
    166166                        found = true;
     
    182182
    183183                // Change the entity to the parent of the DistanceTriggerBeacon (if in identify-mode), which is the entity to which the beacon is attached.
    184                 if(this->beaconMode_ == distanceMultiTriggerBeaconMode::identify)
     184                if(this->beaconMode_ == DistanceMultiTriggerBeaconMode::identify)
    185185                    entity = entity->getParent();
    186186
    187187                // If no queue has been created, yet.
    188                 if(queue == NULL)
     188                if(queue == nullptr)
    189189                    queue = new std::queue<MultiTriggerState*>();
    190190
     
    206206        The mode as an enum.
    207207    */
    208     void DistanceMultiTrigger::setBeaconModeDirect(distanceMultiTriggerBeaconMode::Value mode)
     208    void DistanceMultiTrigger::setBeaconModeDirect(DistanceMultiTriggerBeaconMode mode)
    209209    {
    210210        this->beaconMode_ = mode;
     
    221221        switch(this->getBeaconModeDirect())
    222222        {
    223             case distanceMultiTriggerBeaconMode::off :
     223            case DistanceMultiTriggerBeaconMode::off :
    224224                return DistanceMultiTrigger::beaconModeOff_s;
    225             case distanceMultiTriggerBeaconMode::identify:
     225            case DistanceMultiTriggerBeaconMode::identify:
    226226                return DistanceMultiTrigger::beaconModeIdentify_s;
    227             case distanceMultiTriggerBeaconMode::exclude:
     227            case DistanceMultiTriggerBeaconMode::exclude:
    228228                return DistanceMultiTrigger::beaconModeExlcude_s;
    229229            default :
     
    242242    {
    243243        if(mode == DistanceMultiTrigger::beaconModeOff_s)
    244             this->setBeaconModeDirect(distanceMultiTriggerBeaconMode::off);
     244            this->setBeaconModeDirect(DistanceMultiTriggerBeaconMode::off);
    245245        else if(mode == DistanceMultiTrigger::beaconModeIdentify_s)
    246             this->setBeaconModeDirect(distanceMultiTriggerBeaconMode::identify);
     246            this->setBeaconModeDirect(DistanceMultiTriggerBeaconMode::identify);
    247247        else if(mode == DistanceMultiTrigger::beaconModeExlcude_s)
    248             this->setBeaconModeDirect(distanceMultiTriggerBeaconMode::exclude);
     248            this->setBeaconModeDirect(DistanceMultiTriggerBeaconMode::exclude);
    249249        else
    250250            orxout(internal_error, context::triggers) << "Invalid beacon mode in DistanceMultiTrigger." << endl;
     
    261261    bool DistanceMultiTrigger::addToRange(WorldEntity* entity)
    262262    {
    263         std::pair<std::set<WeakPtr<WorldEntity> >::iterator, bool> pair = this->range_.insert(entity);
     263        std::pair<std::set<WeakPtr<WorldEntity>>::iterator, bool> pair = this->range_.insert(entity);
    264264        return pair.second;
    265265    }
  • code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h

    r10624 r11071  
    5555    @ingroup MultiTrigger
    5656    */
    57     namespace distanceMultiTriggerBeaconMode
    58     {
    59         enum Value {
    60             off, //!< The DistanceMultiTrigger is not in <em>beacon-mode</em>.
    61             identify, //!< The DistanceTrigger is in <em>identify-mode</em>.
    62             exclude //!< The DistanceTrigger is in <em>exclude-mode</em>.
    63         };
    64     }
     57    enum class DistanceMultiTriggerBeaconMode {
     58        off, //!< The DistanceMultiTrigger is not in <em>beacon-mode</em>.
     59        identify, //!< The DistanceTrigger is in <em>identify-mode</em>.
     60        exclude //!< The DistanceTrigger is in <em>exclude-mode</em>.
     61    };
    6562
    6663    /**
     
    113110                { return this->distance_; }
    114111           
    115             void setBeaconModeDirect(distanceMultiTriggerBeaconMode::Value mode); // Set the beacon mode.
     112            void setBeaconModeDirect(DistanceMultiTriggerBeaconMode mode); // Set the beacon mode.
    116113            /**
    117114            @brief Get the beacon mode.
    118115            @return Returns the mode as an enum.
    119116            */
    120             inline distanceMultiTriggerBeaconMode::Value getBeaconModeDirect(void) const
     117            inline DistanceMultiTriggerBeaconMode getBeaconModeDirect(void) const
    121118                { return this->beaconMode_; }
    122119            void setBeaconMode(const std::string& mode); // Set the beacon mode.
     
    149146            float distance_; //!< The distance at which the DistanceMultiTrigger triggers.
    150147
    151             distanceMultiTriggerBeaconMode::Value beaconMode_; //!< The beacon mode, the DistanceMultiTrigger is in.
     148            DistanceMultiTriggerBeaconMode beaconMode_; //!< The beacon mode, the DistanceMultiTrigger is in.
    152149            std::string targetName_; //!< The target name, used in <em>single-target</em> mode.
    153150            ClassTreeMask beaconMask_; //!< A mask, that only accepts DistanceTriggerBeacons.
    154151
    155             std::set<WeakPtr<WorldEntity> > range_; //!< The set of entities that currently are in range of the DistanceMultiTrigger.
     152            std::set<WeakPtr<WorldEntity>> range_; //!< The set of entities that currently are in range of the DistanceMultiTrigger.
    156153
    157154    };
  • code/trunk/src/modules/objects/triggers/DistanceTrigger.cc

    r10624 r11071  
    106106            this->setForPlayer(true);
    107107
    108         if (targetId == NULL)
     108        if (targetId == nullptr)
    109109        {
    110110            orxout(internal_error, context::triggers) << "\"" << targetStr << "\" is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ')' << endl;
     
    147147    {
    148148        // Check whether there is a cached object, it still exists and whether it is still in range, if so nothing further needs to be done.
    149         if(this->cache_ != NULL)
     149        if(this->cache_ != nullptr)
    150150        {
    151151            if((this->cache_->getWorldPosition() - this->getWorldPosition()).length() < this->distance_)
     
    158158        ClassTreeMask targetMask = this->targetMask_;
    159159        // If we are in identify-mode another target mask has to be applies to find the DistanceTriggerBeacons.
    160         if(this->beaconMode_ == distanceTriggerBeaconMode::identify)
     160        if(this->beaconMode_ == DistanceTriggerBeaconMode::identify)
    161161            targetMask = this->beaconMask_;
    162162
     
    167167
    168168            // If the DistanceTrigger is in identify-mode and the DistanceTriggerBeacon attached to the object has the wrong name we ignore it.
    169             if(this->beaconMode_ == distanceTriggerBeaconMode::identify)
     169            if(this->beaconMode_ == DistanceTriggerBeaconMode::identify)
    170170            {
    171171                if(entity->getName() != this->targetName_)
     
    177177
    178178            // If the DistanceTrigger is in exclude mode and the DistanceTriggerBeacon attached to the object has the right name, we ignore it.
    179             if(this->beaconMode_ == distanceTriggerBeaconMode::exclude)
     179            if(this->beaconMode_ == DistanceTriggerBeaconMode::exclude)
    180180            {
    181181
    182                 const std::set<WorldEntity*> attached = entity->getAttachedObjects();
     182                const std::set<WorldEntity*> attachedObjects = entity->getAttachedObjects();
    183183                bool found = false;
    184                 for(std::set<WorldEntity*>::const_iterator it = attached.begin(); it != attached.end(); it++)
     184                for(WorldEntity* attachedObject : attachedObjects)
    185185                {
    186                     if((*it)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(*it)->getName() == this->targetName_)
     186                    if(attachedObject->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(attachedObject)->getName() == this->targetName_)
    187187                    {
    188188                        found = true;
     
    202202                {
    203203                    // Change the entity to the parent of the DistanceTriggerBeacon (if in identify-mode), which is the entity to which the beacon is attached.
    204                     if(this->beaconMode_ == distanceTriggerBeaconMode::identify)
     204                    if(this->beaconMode_ == DistanceTriggerBeaconMode::identify)
    205205                        entity = entity->getParent();
    206206
    207207                    Pawn* pawn = orxonox_cast<Pawn*>(entity);
    208                     if(pawn != NULL)
     208                    if(pawn != nullptr)
    209209                        this->setTriggeringPawn(pawn);
    210210                    else
    211                         orxout(internal_warning, context::triggers) << "Pawn was NULL." << endl;
     211                        orxout(internal_warning, context::triggers) << "Pawn was nullptr." << endl;
    212212                }
    213213               
     
    228228        The mode as an enum.
    229229    */
    230     void DistanceTrigger::setBeaconModeDirect(distanceTriggerBeaconMode::Value mode)
     230    void DistanceTrigger::setBeaconModeDirect(DistanceTriggerBeaconMode mode)
    231231    {
    232232        this->beaconMode_ = mode;
     
    243243        switch(this->getBeaconModeDirect())
    244244        {
    245             case distanceTriggerBeaconMode::off :
     245            case DistanceTriggerBeaconMode::off :
    246246                return DistanceTrigger::beaconModeOff_s;
    247             case distanceTriggerBeaconMode::identify:
     247            case DistanceTriggerBeaconMode::identify:
    248248                return DistanceTrigger::beaconModeIdentify_s;
    249             case distanceTriggerBeaconMode::exclude:
     249            case DistanceTriggerBeaconMode::exclude:
    250250                return DistanceTrigger::beaconModeExlcude_s;
    251251            default :
     
    264264    {
    265265        if(mode == DistanceTrigger::beaconModeOff_s)
    266             this->setBeaconModeDirect(distanceTriggerBeaconMode::off);
     266            this->setBeaconModeDirect(DistanceTriggerBeaconMode::off);
    267267        else if(mode == DistanceTrigger::beaconModeIdentify_s)
    268             this->setBeaconModeDirect(distanceTriggerBeaconMode::identify);
     268            this->setBeaconModeDirect(DistanceTriggerBeaconMode::identify);
    269269        else if(mode == DistanceTrigger::beaconModeExlcude_s)
    270             this->setBeaconModeDirect(distanceTriggerBeaconMode::exclude);
     270            this->setBeaconModeDirect(DistanceTriggerBeaconMode::exclude);
    271271        else
    272272            orxout(internal_error, context::triggers) << "Invalid beacon mode in DistanceTrigger." << endl;
     
    282282        Returns true if it is triggered ,false if not.
    283283    */
    284     bool DistanceTrigger::isTriggered(TriggerMode::Value mode)
     284    bool DistanceTrigger::isTriggered(TriggerMode mode)
    285285    {
    286286        if (Trigger::isTriggered(mode))
  • code/trunk/src/modules/objects/triggers/DistanceTrigger.h

    r9667 r11071  
    5555  @ingroup NormalTrigger
    5656  */
    57   namespace distanceTriggerBeaconMode
    58   {
    59       enum Value {
    60           off,
    61           identify,
    62           exclude
    63       };
    64   }
     57  enum class DistanceTriggerBeaconMode {
     58      off,
     59      identify,
     60      exclude
     61  };
    6562
    6663    /**
     
    118115                { return this->distance_; }
    119116
    120             void setBeaconModeDirect(distanceTriggerBeaconMode::Value mode); // Set the beacon mode.
     117            void setBeaconModeDirect(DistanceTriggerBeaconMode mode); // Set the beacon mode.
    121118            /**
    122119            @brief Get the beacon mode.
    123120            @return Returns the mode as an enum.
    124121            */
    125             inline distanceTriggerBeaconMode::Value getBeaconModeDirect(void) const
     122            inline DistanceTriggerBeaconMode getBeaconModeDirect(void) const
    126123            { return this->beaconMode_; }
    127124            void setBeaconMode(const std::string& mode); // Set the beacon mode.
     
    144141
    145142        protected:
    146             virtual bool isTriggered(TriggerMode::Value mode); // Check whether the DistanceTrigger is triggered.
     143            virtual bool isTriggered(TriggerMode mode) override; // Check whether the DistanceTrigger is triggered.
    147144            /**
    148145            @brief Notifies interested parties about a change of the DistanceTrigger's target mask.
     
    160157            float distance_; //!< The range of the DistanceTrigger.
    161158           
    162             distanceTriggerBeaconMode::Value beaconMode_; //!< The beacon mode.
     159            DistanceTriggerBeaconMode beaconMode_; //!< The beacon mode.
    163160            std::string targetName_; //!< The name a DistanceTriggerBeacon needs to have to make the DistanceTrigger react to it if in beacon-mode.
    164161            ClassTreeMask beaconMask_; //!< A mask, that only accepts DistanceTriggerBeacons.
  • code/trunk/src/modules/objects/triggers/EventMultiTrigger.cc

    r9667 r11071  
    9696    {
    9797        // If the originator is a MultiTriggerContainer, the event originates from a MultiTrigger and thus the event only triggers the EventMultiTrigger for the originator that caused the MultiTrigger to trigger.
    98         if(originator != NULL && originator->isA(ClassIdentifier<MultiTriggerContainer>::getIdentifier()))
     98        if(originator != nullptr && originator->isA(ClassIdentifier<MultiTriggerContainer>::getIdentifier()))
    9999        {
    100100            MultiTriggerContainer* container = static_cast<MultiTriggerContainer*>(originator);
  • code/trunk/src/modules/objects/triggers/EventTrigger.cc

    r9667 r11071  
    7979        It should be triggered if it is triggered according just to its sub-triggers and if the last event that came in was an event that changed from not triggered to triggered.
    8080    */
    81     bool EventTrigger::isTriggered(TriggerMode::Value mode)
     81    bool EventTrigger::isTriggered(TriggerMode mode)
    8282    {
    8383        if (Trigger::isTriggered(mode))
  • code/trunk/src/modules/objects/triggers/EventTrigger.h

    r9667 r11071  
    8484
    8585        protected:
    86             virtual bool isTriggered(TriggerMode::Value mode); // Check whether the EventTrigger should be triggered.
     86            virtual bool isTriggered(TriggerMode mode) override; // Check whether the EventTrigger should be triggered.
    8787
    8888        private:
  • code/trunk/src/modules/objects/triggers/MultiTrigger.cc

    r11020 r11071  
    124124        // Let the MultiTrigger return the states that trigger and process the new states if there are any.
    125125        std::queue<MultiTriggerState*>* queue  = this->letTrigger();
    126         if(queue != NULL)
     126        if(queue != nullptr)
    127127        {
    128128            while(queue->size() > 0)
    129129            {
    130130                MultiTriggerState* state = queue->front();
    131                 // If the state is NULL. (This really shouldn't happen)
    132                 if(state == NULL)
     131                // If the state is nullptr. (This really shouldn't happen)
     132                if(state == nullptr)
    133133                {
    134                     orxout(internal_error, context::triggers) << "In MultiTrigger '" << this->getName() << "' (&" << this << "), Error: State of new states queue was NULL. State ignored." << endl;
     134                    orxout(internal_error, context::triggers) << "In MultiTrigger '" << this->getName() << "' (&" << this << "), Error: State of new states queue was nullptr. State ignored." << endl;
    135135                    queue->pop();
    136136                    continue;
     
    227227                            {
    228228                                // If the MultiTrigger is set to broadcast and has no originator a boradcast is fired.
    229                                 if(this->getBroadcast() && state->originator == NULL)
     229                                if(this->getBroadcast() && state->originator == nullptr)
    230230                                    this->broadcast(bActive);
    231231                                // Else a normal event is fired.
     
    240240                        {
    241241                            // Print some debug output if the state has changed.
    242                             if(state->originator != NULL)
     242                            if(state->originator != nullptr)
    243243                                orxout(verbose, context::triggers) << "MultiTrigger '" << this->getName() << "' (&" << this << ") changed state. originator: " << state->originator->getIdentifier()->getName() << " (&" << state->originator << "), active: " << bActive << ", triggered: " << state->bTriggered << "." << endl;
    244244                            else
    245                                 orxout(verbose, context::triggers) << "MultiTrigger '" << this->getName() << "' (&" << this << ") changed state. originator: NULL, active: " << bActive << ", triggered: " << state->bTriggered << "." << endl;
     245                                orxout(verbose, context::triggers) << "MultiTrigger '" << this->getName() << "' (&" << this << ") changed state. originator: nullptr, active: " << bActive << ", triggered: " << state->bTriggered << "." << endl;
    246246
    247247                            // If the MultiTrigger has a parent trigger, that is itself a MultiTrigger, it needs to call a method to notify him, that its activity has changed.
    248                             if(this->parent_ != NULL && this->parent_->isMultiTrigger())
     248                            if(this->parent_ != nullptr && this->parent_->isMultiTrigger())
    249249                                static_cast<MultiTrigger*>(this->parent_)->childActivityChanged(state->originator);
    250250                        }
     
    265265                else
    266266                {
    267                     this->stateQueue_.push_back(std::pair<float, MultiTriggerState*>(timeRemaining-dt, state));
     267                    this->stateQueue_.emplace_back(timeRemaining-dt, state);
    268268                    this->stateQueue_.pop_front();
    269269                }
     
    299299
    300300        // If the target is not a valid class name display an error.
    301         if (target == NULL)
     301        if (target == nullptr)
    302302        {
    303303            orxout(internal_error, context::triggers) << "'" << targetStr << "' is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ")" << endl;
     
    327327
    328328        // If the target is not a valid class name display an error.
    329         if (target == NULL)
     329        if (target == nullptr)
    330330        {
    331331            orxout(internal_error, context::triggers) << "'" << targetStr << "' is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ")" << endl;
     
    346346    std::queue<MultiTriggerState*>* MultiTrigger::letTrigger(void)
    347347    {
    348         return NULL;
     348        return nullptr;
    349349    }
    350350
     
    443443    void MultiTrigger::fire(bool status, BaseObject* originator)
    444444    {
    445         // If the originator is NULL, a normal event without MultiTriggerContainer is sent.
    446         if(originator == NULL)
     445        // If the originator is nullptr, a normal event without MultiTriggerContainer is sent.
     446        if(originator == nullptr)
    447447        {
    448448            this->fireEvent(status);
     
    479479    bool MultiTrigger::addState(MultiTriggerState* state)
    480480    {
    481         assert(state); // The state really shouldn't be NULL.
     481        assert(state); // The state really shouldn't be nullptr.
    482482
    483483        // If the originator is no target of this MultiTrigger.
     
    489489
    490490        // Add it ot the state queue with the delay specified for the MultiTrigger.
    491         this->stateQueue_.push_back(std::pair<float, MultiTriggerState*>(this->getDelay(), state));
     491        this->stateQueue_.emplace_back(this->getDelay(), state);
    492492
    493493        return true;
     
    504504    bool MultiTrigger::checkAnd(BaseObject* triggerer)
    505505    {
    506         for(std::set<TriggerBase*>::iterator it = this->children_.begin(); it != this->children_.end(); ++it)
    507         {
    508             TriggerBase* trigger = *it;
     506        for(TriggerBase* trigger : this->children_)
     507        {
    509508            if(trigger->isMultiTrigger())
    510509            {
     
    531530    bool MultiTrigger::checkOr(BaseObject* triggerer)
    532531    {
    533         for(std::set<TriggerBase*>::iterator it = this->children_.begin(); it != this->children_.end(); ++it)
    534         {
    535             TriggerBase* trigger = *it;
     532        for(TriggerBase* trigger : this->children_)
     533        {
    536534            if(trigger->isMultiTrigger())
    537535            {
     
    559557    {
    560558        bool triggered = false;
    561         for(std::set<TriggerBase*>::iterator it = this->children_.begin(); it != this->children_.end(); ++it)
    562         {
    563             TriggerBase* trigger = *it;
     559        for(TriggerBase* trigger : this->children_)
     560        {
    564561            if(triggered)
    565562            {
  • code/trunk/src/modules/objects/triggers/MultiTrigger.h

    r9667 r11071  
    7676        - @b simultaneousTriggerers The number of simultaneous triggerers limits the number of objects that are allowed to trigger the MultiTrigger at the same time. Or more precisely, the number of distinct objects the MultiTrigger has <em>triggered</em> states for, at each point in time. The default is <code>-1</code>, which denotes infinity.
    7777        - @b mode The mode describes how the MultiTrigger acts in relation to all the triggers, that are appended to it. There are 3 modes: <em>and</em>, meaning that the MultiTrigger can only be triggered if all the appended triggers are active. <em>or</em>, meaning that the MultiTrigger can only triggered if at least one of the appended triggers is active. And <em>xor</em>, meaning that the MultiTrigger can only be triggered if one and only one appended trigger is active. Note, that I wrote <em>can only be active</em>, that implies, that there is an additional condition to the <em>activity</em> of the MultiTrigger and that is the fulfillment of the triggering condition (the MultiTrigger itself doesn't have one, but all derived classes should). Also bear in mind, that the <em>activity</em> of a MultiTrigger is still coupled to the object that triggered it. The default is <em>and</em>.
    78         - @b broadcast Broadcast is a boolean, if true the MutliTrigger is in <em>broadcast-mode</em>, meaning, that all trigger events that are caused by no originator (originator is NULL) are broadcast as having come from every possible originator, or more precisely as having come from all objects that are specified targets of this MultiTrigger. The default is false.
     78        - @b broadcast Broadcast is a boolean, if true the MutliTrigger is in <em>broadcast-mode</em>, meaning, that all trigger events that are caused by no originator (originator is nullptr) are broadcast as having come from every possible originator, or more precisely as having come from all objects that are specified targets of this MultiTrigger. The default is false.
    7979        - @b target The target describes the kind of objects that are allowed to trigger this MultiTrigger. The default is @ref orxonox::Pawn "Pawn".
    8080        - Also there is the possibility of appending triggers (as long as they inherit from TriggerBase) to the MultiTrigger just by adding them as children in the XML description of your MultiTrigger.
     
    110110            */
    111111            inline bool isActive(void) const
    112                 { return this->isActive(NULL); }
    113             bool isActive(BaseObject* triggerer = NULL) const; //!< Check whether the MultiTrigger is active for a given object.
     112                { return this->isActive(nullptr); }
     113            bool isActive(BaseObject* triggerer = nullptr) const; //!< Check whether the MultiTrigger is active for a given object.
    114114
    115115            /**
     
    145145            */
    146146            inline bool isTarget(BaseObject* target)
    147                 { if(target == NULL) return true; else return targetMask_.isIncluded(target->getIdentifier()); }
     147                { if(target == nullptr) return true; else return targetMask_.isIncluded(target->getIdentifier()); }
    148148               
    149149            void addTarget(const std::string& targets); //!< Add some target to the MultiTrigger.
     
    152152            virtual std::queue<MultiTriggerState*>* letTrigger(void); //!< This method is called by the MultiTrigger to get information about new trigger events that need to be looked at.
    153153
    154             void changeTriggered(BaseObject* originator = NULL); //!< This method can be called by any class inheriting from MultiTrigger to change it's triggered status for a specified originator.
    155 
    156             bool isModeTriggered(BaseObject* triggerer = NULL); //!< Checks whether the MultiTrigger is triggered concerning it's children.
    157             bool isTriggered(BaseObject* triggerer = NULL); //!< Get whether the MultiTrigger is triggered for a given object.
    158 
    159             virtual void fire(bool status, BaseObject* originator = NULL);  //!< Helper method. Creates an Event for the given status and originator and fires it.
     154            void changeTriggered(BaseObject* originator = nullptr); //!< This method can be called by any class inheriting from MultiTrigger to change it's triggered status for a specified originator.
     155
     156            bool isModeTriggered(BaseObject* triggerer = nullptr); //!< Checks whether the MultiTrigger is triggered concerning it's children.
     157            bool isTriggered(BaseObject* triggerer = nullptr); //!< Get whether the MultiTrigger is triggered for a given object.
     158
     159            virtual void fire(bool status, BaseObject* originator = nullptr);  //!< Helper method. Creates an Event for the given status and originator and fires it.
    160160            void broadcast(bool status); //!< Helper method. Broadcasts an Event for every object that is a target.
    161161
     
    192192            std::set<BaseObject*> triggered_; //!< The set of all objects the MultiTrigger is triggered for.
    193193
    194             std::deque< std::pair<float, MultiTriggerState*> > stateQueue_; //!< The queue of states waiting to become active.
     194            std::deque<std::pair<float, MultiTriggerState*>> stateQueue_; //!< The queue of states waiting to become active.
    195195
    196196            ClassTreeMask targetMask_; //!< The target mask, masking all objects that can trigger this MultiTrigger.
  • code/trunk/src/modules/objects/triggers/MultiTriggerContainer.cc

    r9667 r11071  
    5050        The creator.
    5151    */
    52     MultiTriggerContainer::MultiTriggerContainer(Context* context) : BaseObject(context), originator_(NULL), data_(NULL)
     52    MultiTriggerContainer::MultiTriggerContainer(Context* context) : BaseObject(context), originator_(nullptr), data_(nullptr)
    5353    {
    5454        RegisterObject(MultiTriggerContainer);
     
    7070
    7171        Pawn* pawn = orxonox_cast<Pawn*>(data);
    72         if(pawn != NULL)
     72        if(pawn != nullptr)
    7373        {
    7474            this->setForPlayer(true);
  • code/trunk/src/modules/objects/triggers/Trigger.cc

    r10624 r11071  
    3737#include "core/CoreIncludes.h"
    3838#include "core/GameMode.h"
    39 #include "core/XMLPort.h"
    4039#include "core/command/ConsoleCommandIncludes.h"
    4140
     
    8685    {
    8786
    88     }
    89 
    90     /**
    91     @brief
    92         Method for creating a Trigger object through XML.
    93     */
    94     void Trigger::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    95     {
    96         SUPER(Trigger, XMLPort, xmlelement, mode);
    9787    }
    9888
     
    203193        Returns true if the Trigger should be triggered and false if not.
    204194    */
    205     bool Trigger::isTriggered(TriggerMode::Value mode)
     195    bool Trigger::isTriggered(TriggerMode mode)
    206196    {
    207197        // If the trigger has sub-triggers.
     
    234224    {
    235225        // Iterate over all sub-triggers.
    236         for (std::set<TriggerBase*>::iterator it = this->children_.begin(); it != this->children_.end(); ++it)
    237         {
    238             if (!(*it)->isActive())
     226        for (TriggerBase* child : this->children_)
     227        {
     228            if (!child->isActive())
    239229                return false;
    240230        }
     
    252242    {
    253243        // Iterate over all sub-triggers.
    254         for (std::set<TriggerBase*>::iterator it = this->children_.begin(); it != this->children_.end(); ++it)
    255         {
    256             if ((*it)->isActive())
     244        for (TriggerBase* child : this->children_)
     245        {
     246            if (child->isActive())
    257247                return true;
    258248        }
     
    270260    {
    271261        bool test = false;
    272         for (std::set<TriggerBase*>::iterator it = this->children_.begin(); it != this->children_.end(); ++it)
    273         {
    274             if (test && (*it)->isActive())
     262        for (TriggerBase* child : this->children_)
     263        {
     264            if (test && child->isActive())
    275265                return false;
    276             if ((*it)->isActive())
     266            if (child->isActive())
    277267                test = true;
    278268        }
     
    346336    {
    347337        // Iterate over all Triggers.
    348         for (ObjectList<Trigger>::iterator it = ObjectList<Trigger>::begin(); it != ObjectList<Trigger>::end(); ++it)
    349             it->setVisible(bVisible);
     338        for (Trigger* trigger : ObjectList<Trigger>())
     339            trigger->setVisible(bVisible);
    350340    }
    351341
  • code/trunk/src/modules/objects/triggers/Trigger.h

    r9667 r11071  
    8383            virtual ~Trigger();
    8484
    85             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); // Method for creating a Trigger object through XML.
    8685            virtual void tick(float dt);
    8786
     
    105104            inline bool isTriggered()
    106105                { return this->isTriggered(this->mode_); }
    107             virtual bool isTriggered(TriggerMode::Value mode); // Check whether the Trigger should be triggered, given only its sub-triggers, given a specific mode.
     106            virtual bool isTriggered(TriggerMode mode); // Check whether the Trigger should be triggered, given only its sub-triggers, given a specific mode.
    108107            virtual void triggered(bool bIsTriggered); // Fires an event with the input triggered state.
    109108
     
    127126            BillboardSet debugBillboard_; //!< A set of debug billboards to visualize the state of the trigger.
    128127
    129             std::queue<std::pair<float, char> > stateChanges_; //!< A queue of state changes (in the same format as latestState_) paired with the time they will take effect since the last state change took effect.
     128            std::queue<std::pair<float, char>> stateChanges_; //!< A queue of state changes (in the same format as latestState_) paired with the time they will take effect since the last state change took effect.
    130129    };
    131130
  • code/trunk/src/modules/objects/triggers/TriggerBase.cc

    r9667 r11071  
    6767        this->mode_ = TriggerMode::EventTriggerAND;
    6868
    69         this->parent_ = NULL;
     69        this->parent_ = nullptr;
    7070
    7171        this->bMultiTrigger_ = false;
     
    100100
    101101        XMLPortObject(TriggerBase, TriggerBase, "", addTrigger, getTrigger, xmlelement, mode);
    102     }
    103 
    104     /**
    105     @brief
    106         A method that is executed each tick.
    107     @param dt
    108         The duration of the last tick.
    109     */
    110     void TriggerBase::tick(float dt)
    111     {
    112         SUPER(TriggerBase, tick, dt);
    113102    }
    114103
     
    170159        The index.
    171160    @return
    172         Returns a pointer ot the trigger. NULL if no such trigger exists.
     161        Returns a pointer ot the trigger. nullptr if no such trigger exists.
    173162    */
    174163    const TriggerBase* TriggerBase::getTrigger(unsigned int index) const
     
    176165        // If the index is greater than the number of children.
    177166        if (this->children_.size() <= index)
    178             return NULL;
     167            return nullptr;
    179168
    180169        std::set<TriggerBase*>::const_iterator it;
  • code/trunk/src/modules/objects/triggers/TriggerBase.h

    r9667 r11071  
    5252    @ingroup Triggers
    5353    */
    54     namespace TriggerMode
     54    enum class TriggerMode
    5555    {
    56         enum Value
    57         {
    58             EventTriggerAND, //!< The <em>and</em> mode. The trigger can only trigger if all the children are active.
    59             EventTriggerOR, //!< The <em>or</em> mode. The trigger can only trigger if at least one child is active.
    60             EventTriggerXOR, //!< The <em>xor</em> mode. The trigger can only trigger if exactly one child is active.
    61         };
    62     }
     56        EventTriggerAND, //!< The <em>and</em> mode. The trigger can only trigger if all the children are active.
     57        EventTriggerOR, //!< The <em>or</em> mode. The trigger can only trigger if at least one child is active.
     58        EventTriggerXOR, //!< The <em>xor</em> mode. The trigger can only trigger if exactly one child is active.
     59    };
    6360
    6461    /**
     
    7875
    7976            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< Method for creating a TriggerBase object through XML.
    80             virtual void tick(float dt); //!< A method that is executed each tick.
    8177
    8278            /**
     
    158154            @param mode The mode of the trigger.
    159155            */
    160             inline void setMode(TriggerMode::Value mode) //!< Get the mode of the trigger.
     156            inline void setMode(TriggerMode mode) //!< Get the mode of the trigger.
    161157                { this->mode_ = mode; }
    162158            const std::string& getModeString(void) const;
     
    165161            @return Returns and Enum for the mode of the trigger.
    166162            */
    167             inline TriggerMode::Value getMode(void) const
     163            inline TriggerMode getMode(void) const
    168164                { return mode_; }
    169165
     
    211207
    212208            bool bInvertMode_; //!< Bool for the invert-mode, if true the trigger is inverted.
    213             TriggerMode::Value mode_; //!< The mode of the trigger.
     209            TriggerMode mode_; //!< The mode of the trigger.
    214210
    215211            TriggerBase* parent_; //!< The parent of this trigger.
  • code/trunk/src/modules/overlays/FadeoutText.h

    r9667 r11071  
    4444            virtual ~FadeoutText() {}
    4545
    46             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    47             virtual void tick(float dt);
     46            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     47            virtual void tick(float dt) override;
    4848
    4949            inline void setDelay(float delay)
     
    5858
    5959        private:
    60             virtual void changedColour();
    61             virtual void changedCaption();
     60            virtual void changedColour() override;
     61            virtual void changedCaption() override;
    6262
    6363            void fadeout();
  • code/trunk/src/modules/overlays/GUIOverlay.cc

    r9667 r11071  
    9292            ControllableEntity* entity = orxonox_cast<ControllableEntity*>(this->getOwner());
    9393            if (entity)
    94                 GUIManager::getInstance().setPlayer(name, entity->getPlayer()); //Set Player is going to be NULL, so it needs to be set in changedVisibility() as well.
     94                GUIManager::getInstance().setPlayer(name, entity->getPlayer()); //Set Player is going to be nullptr, so it needs to be set in changedVisibility() as well.
    9595        }
    9696    }
  • code/trunk/src/modules/overlays/GUIOverlay.h

    r9667 r11071  
    4444            virtual ~GUIOverlay();
    4545
    46             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     46            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    4747
    4848            void setGUIName(const std::string& name);
    4949            inline const std::string& getGUIName() const { return this->guiName_; }
    5050
    51             virtual void changedVisibility();
    52             virtual void changedOwner();
     51            virtual void changedVisibility() override;
     52            virtual void changedOwner() override;
    5353
    5454        private:
  • code/trunk/src/modules/overlays/OverlayText.cc

    r9667 r11071  
    3232#include <OgrePanelOverlayElement.h>
    3333#include <OgreTextAreaOverlayElement.h>
    34 #include <boost/static_assert.hpp>
    3534
    3635#include "util/StringUtils.h"
     
    4342    RegisterClass(OverlayText);
    4443
    45     BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Left   == (int)OverlayText::Left);
    46     BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Center == (int)OverlayText::Center);
    47     BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Right  == (int)OverlayText::Right);
     44    static_assert((int)Ogre::TextAreaOverlayElement::Left   == (int)OverlayText::Alignment::Left,   "check enum");
     45    static_assert((int)Ogre::TextAreaOverlayElement::Center == (int)OverlayText::Alignment::Center, "check enum");
     46    static_assert((int)Ogre::TextAreaOverlayElement::Right  == (int)OverlayText::Alignment::Right,  "check enum");
    4847
    4948    OverlayText::OverlayText(Context* context)
     
    8685    {
    8786        if (alignment == "right")
    88             this->setAlignment(OverlayText::Right);
     87            this->setAlignment(OverlayText::Alignment::Right);
    8988        else if (alignment == "center")
    90             this->setAlignment(OverlayText::Center);
     89            this->setAlignment(OverlayText::Alignment::Center);
    9190        else // "left" and default
    92             this->setAlignment(OverlayText::Left);
     91            this->setAlignment(OverlayText::Alignment::Left);
    9392    }
    9493
     
    112111    void OverlayText::sizeChanged()
    113112    {
    114         if (this->rotState_ == Horizontal)
     113        if (this->rotState_ == RotationState::Horizontal)
    115114            this->overlay_->setScale(size_.y * sizeCorrection_.y, size_.y * sizeCorrection_.y);
    116         else if (this->rotState_ == Vertical)
     115        else if (this->rotState_ == RotationState::Vertical)
    117116            this->overlay_->setScale(size_.y / (sizeCorrection_.y * sizeCorrection_.y), size_.y * sizeCorrection_.y);
    118117        else
  • code/trunk/src/modules/overlays/OverlayText.h

    r9667 r11071  
    4242    {
    4343    public:
    44         enum Alignment
     44        enum class Alignment
    4545        {
    4646            Left,
     
    5252        virtual ~OverlayText();
    5353
    54         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     54        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    5555
    5656        void setCaption(const std::string& caption);
     
    7676
    7777    protected:
    78         virtual void sizeChanged();
     78        virtual void sizeChanged() override;
    7979        virtual void changedColour() {}
    8080        virtual void changedCaption() {}
  • code/trunk/src/modules/overlays/debugging/DebugFPSText.h

    r9667 r11071  
    4343        virtual ~DebugFPSText();
    4444
    45         virtual void tick(float dt);
     45        virtual void tick(float dt) override;
    4646    };
    4747}
  • code/trunk/src/modules/overlays/debugging/DebugPositionText.cc

    r9943 r11071  
    5252        SUPER(DebugPositionText, tick, dt);
    5353       
    54         ObjectList<NewHumanController>::iterator it = ObjectList<NewHumanController>::begin();
     54        ObjectList<NewHumanController>::iterator it = ObjectList<NewHumanController>().begin();
    5555        if (it && it->getControllableEntity() )
    5656        {
  • code/trunk/src/modules/overlays/debugging/DebugPositionText.h

    r9943 r11071  
    4343        virtual ~DebugPositionText();
    4444
    45         virtual void tick(float dt);
     45        virtual void tick(float dt) override;
    4646    };
    4747}
  • code/trunk/src/modules/overlays/debugging/DebugRTRText.h

    r9667 r11071  
    4343        virtual ~DebugRTRText();
    4444
    45         virtual void tick(float dt);
     45        virtual void tick(float dt) override;
    4646    };
    4747}
  • code/trunk/src/modules/overlays/hud/AnnounceMessage.cc

    r9667 r11071  
    4040        RegisterObject(AnnounceMessage);
    4141
    42         this->owner_ = 0;
     42        this->owner_ = nullptr;
    4343
    4444        this->setDelay(3.0f);
  • code/trunk/src/modules/overlays/hud/AnnounceMessage.h

    r9667 r11071  
    4343            virtual ~AnnounceMessage() {}
    4444
    45             virtual void changedOwner();
     45            virtual void changedOwner() override;
    4646
    47             void announcemessage(const GametypeInfo* gtinfo, const std::string& message);
     47            virtual void announcemessage(const GametypeInfo* gtinfo, const std::string& message) override;
    4848
    4949        private:
  • code/trunk/src/modules/overlays/hud/ChatOverlay.cc

    r9667 r11071  
    5858    ChatOverlay::~ChatOverlay()
    5959    {
    60         for (std::set<Timer*>::iterator it = this->timers_.begin(); it != this->timers_.end(); ++it)
    61             delete (*it);
     60        for (Timer* timer : this->timers_)
     61            delete timer;
    6262    }
    6363
     
    9292        this->text_->setCaption("");
    9393
    94         for (std::list<Ogre::DisplayString>::iterator it = this->messages_.begin(); it != this->messages_.end(); ++it)
     94        for (const Ogre::DisplayString& message : this->messages_)
    9595        {
    96             this->text_->setCaption(this->text_->getCaption() + "\n" + (*it));
     96            this->text_->setCaption(this->text_->getCaption() + "\n" + message);
    9797        }
    9898    }
  • code/trunk/src/modules/overlays/hud/ChatOverlay.h

    r9667 r11071  
    4949
    5050        protected:
    51             virtual void incomingChat(const std::string& message, const std::string& name);
     51            virtual void incomingChat(const std::string& message, const std::string& name) override;
    5252
    5353            std::list<Ogre::DisplayString> messages_;
  • code/trunk/src/modules/overlays/hud/CountDown.cc

    r9943 r11071  
    7171        RegisterObject(CountDown);
    7272
    73         this->owner_ = 0;
     73        this->owner_ = nullptr;
    7474        this->hasStopped_ = false;
    7575    }
  • code/trunk/src/modules/overlays/hud/CountDown.h

    r9943 r11071  
    4444            virtual ~CountDown();
    4545
    46             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    47             virtual void changedOwner();
    48             virtual void tick(float dt);
     46            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     47            virtual void changedOwner() override;
     48            virtual void tick(float dt) override;
    4949
    5050            inline void setCounter(float value)
  • code/trunk/src/modules/overlays/hud/DeathMessage.cc

    r9667 r11071  
    4040        RegisterObject(DeathMessage);
    4141
    42         this->owner_ = 0;
     42        this->owner_ = nullptr;
    4343
    4444        this->setDelay(2.0f);
  • code/trunk/src/modules/overlays/hud/DeathMessage.h

    r9667 r11071  
    4343            virtual ~DeathMessage() {}
    4444
    45             virtual void changedOwner();
     45            virtual void changedOwner() override;
    4646
    47             void deathmessage(const GametypeInfo* gtinfo, const std::string& message);
     47            virtual void deathmessage(const GametypeInfo* gtinfo, const std::string& message) override;
    4848
    4949        private:
  • code/trunk/src/modules/overlays/hud/GametypeFadingMessage.cc

    r9667 r11071  
    4040        RegisterObject(GametypeFadingMessage);
    4141
    42         this->owner_ = 0;
     42        this->owner_ = nullptr;
    4343        this->setDelay(2.0f);
    4444        this->setFadeouttime(0.5f);
  • code/trunk/src/modules/overlays/hud/GametypeFadingMessage.h

    r9667 r11071  
    4343            virtual ~GametypeFadingMessage();
    4444
    45             virtual void changedOwner();
     45            virtual void changedOwner() override;
    4646
    47             void fadingmessage(const GametypeInfo* gtinfo, const std::string& message);
     47            virtual void fadingmessage(const GametypeInfo* gtinfo, const std::string& message) override;
    4848
    4949        private:
  • code/trunk/src/modules/overlays/hud/GametypeStaticMessage.cc

    r9667 r11071  
    4242    {
    4343        RegisterObject(GametypeStaticMessage);
    44         this->owner_ = 0;
     44        this->owner_ = nullptr;
    4545    }
    4646
  • code/trunk/src/modules/overlays/hud/GametypeStaticMessage.h

    r9667 r11071  
    4646            virtual ~GametypeStaticMessage();
    4747
    48             virtual void changedOwner();
     48            virtual void changedOwner() override;
    4949
    50             void staticmessage(const GametypeInfo* gtinfo, const std::string& message, const ColourValue& colour);
     50            virtual void staticmessage(const GametypeInfo* gtinfo, const std::string& message, const ColourValue& colour) override;
    5151
    5252        private:
  • code/trunk/src/modules/overlays/hud/HUDBar.cc

    r11052 r11071  
    219219            return barColours_[index];
    220220        else
    221             return 0;
     221            return nullptr;
    222222    }
    223223
  • code/trunk/src/modules/overlays/hud/HUDBar.h

    r11052 r11071  
    5252        virtual ~BarColour() { }
    5353
    54         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);     
     54        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    5555
    5656        void setColour(const ColourValue& colour) { this->colour_ = colour; }
     
    7272        virtual ~HUDBar();
    7373
    74         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     74        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    7575
    7676        void clearColours();
  • code/trunk/src/modules/overlays/hud/HUDBoostBar.cc

    r11052 r11071  
    4242        RegisterObject(HUDBoostBar);
    4343
    44         this->owner_ = 0;
     44        this->owner_ = nullptr;
    4545        this->flashInterval_ = 0.25f;
    4646        this->flashDt_ = 0.0f;
  • code/trunk/src/modules/overlays/hud/HUDBoostBar.h

    r9667 r11071  
    4343        virtual ~HUDBoostBar();
    4444
    45         virtual void tick(float dt);
    46         virtual void changedOwner();
     45        virtual void tick(float dt) override;
     46        virtual void changedOwner() override;
    4747
    4848    private:
  • code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.cc

    r9667 r11071  
    3030
    3131#include "core/config/ConfigValueIncludes.h"
     32#include "core/CoreIncludes.h"
    3233#include "worldentities/pawns/Pawn.h"
    3334
     
    4142
    4243        this->setConfigValues();
    43         this->owner_ = 0;
     44        this->owner_ = nullptr;
    4445    }
    4546
     
    6263    void HUDEnemyHealthBar::updateTarget()
    6364    {
    64         Pawn* pawn = NULL;
     65        Pawn* pawn = nullptr;
    6566        if (this->owner_ && this->useEnemyBar_)
    6667        {
     
    7374            // Don't show the HealthBar if the pawn is invisible
    7475            if (pawn && !pawn->isVisible())
    75                 pawn = NULL;
     76                pawn = nullptr;
    7677        }
    7778        // Set the pawn as owner of the HealthBar
    7879        this->setHealthBarOwner(pawn);
    79         this->setVisible(pawn != NULL);
     80        this->setVisible(pawn != nullptr);
    8081    }
    8182
  • code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.h

    r9667 r11071  
    4141
    4242            void setConfigValues();
    43             virtual void tick(float dt);
     43            virtual void tick(float dt) override;
    4444
    45             void changedOwner();
     45            virtual void changedOwner() override;
    4646
    4747        private:
  • code/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.cc

    r11052 r11071  
    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/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.h

    r11052 r11071  
    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/trunk/src/modules/overlays/hud/HUDHealthBar.cc

    r11052 r11071  
    4343        RegisterObject(HUDHealthBar);
    4444
    45         this->owner_ = 0;
     45        this->owner_ = nullptr;
    4646        this->bUseBarColour_ = false;
    4747        this->textOffset_ = Vector2(0.0f, 0.0f);
     
    6666        {
    6767            this->textoverlay_->destroy();
    68             this->textoverlay_ = NULL;
     68            this->textoverlay_ = nullptr;
    6969        }
    7070    }
  • code/trunk/src/modules/overlays/hud/HUDHealthBar.h

    r11052 r11071  
    4545            virtual ~HUDHealthBar();
    4646
    47             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    48             virtual void tick(float dt);
    49             virtual void changedOwner();
    50             virtual void changedOverlayGroup();
    51             virtual void changedVisibility();
    52             virtual void changedName();
     47            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     48            virtual void tick(float dt) override;
     49            virtual void changedOwner() override;
     50            virtual void changedOverlayGroup() override;
     51            virtual void changedVisibility() override;
     52            virtual void changedName() override;
    5353
    5454            inline void setTextFont(const std::string& font)
     
    112112                { this->owner_ = owner; }
    113113        protected:
    114             virtual void positionChanged();
    115             virtual void sizeChanged();
     114            virtual void positionChanged() override;
     115            virtual void sizeChanged() override;
    116116        private:
    117             virtual void positionText();
     117            void positionText();
    118118            WeakPtr<Pawn> owner_;
    119119            StrongPtr<OverlayText> textoverlay_;
  • code/trunk/src/modules/overlays/hud/HUDNavigation.cc

    r11023 r11071  
    5353#include "core/config/ConfigValueIncludes.h"
    5454#include "tools/TextureGenerator.h"
    55 // #include <boost/bind/bind_template.hpp>
    5655
    5756
     
    6968    RegisterClass ( HUDNavigation );
    7069
    71     HUDNavigation* HUDNavigation::localHUD_s = 0;
     70    HUDNavigation* HUDNavigation::localHUD_s = nullptr;
    7271
    7372    HUDNavigation::HUDNavigation(Context* context) :
     
    132131        }
    133132        this->fontName_ = font;
    134         for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it)
    135         {
    136             if (it->second.text_ != NULL)
    137                 it->second.text_->setFontName(this->fontName_);
     133        for (const auto& mapEntry : this->activeObjectList_)
     134        {
     135            if (mapEntry.second.text_ != nullptr)
     136                mapEntry.second.text_->setFontName(this->fontName_);
    138137        }
    139138    }
     
    152151        }
    153152        this->textSize_ = size;
    154         for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it!=this->activeObjectList_.end(); ++it)
    155         {
    156             if (it->second.text_)
    157                 it->second.text_->setCharHeight(size);
     153        for (const auto& mapEntry : this->activeObjectList_)
     154        {
     155            if (mapEntry.second.text_)
     156                mapEntry.second.text_->setCharHeight(size);
    158157        }
    159158    }
     
    183182
    184183        Camera* cam = CameraManager::getInstance().getActiveCamera();
    185         if (cam == NULL)
     184        if (cam == nullptr)
    186185        return;
    187186        const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
    188187
    189         for (std::list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++listIt)
    190         listIt->second = (int)((listIt->first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f);
     188        for (std::pair<RadarViewable*, unsigned int>& pair : this->sortedObjectList_)
     189        pair.second = (int)((pair.first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f);
    191190
    192191        this->sortedObjectList_.sort(compareDistance);
     
    209208        bool nextHasToBeSelected = false;
    210209
    211         for (std::list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++markerCount, ++listIt)
     210        for (std::list<std::pair<RadarViewable*, unsigned int>>::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++markerCount, ++listIt)
    212211        {
    213212
     
    469468                    if(!it->second.selected_
    470469                            || it->first->getRVVelocity().squaredLength() == 0
    471                             || pawn == NULL
     470                            || pawn == nullptr
    472471                            /* TODO : improve getTeam in such a way that it works
    473                              * || humanPawn == NULL
     472                             * || humanPawn == nullptr
    474473                             * || pawn->getTeam() == humanPawn->getTeam()*/)
    475474                    {
     
    525524        float yScale = this->getActualSize().y;
    526525
    527         for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it)
    528         {
    529             if (it->second.health_ != NULL)
    530                 it->second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
    531             if (it->second.healthLevel_ != NULL)
    532                 it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);
    533             if (it->second.panel_ != NULL)
    534                 it->second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
    535             if (it->second.text_ != NULL)
    536                 it->second.text_->setCharHeight(this->textSize_ * yScale);
    537             if (it->second.target_ != NULL)
    538                 it->second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale);
     526        for (const auto& mapEntry : this->activeObjectList_)
     527        {
     528            if (mapEntry.second.health_ != nullptr)
     529                mapEntry.second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
     530            if (mapEntry.second.healthLevel_ != nullptr)
     531                mapEntry.second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);
     532            if (mapEntry.second.panel_ != nullptr)
     533                mapEntry.second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
     534            if (mapEntry.second.text_ != nullptr)
     535                mapEntry.second.text_->setCharHeight(this->textSize_ * yScale);
     536            if (mapEntry.second.target_ != nullptr)
     537                mapEntry.second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale);
    539538        }
    540539    }
     
    546545
    547546        if (this->activeObjectList_.size() >= this->markerLimit_)
    548         if (object == NULL)
     547        if (object == nullptr)
    549548        return;
    550549
     
    634633        }
    635634
    636         for (std::list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++listIt)
     635        for (std::list<std::pair<RadarViewable*, unsigned int>>::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++listIt)
    637636        {
    638637            if ((listIt->first) == viewable)
     
    664663    {
    665664        const std::set<RadarViewable*>& respawnObjects = this->getOwner()->getScene()->getRadar()->getRadarObjects();
    666         for (std::set<RadarViewable*>::const_iterator it = respawnObjects.begin(); it != respawnObjects.end(); ++it)
    667         {
    668             if (!(*it)->isHumanShip_)
    669             this->addObject(*it);
     665        for (RadarViewable* respawnObject : respawnObjects)
     666        {
     667            if (!respawnObject->isHumanShip_)
     668            this->addObject(respawnObject);
    670669        }
    671670    }
  • code/trunk/src/modules/overlays/hud/HUDNavigation.h

    r10291 r11071  
    5151            void setConfigValues();
    5252
    53             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    54             virtual void tick(float dt);
     53            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     54            virtual void tick(float dt) override;
    5555
    5656            // RadarListener interface
    57             virtual void addObject(RadarViewable* object);
    58             virtual void removeObject(RadarViewable* viewable);
    59             virtual void objectChanged(RadarViewable* viewable);
     57            virtual void addObject(RadarViewable* object) override;
     58            virtual void removeObject(RadarViewable* viewable) override;
     59            virtual void objectChanged(RadarViewable* viewable) override;
    6060
    61             virtual void changedOwner();
    62             virtual void sizeChanged();
    63             virtual void angleChanged() { }
    64             virtual void positionChanged() { }
    65             virtual void radarTick(float dt) {}
     61            virtual void changedOwner() override;
     62            virtual void sizeChanged() override;
     63            virtual void angleChanged() override { }
     64            virtual void positionChanged() override { }
     65            virtual void radarTick(float dt) override {}
    6666
    67             inline float getRadarSensitivity() const
     67            virtual inline float getRadarSensitivity() const override
    6868                { return 1.0f; }
    6969
     
    141141
    142142            std::map<RadarViewable*, ObjectInfo> activeObjectList_;
    143             std::list<std::pair<RadarViewable*, unsigned int> > sortedObjectList_;
     143            std::list<std::pair<RadarViewable*, unsigned int>> sortedObjectList_;
    144144
    145145            float healthMarkerSize_;
  • code/trunk/src/modules/overlays/hud/HUDRadar.cc

    r11052 r11071  
    6565        this->setMaximumDotSize3D(0.07f);
    6666
    67         this->shapeMaterials_[RadarViewable::Dot]      = "RadarDot.png";
    68         this->shapeMaterials_[RadarViewable::Triangle] = "RadarTriangle.png";
    69         this->shapeMaterials_[RadarViewable::Square]   = "RadarSquare.png";
    70         this->owner_ = 0;
     67        this->shapeMaterials_[RadarViewable::Shape::Dot]      = "RadarDot.png";
     68        this->shapeMaterials_[RadarViewable::Shape::Triangle] = "RadarTriangle.png";
     69        this->shapeMaterials_[RadarViewable::Shape::Square]   = "RadarSquare.png";
     70        this->owner_ = nullptr;
    7171
    7272        this->map3DFront_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
     
    9292            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->map3DBack_);
    9393
    94             for (std::map<RadarViewable*,Ogre::PanelOverlayElement*>::iterator it = this->radarObjects_.begin();
    95                 it != this->radarObjects_.end(); ++it)
    96             {
    97                 Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second);
     94            for (const auto& mapEntry : this->radarObjects_)
     95            {
     96                Ogre::OverlayManager::getSingleton().destroyOverlayElement(mapEntry.second);
    9897            }
    9998        }
     
    166165    {
    167166        const std::set<RadarViewable*>& objectSet = this->getCreator()->getScene()->getRadar()->getRadarObjects();
    168         std::set<RadarViewable*>::const_iterator it;
    169         for( it=objectSet.begin(); it!=objectSet.end(); ++it )
    170             this->addObject(*it);
     167        for( RadarViewable* viewable : objectSet )
     168            this->addObject(viewable);
    171169        this->radarTick(0);
    172170    }
     
    184182
    185183        // update the distances for all objects
    186         std::map<RadarViewable*,Ogre::PanelOverlayElement*>::iterator it;
    187 
    188184
    189185        if(RadarMode_)
     
    202198        }
    203199
    204         for( it = this->radarObjects_.begin(); it != this->radarObjects_.end(); ++it )
     200        for( const auto& mapEntry : this->radarObjects_ )
    205201        {
    206202            // Make sure the object really is a WorldEntity
    207             const WorldEntity* wePointer = it->first->getWorldEntity();
     203            const WorldEntity* wePointer = mapEntry.first->getWorldEntity();
    208204            if( !wePointer )
    209205            {
     
    211207                assert(0);
    212208            }
    213             bool isFocus = (it->first == focusObject);
     209            bool isFocus = (mapEntry.first == focusObject);
    214210            // set size to fit distance...
    215211            float distance = (wePointer->getWorldPosition() - this->owner_->getPosition()).length();
     
    218214            float size;
    219215            if(RadarMode_)
    220                 size = maximumDotSize3D_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale();
     216                size = maximumDotSize3D_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * mapEntry.first->getRadarObjectScale();
    221217            else
    222                 size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale();
    223             it->second->setDimensions(size, size);
     218                size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * mapEntry.first->getRadarObjectScale();
     219            mapEntry.second->setDimensions(size, size);
    224220
    225221            // calc position on radar...
     
    235231                int zOrder = determineMap3DZOrder(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition(), detectionLimit_);
    236232                if(overXZPlain == false /*&& (it->second->getZOrder() >  100 * this->overlay_->getZOrder())*/) // it appears that zOrder of attached Overlayelements is 100 times the zOrder of the Overlay
    237                     it->second->_notifyZOrder(this->overlay_->getZOrder() * 100 - 70 + zOrder);
     233                    mapEntry.second->_notifyZOrder(this->overlay_->getZOrder() * 100 - 70 + zOrder);
    238234                if(overXZPlain == true /*&& (it->second->getZOrder() <= 100 * this->overlay_->getZOrder())*/)
    239                     it->second->_notifyZOrder(this->overlay_->getZOrder() * 100 + 70 + zOrder);
     235                    mapEntry.second->_notifyZOrder(this->overlay_->getZOrder() * 100 + 70 + zOrder);
    240236            }
    241237            else
     
    243239
    244240            coord *= math::pi / 3.5f; // small adjustment to make it fit the texture
    245             it->second->setPosition((1.0f + coord.x - size) * 0.5f, (1.0f - coord.y - size) * 0.5f);
     241            mapEntry.second->setPosition((1.0f + coord.x - size) * 0.5f, (1.0f - coord.y - size) * 0.5f);
    246242
    247243            if( distance < detectionLimit_ || detectionLimit_ < 0 )
    248                 it->second->show();
     244                mapEntry.second->show();
    249245            else
    250                 it->second->hide();
     246                mapEntry.second->hide();
    251247
    252248            // if this object is in focus, then set the focus marker
     
    256252                this->marker_->setPosition((1.0f + coord.x - size * 1.5f) * 0.5f, (1.0f - coord.y - size * 1.5f) * 0.5f);
    257253                if(RadarMode_)
    258                     this->marker_->_notifyZOrder(it->second->getZOrder() -1);
     254                    this->marker_->_notifyZOrder(mapEntry.second->getZOrder() -1);
    259255                this->marker_->show();
    260256            }
  • code/trunk/src/modules/overlays/hud/HUDRadar.h

    r9945 r11071  
    5050        virtual ~HUDRadar();
    5151
    52         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    53         virtual void changedOwner();
     52        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     53        virtual void changedOwner() override;
    5454        void setConfigValues();
    5555
     
    8080        void set3DMaterialBack(std::string material3DBack) { this->material3DBack_ = material3DBack; }
    8181
    82         float getRadarSensitivity() const { return this->sensitivity_; }
     82        virtual float getRadarSensitivity() const override { return this->sensitivity_; }
    8383        // used also by RadarListener interface!
    8484        void setRadarSensitivity(float sensitivity) { this->sensitivity_ = sensitivity; }
     
    8989
    9090        // RadarListener interface
    91         virtual void addObject(RadarViewable* viewable);
    92         virtual void removeObject(RadarViewable* viewable);
    93         virtual void objectChanged( RadarViewable* rv );
    94         void radarTick(float dt);
     91        virtual void addObject(RadarViewable* viewable) override;
     92        virtual void removeObject(RadarViewable* viewable) override;
     93        virtual void objectChanged( RadarViewable* rv ) override;
     94        virtual void radarTick(float dt) override;
    9595        bool showObject( RadarViewable* rv ); //!< Do not display an object on radar, if showObject(.) is false.
    9696
  • code/trunk/src/modules/overlays/hud/HUDRocketFuelBar.cc

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

    r11052 r11071  
    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/trunk/src/modules/overlays/hud/HUDShieldBar.cc

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

    r11052 r11071  
    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/trunk/src/modules/overlays/hud/HUDSpeedBar.cc

    r9667 r11071  
    4343        RegisterObject(HUDSpeedBar);
    4444
    45         this->owner_ = 0;
     45        this->owner_ = nullptr;
    4646    }
    4747
  • code/trunk/src/modules/overlays/hud/HUDSpeedBar.h

    r9667 r11071  
    4444        virtual ~HUDSpeedBar();
    4545
    46         virtual void tick(float dt);
    47         virtual void changedOwner();
     46        virtual void tick(float dt) override;
     47        virtual void changedOwner() override;
    4848
    4949    private:
  • code/trunk/src/modules/overlays/hud/HUDTimer.cc

    r9667 r11071  
    4242        RegisterObject(HUDTimer);
    4343
    44         this->owner_ = 0;
     44        this->owner_ = nullptr;
    4545    }
    4646
  • code/trunk/src/modules/overlays/hud/HUDTimer.h

    r9667 r11071  
    4343        virtual ~HUDTimer();
    4444
    45         virtual void tick(float dt);
     45        virtual void tick(float dt) override;
    4646
    47         virtual void changedOwner();
     47        virtual void changedOwner() override;
    4848
    4949    private:
  • code/trunk/src/modules/overlays/hud/HUDWeapon.cc

    r11052 r11071  
    4444        weaponModeHUDActualSize_ = Vector2(0.0f,0.0f);
    4545
    46         weaponModes_ = NULL;
    4746        weaponIndex_ = 0;
    4847        hudWeaponModes_.clear();
     
    7776        if (!weapon_)
    7877        {
    79             // 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)
    8079        }
    8180    }   
     
    115114        bool visible = this->isVisible();
    116115
    117         for (std::vector<WeakPtr<HUDWeaponMode> >::iterator it = hudWeaponModes_.begin(); it != hudWeaponModes_.end(); ++it)
    118         {
    119             (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed
    120             (*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);
    121120        }
    122121    }
     
    141140    void HUDWeapon::updateWeaponModeList()
    142141    {
    143         if (owner_ == NULL || weapon_ == NULL)
     142        if (owner_ == nullptr || weapon_ == nullptr)
    144143        {
    145144            return;
     
    147146           
    148147        destroyHUDChilds();
    149 
    150         weaponModes_ = weapon_->getAllWeaponmodes();
    151148
    152149        updateSize();
     
    157154    void HUDWeapon::createHUDChilds()
    158155    {
    159         if (weaponModes_ == NULL)
     156        if (weapon_ == nullptr)
    160157        {
    161158            return;
     
    164161        int positionIndex = 0;
    165162
    166         for (std::multimap<unsigned int, WeaponMode*>::iterator it = weaponModes_->begin(); it != weaponModes_->end(); ++it)
     163        for (const auto& mapEntry : weapon_->getAllWeaponmodes())
    167164        {
    168165            HUDWeaponMode* hudWeaponMode = new HUDWeaponMode(this->getContext());
     
    170167            hudWeaponMode->setOverlayGroup(this->getOverlayGroup());
    171168            hudWeaponMode->setVisible(this->isVisible());
    172             hudWeaponMode->setWeaponMode(it->second);
     169            hudWeaponMode->setWeaponMode(mapEntry.second);
    173170            hudWeaponMode->setWeaponIndex(this->weaponIndex_);                   
    174171            hudWeaponMode->setAspectCorrection(false);
     
    185182        int positionIndex = 0;
    186183
    187         for (std::vector<WeakPtr<HUDWeaponMode> >::iterator it = hudWeaponModes_.begin(); it != hudWeaponModes_.end(); ++it)
    188         {
    189             (*it)->setPositionOffset(this->positionOffset_);
    190             (*it)->setWeaponModeIndex(positionIndex);
    191             (*it)->setWeaponIndex(this->weaponIndex_);
    192             (*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_);
    193190
    194191            ++ positionIndex;
     
    198195    void HUDWeapon::destroyHUDChilds()
    199196    {
    200         for (std::vector<WeakPtr<HUDWeaponMode> >::iterator it = hudWeaponModes_.begin(); it != hudWeaponModes_.end(); ++it)
    201         {
    202             (*it)->destroy();
     197        for (HUDWeaponMode* hudWeaponMode : hudWeaponModes_)
     198        {
     199            hudWeaponMode->destroy();
    203200        }
    204201
     
    208205    void HUDWeapon::updateSize()
    209206    {
    210         if (weaponModes_ != NULL)
    211         {
    212             this->setSize(Vector2(weaponModeHUDActualSize_.x,weaponModeHUDActualSize_.y*weaponModes_->size()));
     207        if (weapon_ != nullptr)
     208        {
     209            this->setSize(Vector2(weaponModeHUDActualSize_.x,weaponModeHUDActualSize_.y*weapon_->getAllWeaponmodes().size()));
    213210            updatePosition();
    214211        }       
     
    217214    void HUDWeapon::updatePosition()
    218215    {
    219         if (weaponModes_ != NULL)
     216        if (weapon_ != nullptr)
    220217        {
    221218            this->setPosition(Vector2(weaponModeHUDActualSize_.x*weaponIndex_,0.0f) + this->positionOffset_);
  • code/trunk/src/modules/overlays/hud/HUDWeapon.h

    r11052 r11071  
    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
    66         virtual void setWeapon(Weapon* weapon);
     66        void setWeapon(Weapon* weapon);
    6767
    6868        inline void setWeaponModeHUDActualSize(Vector2 vector)
     
    8484
    8585    private:
    86         virtual void createHUDChilds();
    87         virtual void positionHUDChilds();
    88         virtual void destroyHUDChilds();
    89         virtual void updateWeaponModeList();
    90         virtual void updateSize();
    91         virtual void updatePosition();
     86        void createHUDChilds();
     87        void positionHUDChilds();
     88        void destroyHUDChilds();
     89        void updateWeaponModeList();
     90        void updateSize();
     91        void updatePosition();
    9292
    9393        WeakPtr<Pawn> owner_;
    9494        WeakPtr<Weapon> weapon_;
    9595
    96         std::multimap<unsigned int, WeaponMode*>* weaponModes_;
    97         std::vector<WeakPtr<HUDWeaponMode> > hudWeaponModes_;
     96        std::vector<WeakPtr<HUDWeaponMode>> hudWeaponModes_;
    9897
    9998        Ogre::PanelOverlayElement* overlayElement_;
  • code/trunk/src/modules/overlays/hud/HUDWeaponMode.cc

    r11052 r11071  
    2929#include "HUDWeaponMode.h"
    3030
     31#include "util/Convert.h"
     32#include "util/StringUtils.h"
    3133#include "core/CoreIncludes.h"
    32 #include "core/XMLPort.h"
    33 #include "util/Convert.h"
    3434#include "core/class/Super.h"
    3535
     
    7676        textOverlayLeft_->setPickPoint(Vector2(0.0f,0.0f));
    7777        textOverlayLeft_->setVisible(true);
    78         textOverlayLeft_->setAlignment(OverlayText::Center);
     78        textOverlayLeft_->setAlignment(OverlayText::Alignment::Center);
    7979        textOverlayLeft_->setTextSize(0.02f);
    8080        textOverlayLeft_->setColour(ColourValue(0.21,0.70,0.21,1.0));
     
    8787        textOverlayRight_->setPickPoint(Vector2(0.0f,0.0f));
    8888        textOverlayRight_->setVisible(true);
    89         textOverlayRight_->setAlignment(OverlayText::Center);
     89        textOverlayRight_->setAlignment(OverlayText::Alignment::Center);
    9090        textOverlayRight_->setTextSize(0.02f);
    9191        textOverlayRight_->setColour(ColourValue(0.21,0.70,0.21,1.0));
     
    107107    }
    108108
    109     void HUDWeaponMode::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    110     {
    111         SUPER(HUDWeaponMode, XMLPort, xmlelement, mode);
    112     }
    113 
    114109    void HUDWeaponMode::tick(float dt)
    115110    {
     
    131126            Munition* munition = this->weaponMode_->getMunition();
    132127
    133             if (munition != NULL)
    134             {
    135                 MunitionDeployment::Value deployment = munition->getMunitionDeployment();
     128            if (munition != nullptr)
     129            {
     130                MunitionDeployment deployment = munition->getMunitionDeployment();
    136131
    137132                if (deployment == MunitionDeployment::Share)
     
    242237        Munition* munition = this->weaponMode_->getMunition();
    243238
    244         if (munition != NULL)
    245         {
    246             MunitionDeployment::Value deployment = munition->getMunitionDeployment();
     239        if (munition != nullptr)
     240        {
     241            MunitionDeployment deployment = munition->getMunitionDeployment();
    247242
    248243            if (deployment == MunitionDeployment::Share)
  • code/trunk/src/modules/overlays/hud/HUDWeaponMode.h

    r11052 r11071  
    5757        virtual ~HUDWeaponMode();
    5858
    59         virtual void tick(float dt);
    60         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    61         virtual void changedOwner();
    62         virtual void changedOverlayGroup();
    63         virtual void changedVisibility();
    64         virtual void changedName();
    65         virtual void positionChanged();
    66         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;
    6766
    68         virtual void setWeaponMode(WeaponMode* weaponMode);
     67        void setWeaponMode(WeaponMode* weaponMode);
    6968
    7069        inline void setWeaponModeHUDActualSize(Vector2 vector)
     
    8988
    9089    private:
    91         virtual void updateSize();
    92         virtual void updatePosition();
    93         virtual void positionHUDChilds();
     90        void updateSize();
     91        void updatePosition();
     92        void positionHUDChilds();
    9493
    9594        WeakPtr<Pawn> owner_;
  • code/trunk/src/modules/overlays/hud/HUDWeaponSystem.cc

    r11052 r11071  
    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    }
     
    117117    void HUDWeaponSystem::updateWeaponList()
    118118    {
    119         if (owner_ == NULL)
     119        if (owner_ == nullptr)
    120120        {
    121121            return;
     
    126126        destroyHUDChilds();
    127127
    128         std::vector<WeaponPack*>* weaponPacks = owner_->getAllWeaponPacks();
     128        if (owner_->getWeaponSystem())
     129        {
     130            const std::vector<WeaponPack*>& weaponPacks = owner_->getWeaponSystem()->getAllWeaponPacks();
     131            for (WeaponPack* weaponPack : weaponPacks)
     132            {
     133                const std::vector<Weapon*>& weapons = weaponPack->getAllWeapons();
     134                for (Weapon* weapon : weapons)
     135                {
     136                    this->weapons_.push_back(weapon);
     137                }
     138            }
    129139
    130         for (std::vector<WeaponPack*>::const_iterator itPacks = weaponPacks->begin(); itPacks != weaponPacks->end(); ++itPacks)
    131         {
    132             std::vector<Weapon*>* weapons = (*itPacks)->getAllWeapons();
    133 
    134             for (std::vector<Weapon*>::const_iterator itWeapons = weapons->begin(); itWeapons != weapons->end(); ++itWeapons)
    135             {
    136                 this->weapons_.push_back(*itWeapons);
    137             }
     140            createHUDChilds();
     141            positionHUDChilds();
    138142        }
    139 
    140         createHUDChilds();
    141         positionHUDChilds();
    142143    }
    143144
     
    146147        int positionIndex = 0;
    147148
    148         for (std::vector<WeakPtr<Weapon> >::iterator it = weapons_.begin(); it != weapons_.end(); ++it)
     149        for (Weapon* weapon : weapons_)
    149150        {
    150151            HUDWeapon* hudWeapon = new HUDWeapon(this->getContext());
     
    152153            hudWeapon->setOverlayGroup(this->getOverlayGroup());
    153154            hudWeapon->setVisible(this->isVisible());
    154             hudWeapon->setWeapon(*it);
     155            hudWeapon->setWeapon(weapon);
    155156            hudWeapon->setAspectCorrection(false);
    156157            hudWeapon->setPickPoint(Vector2(0.0f,0.0f));
     
    167168        Vector2 offset = this->getPosition();
    168169
    169         for (std::vector<WeakPtr<HUDWeapon> >::iterator it = hudWeapons_.begin(); it != hudWeapons_.end(); ++it)
     170        for (HUDWeapon* hudWeapon : hudWeapons_)
    170171        {
    171             (*it)->setPositionOffset(offset);
    172             (*it)->setWeaponIndex(positionIndex);
    173             (*it)->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_);
     172            hudWeapon->setPositionOffset(offset);
     173            hudWeapon->setWeaponIndex(positionIndex);
     174            hudWeapon->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_);
    174175
    175176            ++ positionIndex;
     
    179180    void HUDWeaponSystem::destroyHUDChilds()
    180181    {
    181         for (std::vector<WeakPtr<HUDWeapon> >::iterator it = hudWeapons_.begin(); it != hudWeapons_.end(); ++it)
     182        for (HUDWeapon* hudWeapon : hudWeapons_)
    182183        {
    183             (*it)->destroy();
     184            hudWeapon->destroy();
    184185        }
    185186
  • code/trunk/src/modules/overlays/hud/HUDWeaponSystem.h

    r11052 r11071  
    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)
     
    6464            { return weaponModeHUDSize_; }
    6565    private:
    66         virtual void updateWeaponList();
    67         virtual void createHUDChilds();
    68         virtual void positionHUDChilds();
    69         virtual void destroyHUDChilds();
     66        void updateWeaponList();
     67        void createHUDChilds();
     68        void positionHUDChilds();
     69        void destroyHUDChilds();
    7070
    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/trunk/src/modules/overlays/hud/KillMessage.cc

    r9667 r11071  
    4040        RegisterObject(KillMessage);
    4141
    42         this->owner_ = 0;
     42        this->owner_ = nullptr;
    4343
    4444        this->setDelay(2.0f);
  • code/trunk/src/modules/overlays/hud/KillMessage.h

    r9667 r11071  
    4343            virtual ~KillMessage() {}
    4444
    45             virtual void changedOwner();
     45            virtual void changedOwner() override;
    4646
    47             void killmessage(const GametypeInfo* gtinfo, const std::string& message);
     47            virtual void killmessage(const GametypeInfo* gtinfo, const std::string& message) override;
    4848
    4949        private:
  • code/trunk/src/modules/overlays/hud/LastManStandingInfos.cc

    r10624 r11071  
    4343        RegisterObject(LastManStandingInfos);
    4444
    45         this->lms_ = 0;
    46         this->player_ = 0;
     45        this->lms_ = nullptr;
     46        this->player_ = nullptr;
    4747        this->bShowLives_ = false;
    4848        this->bShowPlayers_ = false;
     
    9191        else
    9292        {
    93             this->player_ = 0;
    94             this->lms_ = 0;
     93            this->player_ = nullptr;
     94            this->lms_ = nullptr;
    9595        }
    9696    }
  • code/trunk/src/modules/overlays/hud/LastManStandingInfos.h

    r9667 r11071  
    4343            virtual ~LastManStandingInfos();
    4444
    45             virtual void tick(float dt);
    46             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    47             virtual void changedOwner();
     45            virtual void tick(float dt) override;
     46            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     47            virtual void changedOwner() override;
    4848
    4949            inline void setShowLives(bool value)
  • code/trunk/src/modules/overlays/hud/LastTeamStandingInfos.cc

    r10624 r11071  
    4343        RegisterObject(LastTeamStandingInfos);
    4444
    45         this->lts_ = 0;
    46         this->player_ = 0;
     45        this->lts_ = nullptr;
     46        this->player_ = nullptr;
    4747        this->bShowLives_ = false;
    4848        this->bShowTeams_ = false;
     
    9191        else
    9292        {
    93             this->player_ = 0;
    94             this->lts_ = 0;
     93            this->player_ = nullptr;
     94            this->lts_ = nullptr;
    9595        }
    9696    }
  • code/trunk/src/modules/overlays/hud/LastTeamStandingInfos.h

    r9667 r11071  
    4343            virtual ~LastTeamStandingInfos();
    4444
    45             virtual void tick(float dt);
    46             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    47             virtual void changedOwner();
     45            virtual void tick(float dt) override;
     46            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     47            virtual void changedOwner() override;
    4848
    4949            inline void setShowLives(bool value)
  • code/trunk/src/modules/overlays/hud/PauseNotice.cc

    r9667 r11071  
    4040        RegisterObject(PauseNotice);
    4141
    42         this->owner_ = 0;
     42        this->owner_ = nullptr;
    4343    }
    4444
  • code/trunk/src/modules/overlays/hud/PauseNotice.h

    r9667 r11071  
    4242            PauseNotice(Context* context);
    4343
    44             virtual void changedOwner();
     44            virtual void changedOwner() override;
    4545
    4646        protected:
    47             virtual void changedTimeFactor(float factor_new, float factor_old);
     47            virtual void changedTimeFactor(float factor_new, float factor_old) override;
    4848
    4949        private:
  • code/trunk/src/modules/overlays/hud/TeamBaseMatchScore.cc

    r10624 r11071  
    4343        RegisterObject(TeamBaseMatchScore);
    4444
    45         this->owner_ = 0;
     45        this->owner_ = nullptr;
    4646
    4747        this->bShowBases_ = false;
     
    120120            this->owner_ = orxonox_cast<TeamBaseMatch*>(this->getOwner()->getGametype());
    121121        else
    122             this->owner_ = 0;
     122            this->owner_ = nullptr;
    123123    }
    124124}
  • code/trunk/src/modules/overlays/hud/TeamBaseMatchScore.h

    r9667 r11071  
    4343            virtual ~TeamBaseMatchScore();
    4444
    45             virtual void tick(float dt);
    46             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    47             virtual void changedOwner();
     45            virtual void tick(float dt) override;
     46            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     47            virtual void changedOwner() override;
    4848
    4949            inline void setShowBases(bool value)
  • code/trunk/src/modules/overlays/stats/CreateLines.cc

    r6502 r11071  
    3737    CreateLines::CreateLines(float leftOffset, float topOffset, float width, float height)
    3838    {
    39         playerNameText_ = new OverlayText(0);
     39        playerNameText_ = new OverlayText(nullptr);
    4040        playerNameText_->setTextSize(0.04f);
    4141        playerNameText_->setColour(ColourValue(0.0f, 0.75f, 0.2f, 1.0f));
    4242        playerNameText_->setPosition(Vector2(0.1f, topOffset + 0.01f));
    4343
    44         scoreText_ = new OverlayText(0);
     44        scoreText_ = new OverlayText(nullptr);
    4545        scoreText_->setTextSize(0.04f);
    4646        scoreText_->setColour(ColourValue(0.0f, 0.75f, 0.2f, 1.0f));
    4747        scoreText_->setPosition(Vector2(0.6f, topOffset + 0.01f));
    4848
    49         deathsText_ = new OverlayText(0);
     49        deathsText_ = new OverlayText(nullptr);
    5050        deathsText_->setTextSize(0.04f);
    5151        deathsText_->setColour(ColourValue(0, 0.75f, 0.2f, 1.0f));
    5252        deathsText_->setPosition(Vector2(0.8f, topOffset + 0.01f));
    5353
    54         background_ = new Stats(0);
     54        background_ = new Stats(nullptr);
    5555        background_->setPosition(Vector2(leftOffset, topOffset));
    5656        background_->setSize(Vector2(width, height));
  • code/trunk/src/modules/overlays/stats/CreateLines.h

    r5980 r11071  
    2929
    3030#include "overlays/OverlaysPrereqs.h"
     31
     32#include <string>
    3133
    3234namespace orxonox
  • code/trunk/src/modules/overlays/stats/Scoreboard.cc

    r9667 r11071  
    6060        SUPER(Scoreboard, changedVisibility);
    6161
    62         for (unsigned int i = 0; i < this->lines_.size(); ++i)
    63             this->lines_[i]->changedVisibility();
     62        for (CreateLines* line : this->lines_)
     63            line->changedVisibility();
    6464    }
    6565
     
    9494
    9595        unsigned int index = 0;
    96         for (std::map<PlayerInfo*, Player>::const_iterator it = playerList.begin(); it != playerList.end(); ++it)
     96        for (const auto& mapEntry : playerList)
    9797        {
    98             this->lines_[index]->setPlayerName(multi_cast<std::string>(it->first->getName()));
    99             this->lines_[index]->setScore(multi_cast<std::string>(it->second.frags_));
    100             this->lines_[index]->setDeaths(multi_cast<std::string>(it->second.killed_));
     98            this->lines_[index]->setPlayerName(multi_cast<std::string>(mapEntry.first->getName()));
     99            this->lines_[index]->setScore(multi_cast<std::string>(mapEntry.second.frags_));
     100            this->lines_[index]->setDeaths(multi_cast<std::string>(mapEntry.second.killed_));
    101101            index++;
    102102        }
  • code/trunk/src/modules/overlays/stats/Scoreboard.h

    r9667 r11071  
    4444        virtual ~Scoreboard();
    4545
    46         virtual void tick(float dt);
     46        virtual void tick(float dt) override;
    4747
    4848        inline void setCreateLines(CreateLines* cl)
     
    5151            { return this->createlines_; }
    5252
    53         virtual void changedVisibility();
     53        virtual void changedVisibility() override;
    5454
    5555    private: // functions
  • code/trunk/src/modules/overlays/stats/Stats.cc

    r9667 r11071  
    4646    Stats::Stats(Context* context)
    4747        : OrxonoxOverlay(context)
    48         , statsOverlayNoise_(0)
    49         , statsOverlayBorder_(0)
     48        , statsOverlayNoise_(nullptr)
     49        , statsOverlayBorder_(nullptr)
    5050    {
    5151        RegisterObject(Stats);
  • code/trunk/src/modules/overlays/stats/Stats.h

    r9667 r11071  
    4646        void setConfigValues();
    4747
    48         virtual void tick(float dt);
     48        virtual void tick(float dt) override;
    4949
    5050    private: // variables
  • code/trunk/src/modules/pickup/CollectiblePickup.cc

    r10624 r11071  
    4747        Registers the object and initializes variables.
    4848    */
    49     CollectiblePickup::CollectiblePickup() : collection_(NULL)
     49    CollectiblePickup::CollectiblePickup() : collection_(nullptr)
    5050    {
    5151        RegisterObject(CollectiblePickup);
     
    103103    void CollectiblePickup::wasRemovedFromCollection(void)
    104104    {
    105         this->collection_ = NULL;
     105        this->collection_ = nullptr;
    106106    }
    107107}
  • code/trunk/src/modules/pickup/CollectiblePickup.h

    r9348 r11071  
    6161            virtual ~CollectiblePickup(); //! Destructor.
    6262
    63             virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
    64             virtual void changedPickedUp(void); //!< Is called when the pickup has transited from picked up to dropped 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.
     64            virtual void changedPickedUp(void) override; //!< Is called when the pickup has transited from picked up to dropped or the other way around.
    6565
    6666            /**
     
    6969            */
    7070            bool isInCollection(void) const
    71                 { return this->collection_ != NULL; }
     71                { return this->collection_ != nullptr; }
    7272
    7373        private:
  • code/trunk/src/modules/pickup/Pickup.cc

    r9667 r11071  
    7878    void Pickup::initialize(void)
    7979    {
    80         this->activationType_ = pickupActivationType::immediate;
    81         this->durationType_ = pickupDurationType::once;
     80        this->activationType_ = PickupActivationType::immediate;
     81        this->durationType_ = PickupDurationType::once;
    8282    }
    8383
     
    105105        switch(this->getActivationType())
    106106        {
    107             case pickupActivationType::immediate:
     107            case PickupActivationType::immediate:
    108108                return activationTypeImmediate_s;
    109             case pickupActivationType::onUse:
     109            case PickupActivationType::onUse:
    110110                return activationTypeOnUse_s;
    111111            default:
     
    124124        switch(this->getDurationType())
    125125        {
    126             case pickupDurationType::once:
     126            case PickupDurationType::once:
    127127                return durationTypeOnce_s;
    128             case pickupDurationType::continuous:
     128            case PickupDurationType::continuous:
    129129                return durationTypeContinuous_s;
    130130            default:
     
    142142    {
    143143        if(type == Pickup::activationTypeImmediate_s)
    144             this->setActivationType(pickupActivationType::immediate);
     144            this->setActivationType(PickupActivationType::immediate);
    145145        else if(type == Pickup::activationTypeOnUse_s)
    146             this->setActivationType(pickupActivationType::onUse);
     146            this->setActivationType(PickupActivationType::onUse);
    147147        else
    148148            orxout(internal_error, context::pickups) << "Invalid activationType '" << type << "' in " << this->getIdentifier()->getName() << "." << endl;
     
    158158    {
    159159        if(type == Pickup::durationTypeOnce_s)
    160             this->setDurationType(pickupDurationType::once);
     160            this->setDurationType(PickupDurationType::once);
    161161        else if(type == Pickup::durationTypeContinuous_s)
    162             this->setDurationType(pickupDurationType::continuous);
     162            this->setDurationType(PickupDurationType::continuous);
    163163        else
    164164            orxout(internal_error, context::pickups) << "Invalid durationType '" << type << "' in " << this->getIdentifier()->getName() << "." << endl;
  • code/trunk/src/modules/pickup/Pickup.h

    r9667 r11071  
    5353    @ingroup Pickup
    5454    */
    55     namespace pickupActivationType
     55    enum class PickupActivationType
    5656    {
    57         enum Value
    58         {
    59             immediate, //!< Means that the @ref orxonox::Pickup "Pickup" will be used immediately after pickup.
    60             onUse, //!< Means that the @ref orxonox::Pickup "Pickup" will be used at a later point trough some external influence.
    61         };
    62     }
     57        immediate, //!< Means that the @ref orxonox::Pickup "Pickup" will be used immediately after pickup.
     58        onUse, //!< Means that the @ref orxonox::Pickup "Pickup" will be used at a later point trough some external influence.
     59    };
    6360
    6461    /**
     
    6865    @ingroup Pickup
    6966    */
    70     namespace pickupDurationType
     67    enum class PickupDurationType
    7168    {
    72         enum Value
    73         {
    74             once, //!< Means that the @ref orxonox::Pickup "Pickup" will be used only once at a singular time instant.
    75             continuous, //!< Means that the @ref orxonox::Pickup "Pickup" will be used over a continuous timespan.
    76         };
    77     }
     69        once, //!< Means that the @ref orxonox::Pickup "Pickup" will be used only once at a singular time instant.
     70        continuous, //!< Means that the @ref orxonox::Pickup "Pickup" will be used over a continuous timespan.
     71    };
    7872
    7973    /**
     
    10397            virtual ~Pickup(); //!< Destructor.
    10498
    105             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     99            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    106100
    107             virtual const std::string& getRepresentationName() const
     101            virtual const std::string& getRepresentationName() const override
    108102                { return this->representationName_; }
    109103
     
    112106            @return Returns the activation type of the Pickup.
    113107            */
    114             inline pickupActivationType::Value getActivationType(void) const
     108            inline PickupActivationType getActivationType(void) const
    115109                { return this->activationType_; }
    116110            /**
     
    118112            @return Returns the duration type of the Pickup.
    119113            */
    120             inline pickupDurationType::Value getDurationType(void) const
     114            inline PickupDurationType getDurationType(void) const
    121115                { return this->durationType_; }
    122116
     
    129123            */
    130124            inline bool isImmediate(void) const
    131                 { return this->getActivationType() == pickupActivationType::immediate; }
     125                { return this->getActivationType() == PickupActivationType::immediate; }
    132126            /**
    133127            @brief Get whether the activation type is 'onUse'.
     
    135129            */
    136130            inline bool isOnUse(void) const
    137                 { return this->getActivationType() == pickupActivationType::onUse; }
     131                { return this->getActivationType() == PickupActivationType::onUse; }
    138132            /**
    139133            @brief Get whether the duration type is 'once'.
     
    141135            */
    142136            inline bool isOnce(void) const
    143                 { return this->getDurationType() == pickupDurationType::once; }
     137                { return this->getDurationType() == PickupDurationType::once; }
    144138            /**
    145139            @brief Get whether the duration type is 'continuous'.
     
    147141            */
    148142            inline bool isContinuous(void) const
    149                 { return this->getDurationType() == pickupDurationType::continuous; }
     143                { return this->getDurationType() == PickupDurationType::continuous; }
    150144
    151             virtual void changedPickedUp(void); //!< Should be called when the pickup has transited from picked up to dropped or the other way around.
     145            virtual void changedPickedUp(void) override; //!< Should be called when the pickup has transited from picked up to dropped or the other way around.
    152146
    153147        protected:
    154             virtual bool createSpawner(void); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
     148            virtual bool createSpawner(void) override; //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
    155149
    156150            /**
     
    164158            @param type The activation type of the Pickup.
    165159            */
    166             inline void setActivationType(pickupActivationType::Value type)
     160            inline void setActivationType(PickupActivationType type)
    167161                { this->activationType_ = type; }
    168162            /**
     
    170164            @param type The duration type of the Pickup.
    171165            */
    172             inline void setDurationType(pickupDurationType::Value type)
     166            inline void setDurationType(PickupDurationType type)
    173167                { this->durationType_ = type; }
    174168
     
    180174
    181175            std::string representationName_; //!< The name of the associated PickupRepresentation.
    182             pickupActivationType::Value activationType_; //!< The activation type of the Pickup.
    183             pickupDurationType::Value durationType_; //!< The duration type of the Pickup.
     176            PickupActivationType activationType_; //!< The activation type of the Pickup.
     177            PickupDurationType durationType_; //!< The duration type of the Pickup.
    184178
    185179            //! Strings for the activation and duration types.
  • code/trunk/src/modules/pickup/PickupCollection.cc

    r9667 r11071  
    6868    {
    6969        // Destroy all Pickupables constructing this PickupCollection.
    70         for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
    71         {
    72             (*it)->wasRemovedFromCollection();
    73             (*it)->destroy();
     70        for(CollectiblePickup* pickup : this->pickups_)
     71        {
     72            pickup->wasRemovedFromCollection();
     73            pickup->destroy();
    7474        }
    7575        this->pickups_.clear();
     
    9999        this->processingUsed_ = true;
    100100        // Change used for all Pickupables this PickupCollection consists of.
    101         for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
    102             (*it)->setUsed(this->isUsed());
     101        for(CollectiblePickup* pickup : this->pickups_)
     102            pickup->setUsed(this->isUsed());
    103103
    104104        this->processingUsed_ = false;
     
    119119        size_t numPickupsEnabled = 0;
    120120        size_t numPickupsInUse = 0;
    121         for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
    122         {
    123             if ((*it)->isEnabled())
     121        for(CollectiblePickup* pickup : this->pickups_)
     122        {
     123            if (pickup->isEnabled())
    124124                ++numPickupsEnabled;
    125             if ((*it)->isUsed())
     125            if (pickup->isUsed())
    126126                ++numPickupsInUse;
    127127        }
     
    146146
    147147        // Change the PickupCarrier for all Pickupables this PickupCollection consists of.
    148         for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
    149         {
    150             if(this->getCarrier() == NULL)
    151                 (*it)->setCarrier(NULL);
     148        for(CollectiblePickup* pickup : this->pickups_)
     149        {
     150            if(this->getCarrier() == nullptr)
     151                pickup->setCarrier(nullptr);
    152152            else
    153                 (*it)->setCarrier(this->getCarrier()->getTarget(*it));
     153                pickup->setCarrier(this->getCarrier()->getTarget(pickup));
    154154        }
    155155    }
     
    186186        // If at least all the enabled pickups of this PickupCollection are no longer picked up.
    187187        bool isOnePickupEnabledAndPickedUp = false;
    188         for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
    189         {
    190             if ((*it)->isEnabled() && (*it)->isPickedUp())
     188        for(CollectiblePickup* pickup : this->pickups_)
     189        {
     190            if (pickup->isEnabled() && pickup->isPickedUp())
    191191            {
    192192                isOnePickupEnabledAndPickedUp = true;
     
    208208    bool PickupCollection::isTarget(const PickupCarrier* carrier) const
    209209    {
    210         for(std::list<CollectiblePickup*>::const_iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
    211         {
    212             if(!carrier->isTarget(*it))
     210        for(CollectiblePickup* pickup : this->pickups_)
     211        {
     212            if(!carrier->isTarget(pickup))
    213213                return false;
    214214        }
     
    227227    bool PickupCollection::addPickupable(CollectiblePickup* pickup)
    228228    {
    229         if(pickup == NULL)
     229        if(pickup == nullptr)
    230230            return false;
    231231
     
    247247    {
    248248        if(this->pickups_.size() >= index)
    249             return NULL;
     249            return nullptr;
    250250
    251251        std::list<CollectiblePickup*>::const_iterator it = this->pickups_.begin();
  • code/trunk/src/modules/pickup/PickupCollection.h

    r9667 r11071  
    7373            virtual ~PickupCollection(); //!< Destructor.
    7474
    75             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Creates an instance of this Class through XML.
     75            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Creates an instance of this Class through XML.
    7676
    77             virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
    78             virtual void changedCarrier(void); //!< Is called when the pickup has changed its PickupCarrier.
    79             virtual void changedPickedUp(void); //!< Is called when the pickup has transited from picked up to dropped or the other way around.
     77            virtual void changedUsed(void) override; //!< Is called when the pickup has transited from used to unused or the other way around.
     78            virtual void changedCarrier(void) override; //!< Is called when the pickup has changed its PickupCarrier.
     79            virtual void changedPickedUp(void) override; //!< Is called when the pickup has transited from picked up to dropped or the other way around.
    8080
    81             virtual bool isTarget(const PickupCarrier* carrier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this PickupCollection.
     81            virtual bool isTarget(const PickupCarrier* carrier) const override; //!< Get whether a given class, represented by the input Identifier, is a target of this PickupCollection.
    8282
    8383            inline void setRepresentationName(const std::string& name)
    8484                { this->representationName_ = name; }
    85             virtual const std::string& getRepresentationName() const
     85            virtual const std::string& getRepresentationName() const override
    8686                { return this->representationName_; }
    8787
     
    9898
    9999        protected:
    100             virtual bool createSpawner(void); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
     100            virtual bool createSpawner(void) override; //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
    101101
    102102        private:
  • code/trunk/src/modules/pickup/PickupManager.cc

    r10624 r11071  
    6868        Constructor. Registers the PickupManager and creates the default PickupRepresentation.
    6969    */
    70     PickupManager::PickupManager() : guiLoaded_(false), pickupHighestIndex_(0), defaultRepresentation_(NULL)
     70    PickupManager::PickupManager() : guiLoaded_(false), pickupHighestIndex_(0), defaultRepresentation_(nullptr)
    7171    {
    7272        RegisterObject(PickupManager);
     
    8585    {
    8686        // Destroying the default representation.
    87         if(this->defaultRepresentation_ != NULL)
     87        if(this->defaultRepresentation_ != nullptr)
    8888            this->defaultRepresentation_->destroy();
    8989
     
    9191
    9292        // Destroying all the PickupInventoryContainers that are still there.
    93         for(std::map<uint32_t, PickupInventoryContainer*>::iterator it = this->pickupInventoryContainers_.begin(); it != this->pickupInventoryContainers_.end(); it++)
    94             delete it->second;
     93        for(const auto& mapEntry : this->pickupInventoryContainers_)
     94            delete mapEntry.second;
    9595        this->pickupInventoryContainers_.clear();
    9696
     
    184184        CollectiblePickup* collectible = orxonox_cast<CollectiblePickup*>(pickup);
    185185        // If the Pickupable is part of a PickupCollection it isn't displayed in the PickupInventory, just the PickupCollection is.
    186         if(collectible != NULL && collectible->isInCollection())
     186        if(collectible != nullptr && collectible->isInCollection())
    187187            return;
    188188
    189189        // Getting clientId of the host this change of the pickup's used status concerns.
    190190        PickupCarrier* carrier = pickup->getCarrier();
    191         while(carrier->getCarrierParent() != NULL)
     191        while(carrier->getCarrierParent() != nullptr)
    192192            carrier = carrier->getCarrierParent();
    193193        Pawn* pawn = orxonox_cast<Pawn*>(carrier);
    194         if(pawn == NULL)
     194        if(pawn == nullptr)
    195195            return;
    196196        PlayerInfo* info = pawn->getPlayer();
    197         if(info == NULL)
     197        if(info == nullptr)
    198198            return;
    199199        unsigned int clientId = info->getClientID();
     
    265265        CollectiblePickup* collectible = orxonox_cast<CollectiblePickup*>(pickup);
    266266        // If the Pickupable is part of a PickupCollection it isn't displayed in the PickupInventory, just the PickupCollection is.
    267         if(collectible != NULL && collectible->isInCollection())
     267        if(collectible != nullptr && collectible->isInCollection())
    268268            return;
    269269
    270270        // Getting clientId of the host this change of the pickup's pickedUp status concerns.
    271271        PickupCarrier* carrier = pickup->getCarrier();
    272         while(carrier->getCarrierParent() != NULL)
     272        while(carrier->getCarrierParent() != nullptr)
    273273            carrier = carrier->getCarrierParent();
    274274        Pawn* pawn = orxonox_cast<Pawn*>(carrier);
    275         if(pawn == NULL)
     275        if(pawn == nullptr)
    276276            return;
    277277        PlayerInfo* info = pawn->getFormerPlayer();
    278         if(info == NULL)
     278        if(info == nullptr)
    279279            return;
    280280        unsigned int clientId = info->getClientID();
     
    399399                return;
    400400            Pickupable* pickupable = this->pickups_.find(pickup)->second;
    401             if(pickupable != NULL)
     401            if(pickupable != nullptr)
    402402                pickupable->drop();
    403403        }
     
    442442                return;
    443443            Pickupable* pickupable = this->pickups_.find(pickup)->second;
    444             if(pickupable != NULL)
     444            if(pickupable != nullptr)
    445445                pickupable->setUsed(use);
    446446        }
  • code/trunk/src/modules/pickup/PickupManager.h

    r10624 r11071  
    117117            PickupRepresentation* getRepresentation(const std::string& name); // tolua_export
    118118
    119             virtual void pickupChangedUsed(Pickupable* pickup, bool used); //!< Is called by the PickupListener to notify the PickupManager, that the input Pickupable has transited to the input used state.
     119            virtual void pickupChangedUsed(Pickupable* pickup, bool used) override; //!< Is called by the PickupListener to notify the PickupManager, that the input Pickupable has transited to the input used state.
    120120            static void pickupChangedUsedNetwork(uint32_t pickup, bool inUse, bool usable, bool unusable); //!< Helper method to react to the change in the used status of a Pickupable.
    121             virtual void pickupChangedPickedUp(Pickupable* pickup, bool pickedUp); //!< Is called by the PickupListener to notify the PickupManager, that the input Pickupable has transited to the input pickedUp state.
     121            virtual void pickupChangedPickedUp(Pickupable* pickup, bool pickedUp) override; //!< Is called by the PickupListener to notify the PickupManager, that the input Pickupable has transited to the input pickedUp state.
    122122            static void pickupChangedPickedUpNetwork(uint32_t pickup, bool usable, uint32_t representationObjectId, const std::string& representationName, bool pickedUp); //!< Helper method to react to the change in the pickedUp status of a Pickupable.
    123123
     
    161161            std::map<uint32_t, PickupInventoryContainer*>::iterator pickupsIterator_; //!< An iterator pointing to the current Pickupable in pickupsList_.
    162162
    163             std::map<uint32_t, WeakPtr<Pickupable> > pickups_; //!< Map linking a number identifying a Pickupable to a weak pointer of a Pickupable.
     163            std::map<uint32_t, WeakPtr<Pickupable>> pickups_; //!< Map linking a number identifying a Pickupable to a weak pointer of a Pickupable.
    164164            std::map<Pickupable*, uint32_t> indexes_;//!< Map linking Pickupable to the number identifying it.
    165165
  • code/trunk/src/modules/pickup/PickupRepresentation.cc

    r11052 r11071  
    5252        This is primarily for use of the PickupManager in creating a default PickupRepresentation.
    5353    */
    54     PickupRepresentation::PickupRepresentation() : BaseObject(NULL), Synchronisable(NULL), spawnerRepresentation_(NULL)
     54    PickupRepresentation::PickupRepresentation() : BaseObject(nullptr), Synchronisable(nullptr), spawnerRepresentation_(nullptr)
    5555    {
    5656        RegisterObject(PickupRepresentation);
     
    6464        Default Constructor. Registers the object and initializes its member variables.
    6565    */
    66     PickupRepresentation::PickupRepresentation(Context* context) : BaseObject(context), Synchronisable(context), spawnerRepresentation_(NULL)
     66    PickupRepresentation::PickupRepresentation(Context* context) : BaseObject(context), Synchronisable(context), spawnerRepresentation_(nullptr)
    6767    {
    6868        RegisterObject(PickupRepresentation);
     
    7878    PickupRepresentation::~PickupRepresentation()
    7979    {
    80         if(this->spawnerRepresentation_ != NULL)
     80        if(this->spawnerRepresentation_ != nullptr)
    8181            this->spawnerRepresentation_->destroy();
    8282
     
    135135    StaticEntity* PickupRepresentation::createSpawnerRepresentation(PickupSpawner* spawner)
    136136    {
    137         if(this->spawnerRepresentation_ == NULL)
     137        if(this->spawnerRepresentation_ == nullptr)
    138138        {
    139139            orxout(verbose, context::pickups) << "PickupRepresentation: No spawner representation found." << endl;
     
    149149        this->spawnerRepresentation_->setVisible(true);
    150150        StaticEntity* temp = this->spawnerRepresentation_;
    151         this->spawnerRepresentation_ = NULL;
     151        this->spawnerRepresentation_ = nullptr;
    152152
    153153        return temp;
     
    164164    {
    165165        this->spawnerRepresentation_ = representation;
    166         if(this->spawnerRepresentation_ != NULL)
     166        if(this->spawnerRepresentation_ != nullptr)
    167167            this->spawnerRepresentation_->setVisible(false);
    168168    }
  • code/trunk/src/modules/pickup/PickupRepresentation.h

    r9667 r11071  
    9898            virtual ~PickupRepresentation(); //!< Destructor.
    9999
    100             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PickupRepresentation object through XML.
     100            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a PickupRepresentation object through XML.
    101101
    102102            /**
     
    119119            @brief Get the StaticEntity that defines how the PickupSpawner of the Pickupable represented by this PickupRepresentation looks like.
    120120            @param index The index.
    121             @return Returns (for index = 0) a pointer to the StaticEntity. For index > 0 it returns NULL.
     121            @return Returns (for index = 0) a pointer to the StaticEntity. For index > 0 it returns nullptr.
    122122            */
    123123            inline const StaticEntity* getSpawnerRepresentationIndex(unsigned int index) const
    124                 { if(index == 0) return this->spawnerRepresentation_; return NULL; }
     124                { if(index == 0) return this->spawnerRepresentation_; return nullptr; }
    125125            /**
    126126            @brief Get the name of the image representing the pickup in the PickupInventory.
     
    129129            inline const std::string& getInventoryRepresentation(void) const { return this->inventoryRepresentation_; } // tolua_export
    130130
    131             virtual void changedName();
     131            virtual void changedName() override;
    132132
    133133            StaticEntity* createSpawnerRepresentation(PickupSpawner* spawner); //!< Create a spawnerRepresentation for a specific PickupSpawner.
  • code/trunk/src/modules/pickup/PickupSpawner.cc

    r10624 r11071  
    5555        Pointer to the object which created this item.
    5656    */
    57     PickupSpawner::PickupSpawner(Context* context) : StaticEntity(context), pickup_(NULL), representation_(NULL), pickupTemplate_(NULL)
     57    PickupSpawner::PickupSpawner(Context* context) : StaticEntity(context), pickup_(nullptr), representation_(nullptr), pickupTemplate_(nullptr)
    5858    {
    5959        RegisterObject(PickupSpawner);
     
    7474        this->selfDestruct_ = false;
    7575
    76         this->setPickupable(NULL);
     76        this->setPickupable(nullptr);
    7777    }
    7878
     
    8383    PickupSpawner::~PickupSpawner()
    8484    {
    85         if(this->isInitialized() && this->selfDestruct_ && this->pickup_ != NULL)
     85        if(this->isInitialized() && this->selfDestruct_ && this->pickup_ != nullptr)
    8686            this->pickup_->destroy();
    8787    }
     
    158158
    159159            // Iterate trough all Pawns.
    160             for(ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
     160            for(Pawn* pawn : ObjectList<Pawn>())
    161161            {
    162                 if(spawner == NULL) // Stop if the PickupSpawner has been deleted (e.g. because it has run out of pickups to distribute).
     162                if(spawner == nullptr) // Stop if the PickupSpawner has been deleted (e.g. because it has run out of pickups to distribute).
    163163                    break;
    164164
    165                 Vector3 distance = it->getWorldPosition() - this->getWorldPosition();
    166                 PickupCarrier* carrier = static_cast<PickupCarrier*>(*it);
     165                Vector3 distance = pawn->getWorldPosition() - this->getWorldPosition();
     166                PickupCarrier* carrier = static_cast<PickupCarrier*>(pawn);
    167167                // If a PickupCarrier, that fits the target-range of the Pickupable spawned by this PickupSpawner, is in trigger-distance and the carrier is not blocked.
    168                 if(distance.length() < this->triggerDistance_ && carrier != NULL && this->blocked_.find(carrier) == this->blocked_.end())
     168                if(distance.length() < this->triggerDistance_ && carrier != nullptr && this->blocked_.find(carrier) == this->blocked_.end())
    169169                {
    170170                    if(carrier->isTarget(this->pickup_))
    171                         this->trigger(*it);
     171                        this->trigger(pawn);
    172172                }
    173173            }
     
    195195        pickedUp = false; // To avoid compiler warning.
    196196
    197         this->setPickupable(NULL);
     197        this->setPickupable(nullptr);
    198198        this->decrementSpawnsRemaining();
    199199    }
     
    282282        {
    283283            orxout(internal_error, context::pickups) << "Massive Error: PickupSpawner still alive until having spawned last item." << endl;
    284             return NULL;
    285         }
    286 
    287         if (this->pickupTemplate_ != NULL)
     284            return nullptr;
     285        }
     286
     287        if (this->pickupTemplate_ != nullptr)
    288288        {
    289289            Identifier* identifier = this->pickupTemplate_->getBaseclassIdentifier();
    290             if (identifier != NULL)
     290            if (identifier != nullptr)
    291291            {
    292292                Pickupable* pickup = orxonox_cast<Pickupable*>(identifier->fabricate(this->getContext()));
     
    298298        }
    299299
    300         return NULL;
     300        return nullptr;
    301301    }
    302302
     
    309309    void PickupSpawner::setPickupable(Pickupable* pickup)
    310310    {
    311         if (this->representation_ != NULL)
     311        if (this->representation_ != nullptr)
    312312        {
    313313            this->representation_->destroy();
    314             this->representation_ = NULL;
    315         }
    316 
    317         if (pickup != NULL)
    318         {
    319             if (this->pickup_ != NULL)
     314            this->representation_ = nullptr;
     315        }
     316
     317        if (pickup != nullptr)
     318        {
     319            if (this->pickup_ != nullptr)
    320320                this->pickup_->destroy();
    321321
  • code/trunk/src/modules/pickup/PickupSpawner.h

    r9667 r11071  
    8282            static PickupSpawner* createDroppedPickup(Context* context, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance = 10.0);
    8383
    84             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< Method for creating a PickupSpawner through XML.
    85             virtual void tick(float dt); //!< Tick, checks if any Pawn is close enough to trigger.
     84            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;  //!< Method for creating a PickupSpawner through XML.
     85            virtual void tick(float dt) override; //!< Tick, checks if any Pawn is close enough to trigger.
    8686
    8787            /**
  • code/trunk/src/modules/pickup/items/BoostPickup.cc

    r11052 r11071  
    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/trunk/src/modules/pickup/items/BoostPickup.h

    r11052 r11071  
    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/trunk/src/modules/pickup/items/DamageBoostPickup.cc

    r9667 r11071  
    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
     
    152152        Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails.
    153153    @return
    154         A pointer to the SpaceShip, or NULL if the conversion failed.
     154        A pointer to the SpaceShip, or nullptr if the conversion failed.
    155155    */
    156156    SpaceShip* DamageBoostPickup::carrierToSpaceShipHelper(void)
     
    159159        SpaceShip* ship = orxonox_cast<SpaceShip*>(carrier);
    160160
    161         if(ship == NULL)
     161        if(ship == nullptr)
    162162        {
    163163            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in DamageBoostPickup." << endl;
  • code/trunk/src/modules/pickup/items/DronePickup.cc

    r9667 r11071  
    7474    {
    7575        this->addTarget(ClassIdentifier<Pawn>::getIdentifier());
    76         this->setDurationType(pickupDurationType::once);
     76        this->setDurationType(PickupDurationType::once);
    7777        this->droneTemplate_ = "";
    7878    }
     
    122122
    123123                Pawn* pawn = this->carrierToPawnHelper();
    124                 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     124                if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    125125                    this->Pickupable::destroy();
    126126
     
    131131                Controller* controller = drone->getController();
    132132                DroneController* droneController = orxonox_cast<DroneController*>(controller);
    133                 if(droneController != NULL)
     133                if(droneController != nullptr)
    134134                {
    135135                    droneController->setOwner(pawn);
     
    156156        Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
    157157    @return
    158         A pointer to the Pawn, or NULL if the conversion failed.
     158        A pointer to the Pawn, or nullptr if the conversion failed.
    159159    */
    160160    Pawn* DronePickup::carrierToPawnHelper(void)
     
    163163        Pawn* pawn = orxonox_cast<Pawn*>(carrier);
    164164
    165         if(pawn == NULL)
     165        if(pawn == nullptr)
    166166        {
    167167            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in DronePickup." << endl;
  • code/trunk/src/modules/pickup/items/HealthPickup.cc

    r9667 r11071  
    7777        this->health_ = 0.0f;
    7878        this->healthRate_ = 0.0f;
    79         this->healthType_ = pickupHealthType::limited;
     79        this->healthType_ = PickupHealthType::limited;
    8080        this->maxHealthSave_ = 0.0f;
    8181        this->maxHealthOverwrite_ = 0.0f;
     
    114114        {
    115115            Pawn* pawn = this->carrierToPawnHelper();
    116             if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     116            if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    117117                this->Pickupable::destroy();
    118118
     
    127127            switch(this->getHealthType())
    128128            {
    129                 case pickupHealthType::permanent:
     129                case PickupHealthType::permanent:
    130130                    if(pawn->getMaxHealth() < fullHealth)
    131131                        pawn->setMaxHealth(fullHealth);
    132                 case pickupHealthType::limited:
     132                case PickupHealthType::limited:
    133133                    pawn->addHealth(health);
    134134                    break;
    135                 case pickupHealthType::temporary:
     135                case PickupHealthType::temporary:
    136136                    if(pawn->getMaxHealth() > fullHealth)
    137137                    {
     
    168168            {
    169169                Pawn* pawn = this->carrierToPawnHelper();
    170                 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     170                if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    171171                    this->Pickupable::destroy();
    172172
     
    174174                switch(this->getHealthType())
    175175                {
    176                     case pickupHealthType::permanent:
     176                    case PickupHealthType::permanent:
    177177                        health = pawn->getHealth()+this->getHealth();
    178178                        if(pawn->getMaxHealth() < health)
    179179                            pawn->setMaxHealth(health);
    180                     case pickupHealthType::limited:
     180                    case PickupHealthType::limited:
    181181                        pawn->addHealth(this->getHealth());
    182182                        break;
    183                     case pickupHealthType::temporary:
     183                    case PickupHealthType::temporary:
    184184                        health = pawn->getHealth()+this->getHealth();
    185185                        if(pawn->getMaxHealth() < health)
     
    201201        else
    202202        {
    203             if(this->getHealthType() == pickupHealthType::temporary)
     203            if(this->getHealthType() == PickupHealthType::temporary)
    204204            {
    205205                PickupCarrier* carrier = this->getCarrier();
    206206                Pawn* pawn = orxonox_cast<Pawn*>(carrier);
    207207
    208                 if(pawn == NULL)
     208                if(pawn == nullptr)
    209209                {
    210210                    orxout(internal_error, context::pickups) << "Something went horribly wrong in Health Pickup. PickupCarrier is '" << carrier->getIdentifier()->getName() << "' instead of Pawn." << endl;
     
    233233        Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
    234234    @return
    235         A pointer to the Pawn, or NULL if the conversion failed.
     235        A pointer to the Pawn, or nullptr if the conversion failed.
    236236    */
    237237    Pawn* HealthPickup::carrierToPawnHelper(void)
     
    240240        Pawn* pawn = orxonox_cast<Pawn*>(carrier);
    241241
    242         if(pawn == NULL)
     242        if(pawn == nullptr)
    243243            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in HealthPickup." << endl;
    244244
     
    256256        switch(this->getHealthType())
    257257        {
    258             case pickupHealthType::limited:
     258            case PickupHealthType::limited:
    259259                return HealthPickup::healthTypeLimited_s;
    260             case pickupHealthType::temporary:
     260            case PickupHealthType::temporary:
    261261                return HealthPickup::healthTypeTemporary_s;
    262             case pickupHealthType::permanent:
     262            case PickupHealthType::permanent:
    263263                return HealthPickup::healthTypePermanent_s;
    264264            default:
     
    308308    {
    309309        if(type == HealthPickup::healthTypeLimited_s)
    310             this->setHealthType(pickupHealthType::limited);
     310            this->setHealthType(PickupHealthType::limited);
    311311        else if(type == HealthPickup::healthTypeTemporary_s)
    312             this->setHealthType(pickupHealthType::temporary);
     312            this->setHealthType(PickupHealthType::temporary);
    313313        else if(type == HealthPickup::healthTypePermanent_s)
    314             this->setHealthType(pickupHealthType::permanent);
     314            this->setHealthType(PickupHealthType::permanent);
    315315        else
    316316            orxout(internal_error, context::pickups) << "Invalid healthType '" << type << "' in HealthPickup." << endl;
  • code/trunk/src/modules/pickup/items/HealthPickup.h

    r9667 r11071  
    5151    @ingroup PickupItems
    5252    */
    53     namespace pickupHealthType
     53    enum class PickupHealthType
    5454    {
    55         enum Value
    56         {
    57             limited, //!< Means that the @ref orxonox::HealthPickup "HealthPickup" only increases the users health to its maximum health.
    58             temporary, //!< Means that the @ref orxonox::HealthPickup "HealthPickup" temporarily increases the users health even above its maximum health, but only as long as it is in use.
    59             permanent //!< Means that the @ref orxonox::HealthPickup "HealthPickup" increases the users health even above its maximum health and increases the maximum health permanently such that it matches the new health.
    60         };
    61     }
     55        limited, //!< Means that the @ref orxonox::HealthPickup "HealthPickup" only increases the users health to its maximum health.
     56        temporary, //!< Means that the @ref orxonox::HealthPickup "HealthPickup" temporarily increases the users health even above its maximum health, but only as long as it is in use.
     57        permanent //!< Means that the @ref orxonox::HealthPickup "HealthPickup" increases the users health even above its maximum health and increases the maximum health permanently such that it matches the new health.
     58    };
    6259
    6360    /**
     
    115112            @return Returns the health type as an enum.
    116113            */
    117             inline pickupHealthType::Value getHealthType(void) const
     114            inline PickupHealthType getHealthType(void) const
    118115                { return this->healthType_; }
    119116            const std::string& getHealthTypeAsString(void) const; //!< Get the health type of this pickup.
     
    127124            @param type The type of this pickup as an enum.
    128125            */
    129             inline void setHealthType(pickupHealthType::Value type)
     126            inline void setHealthType(PickupHealthType type)
    130127                { this->healthType_ = type; }
    131128            void setHealthTypeAsString(const std::string& type); //!< Set the type of the HealthPickup.
     
    139136            float maxHealthSave_; //!< Helper to remember what the actual maxHealth of the Pawn was before we changed it.
    140137            float maxHealthOverwrite_; //!< Helper to remember with which value we overwrote the maxHealh, to detect if someone else changed it as well.
    141             pickupHealthType::Value healthType_; //!< The type of the HealthPickup.
     138            PickupHealthType healthType_; //!< The type of the HealthPickup.
    142139
    143140            //! Strings for the health types.
  • code/trunk/src/modules/pickup/items/InvisiblePickup.cc

    r9667 r11071  
    139139    {
    140140        Pawn* pawn = this->carrierToPawnHelper();
    141         if(pawn == NULL)
     141        if(pawn == nullptr)
    142142            return false;
    143143
     
    163163        Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
    164164    @return
    165         A pointer to the Pawn, or NULL if the conversion failed.
     165        A pointer to the Pawn, or nullptr if the conversion failed.
    166166    */
    167167    Pawn* InvisiblePickup::carrierToPawnHelper(void)
     
    170170        Pawn* pawn = orxonox_cast<Pawn*>(carrier);
    171171
    172         if(pawn == NULL)
     172        if(pawn == nullptr)
    173173        {
    174174            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in InvisiblePickup." << endl;
  • code/trunk/src/modules/pickup/items/MetaPickup.cc

    r9667 r11071  
    7979        this->addTarget(ClassIdentifier<PickupCarrier>::getIdentifier());
    8080
    81         this->setDurationType(pickupDurationType::once);
    82         this->metaType_ = pickupMetaType::none;
     81        this->setDurationType(PickupDurationType::once);
     82        this->metaType_ = PickupMetaType::none;
    8383    }
    8484
     
    104104
    105105        // If the MetaPickup transited to used, and the metaType is not none.
    106         if(this->isUsed() && this->metaType_ != pickupMetaType::none)
     106        if(this->isUsed() && this->metaType_ != PickupMetaType::none)
    107107        {
    108108            PickupCarrier* carrier = this->getCarrier();
    109             if(this->getMetaType() != pickupMetaType::none && carrier != NULL)
     109            if(this->getMetaType() != PickupMetaType::none && carrier != nullptr)
    110110            {
    111111                // If the metaType is destroyCarrier, then the PickupCarrier is destroyed.
    112                 if(this->getMetaType() == pickupMetaType::destroyCarrier)
     112                if(this->getMetaType() == PickupMetaType::destroyCarrier)
    113113                {
    114114                    Pawn* pawn = orxonox_cast<Pawn*>(carrier);
     
    118118                std::set<Pickupable*> pickups = carrier->getPickups();
    119119                // Iterate over all Pickupables of the PickupCarrier.
    120                 for(std::set<Pickupable*>::iterator it = pickups.begin(); it != pickups.end(); it++)
     120                for(Pickupable* pickup : pickups)
    121121                {
    122                     Pickupable* pickup = (*it);
    123                     if(pickup == NULL || pickup == this)
     122                    if(pickup == nullptr || pickup == this)
    124123                        continue;
    125124
    126125                    // If the metaType is use, then the Pickupable is set to used.
    127                     if(this->getMetaType() == pickupMetaType::use && !pickup->isUsed())
     126                    if(this->getMetaType() == PickupMetaType::use && !pickup->isUsed())
    128127                    {
    129128                        pickup->setUsed(true);
    130129                    }
    131130                    // If the metaType is drop, then the Pickupable is dropped.
    132                     else if(this->getMetaType() == pickupMetaType::drop)
     131                    else if(this->getMetaType() == PickupMetaType::drop)
    133132                    {
    134133                        pickup->drop();
    135134                    }
    136135                    // If the metaType is destroy, then the Pickupable is destroyed.
    137                     else if(this->getMetaType() == pickupMetaType::destroy)
     136                    else if(this->getMetaType() == PickupMetaType::destroy)
    138137                    {
    139138                        pickup->Pickupable::destroy();
     
    155154        switch(this->getMetaType())
    156155        {
    157             case pickupMetaType::none:
     156            case PickupMetaType::none:
    158157                return MetaPickup::metaTypeNone_s;
    159             case pickupMetaType::use:
     158            case PickupMetaType::use:
    160159                return MetaPickup::metaTypeUse_s;
    161             case pickupMetaType::drop:
     160            case PickupMetaType::drop:
    162161                return MetaPickup::metaTypeDrop_s;
    163             case pickupMetaType::destroy:
     162            case PickupMetaType::destroy:
    164163                return MetaPickup::metaTypeDestroy_s;
    165             case pickupMetaType::destroyCarrier:
     164            case PickupMetaType::destroyCarrier:
    166165                return MetaPickup::metaTypeDestroyCarrier_s;
    167166            default:
     
    180179        if(type == MetaPickup::metaTypeNone_s)
    181180        {
    182             this->setMetaType(pickupMetaType::none);
     181            this->setMetaType(PickupMetaType::none);
    183182        }
    184183        else if(type == MetaPickup::metaTypeUse_s)
    185184        {
    186             this->setMetaType(pickupMetaType::use);
     185            this->setMetaType(PickupMetaType::use);
    187186        }
    188187        else if(type == MetaPickup::metaTypeDrop_s)
    189188        {
    190             this->setMetaType(pickupMetaType::drop);
     189            this->setMetaType(PickupMetaType::drop);
    191190        }
    192191        else if(type == MetaPickup::metaTypeDestroy_s)
    193192        {
    194             this->setMetaType(pickupMetaType::destroy);
     193            this->setMetaType(PickupMetaType::destroy);
    195194        }
    196195        else if(type == MetaPickup::metaTypeDestroyCarrier_s)
    197196        {
    198             this->setMetaType(pickupMetaType::destroyCarrier);
     197            this->setMetaType(PickupMetaType::destroyCarrier);
    199198        }
    200199        else
  • code/trunk/src/modules/pickup/items/MetaPickup.h

    r9667 r11071  
    4848    @ingroup PickupItems
    4949    */
    50     namespace pickupMetaType
     50    enum class PickupMetaType
    5151    {
    52         enum Value
    53         {
    54             none, //!< The @ref orxonox::MetaPickup "MetaPickup" does nothing.
    55             use, //!< The @ref orxonox::MetaPickup "MetaPickup" uses all the @ref orxonox::PickupCarrier "PickupCarriers'" @ref orxonox::Pickupable "Pickupables".
    56             drop, //!< The @ref orxonox::MetaPickup "MetaPickup" drops all the @ref orxonox::PickupCarrier "PickupCarriers'" @ref orxonox::Pickupable "Pickupables".
    57             destroy, //!< The @ref orxonox::MetaPickup "MetaPickup" destroys all the @ref orxonox::PickupCarrier "PickupCarriers'" @ref orxonox::Pickupable "Pickupables".
    58             destroyCarrier //!< The @ref orxonox::MetaPickup "MetaPickup" destroys the @ref orxonox::PickupCarrier "PickupCarrier".
    59         };
    60     }
     52        none, //!< The @ref orxonox::MetaPickup "MetaPickup" does nothing.
     53        use, //!< The @ref orxonox::MetaPickup "MetaPickup" uses all the @ref orxonox::PickupCarrier "PickupCarriers'" @ref orxonox::Pickupable "Pickupables".
     54        drop, //!< The @ref orxonox::MetaPickup "MetaPickup" drops all the @ref orxonox::PickupCarrier "PickupCarriers'" @ref orxonox::Pickupable "Pickupables".
     55        destroy, //!< The @ref orxonox::MetaPickup "MetaPickup" destroys all the @ref orxonox::PickupCarrier "PickupCarriers'" @ref orxonox::Pickupable "Pickupables".
     56        destroyCarrier //!< The @ref orxonox::MetaPickup "MetaPickup" destroys the @ref orxonox::PickupCarrier "PickupCarrier".
     57    };
    6158
    6259    /**
     
    10097            @return Returns an enum with the meta type of the MetaPickup.
    10198            */
    102             inline pickupMetaType::Value getMetaType(void) const
     99            inline PickupMetaType getMetaType(void) const
    103100                { return this->metaType_; }
    104101            const std::string& getMetaTypeAsString(void) const; //!< Get the meta type of this MetaPickup.
     
    109106            @param type The meta type as an enum.
    110107            */
    111             inline void setMetaType(pickupMetaType::Value type)
     108            inline void setMetaType(PickupMetaType type)
    112109                { this->metaType_ =  type; }
    113110            void setMetaTypeAsString(const std::string& type); //!< Set the meta type of this MetaPickup.
     
    116113            void initialize(void); //!< Initializes the member variables.
    117114
    118             pickupMetaType::Value metaType_; //!< The meta type of the MetaPickup, determines which actions are taken.
     115            PickupMetaType metaType_; //!< The meta type of the MetaPickup, determines which actions are taken.
    119116
    120117            //! Static strings for the meta types.
  • code/trunk/src/modules/pickup/items/MunitionContainer.h

    r11052 r11071  
    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/trunk/src/modules/pickup/items/MunitionPickup.cc

    r11052 r11071  
    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/trunk/src/modules/pickup/items/MunitionPickup.h

    r11052 r11071  
    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
    65             virtual void addMunitionContainer(MunitionContainer* munitionContainer);
     65            void addMunitionContainer(MunitionContainer* munitionContainer);
    6666            MunitionContainer* getMunitionContainer(unsigned int index);
    6767
  • code/trunk/src/modules/pickup/items/ShieldPickup.cc

    r9667 r11071  
    9999
    100100        Pawn* pawn = this->carrierToPawnHelper();
    101         if(pawn == NULL)
     101        if(pawn == nullptr)
    102102            this->Pickupable::destroy();
    103103
     
    143143    Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
    144144    @return
    145     A pointer to the Pawn, or NULL if the conversion failed.
     145    A pointer to the Pawn, or nullptr if the conversion failed.
    146146    */
    147147    Pawn* ShieldPickup::carrierToPawnHelper(void)
     
    150150        Pawn* pawn = orxonox_cast<Pawn*>(carrier);
    151151
    152         if(pawn == NULL)
     152        if(pawn == nullptr)
    153153        {
    154154            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in ShieldPickup." << endl;
  • code/trunk/src/modules/pickup/items/ShrinkPickup.cc

    r10624 r11071  
    146146        {
    147147            Pawn* pawn = this->carrierToPawnHelper();
    148             if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     148            if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    149149            {
    150150                this->Pickupable::destroy();
     
    173173                //TODO: Deploy particle effect.
    174174                Pawn* pawn = this->carrierToPawnHelper();
    175                 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     175                if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    176176                    return;
    177177
     
    182182
    183183                // Iterate over all camera positions and inversely move the camera to create a shrinking sensation.
    184                 const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
     184                const std::list<StrongPtr<CameraPosition>>& cameraPositions = pawn->getCameraPositions();
    185185                int size = cameraPositions.size();
    186186                for(int index = 0; index < size; index++)
    187187                {
    188188                    CameraPosition* cameraPos = pawn->getCameraPosition(index);
    189                     if(cameraPos == NULL)
     189                    if(cameraPos == nullptr)
    190190                        continue;
    191191                    cameraPos->setPosition(cameraPos->getPosition()/factor);
     
    201201                //TODO: Deploy particle effect.
    202202                Pawn* pawn = this->carrierToPawnHelper();
    203                 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     203                if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    204204                    return;
    205205
     
    208208
    209209                // Iterate over all camera positions and inversely move the camera to create a shrinking sensation.
    210                 const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
     210                const std::list<StrongPtr<CameraPosition>>& cameraPositions = pawn->getCameraPositions();
    211211                int size = cameraPositions.size();
    212212                for(int index = 0; index < size; index++)
    213213                {
    214214                    CameraPosition* cameraPos = pawn->getCameraPosition(index);
    215                     if(cameraPos == NULL)
     215                    if(cameraPos == nullptr)
    216216                        continue;
    217217                    cameraPos->setPosition(cameraPos->getPosition()/this->shrinkFactor_);
     
    237237            {
    238238                Pawn* pawn = this->carrierToPawnHelper();
    239                 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     239                if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    240240                {
    241241                    this->Pickupable::destroy();
     
    263263
    264264                // Iterate over all camera positions and inversely move the camera to create a shrinking sensation.
    265                 const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
     265                const std::list<StrongPtr<CameraPosition>>& cameraPositions = pawn->getCameraPositions();
    266266                int size = cameraPositions.size();
    267267                for(int index = 0; index < size; index++)
    268268                {
    269269                    CameraPosition* cameraPos = pawn->getCameraPosition(index);
    270                     if(cameraPos == NULL)
     270                    if(cameraPos == nullptr)
    271271                        continue;
    272272                    cameraPos->setPosition(cameraPos->getPosition()/factor);
     
    277277            {
    278278                Pawn* pawn = this->carrierToPawnHelper();
    279                 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     279                if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    280280                    this->Pickupable::destroy();
    281281
     
    304304
    305305                // Iterate over all camera positions and inversely move the camera to create a shrinking sensation.
    306                 const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
     306                const std::list<StrongPtr<CameraPosition>>& cameraPositions = pawn->getCameraPositions();
    307307                int size = cameraPositions.size();
    308308                for(int index = 0; index < size; index++)
    309309                {
    310310                    CameraPosition* cameraPos = pawn->getCameraPosition(index);
    311                     if(cameraPos == NULL)
     311                    if(cameraPos == nullptr)
    312312                        continue;
    313313                    cameraPos->setPosition(cameraPos->getPosition()/factor);
  • code/trunk/src/modules/pickup/items/SpeedPickup.cc

    r9667 r11071  
    9999
    100100        SpaceShip* ship = this->carrierToSpaceShipHelper();
    101         if(ship == NULL) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed.
     101        if(ship == nullptr) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed.
    102102            this->Pickupable::destroy();
    103103
     
    143143        Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails.
    144144    @return
    145         A pointer to the SpaceShip, or NULL if the conversion failed.
     145        A pointer to the SpaceShip, or nullptr if the conversion failed.
    146146    */
    147147    SpaceShip* SpeedPickup::carrierToSpaceShipHelper(void)
     
    150150        SpaceShip* ship = orxonox_cast<SpaceShip*>(carrier);
    151151
    152         if(ship == NULL)
     152        if(ship == nullptr)
    153153        {
    154154            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in SpeedPickup." << endl;
  • code/trunk/src/modules/pong/Pong.cc

    r9939 r11071  
    6464        RegisterObject(Pong);
    6565
    66         this->center_ = 0;
    67         this->ball_ = 0;
    68         this->bat_[0] = 0;
    69         this->bat_[1] = 0;
     66        this->center_ = nullptr;
     67        this->ball_ = nullptr;
     68        this->bat_[0] = nullptr;
     69        this->bat_[1] = nullptr;
    7070
    7171        this->setHUDTemplate("PongHUD");
     
    103103    void Pong::cleanup()
    104104    {
    105         if (this->ball_ != NULL) // Destroy the ball, if present.
     105        if (this->ball_ != nullptr) // Destroy the ball, if present.
    106106        {
    107107            this->ball_->destroy();
    108             this->ball_ = 0;
     108            this->ball_ = nullptr;
    109109        }
    110110
     
    112112        for (size_t i = 0; i < 2; ++i)
    113113        {
    114             if (this->bat_[0] != NULL)
     114            if (this->bat_[0] != nullptr)
    115115            {
    116116                this->bat_[0]->destroy();
    117                 this->bat_[0] = 0;
     117                this->bat_[0] = nullptr;
    118118            }
    119119        }
     
    127127    void Pong::start()
    128128    {
    129         if (this->center_ != NULL) // There needs to be a PongCenterpoint, i.e. the area the game takes place.
    130         {
    131             if (this->ball_ == NULL) // If there is no ball, create a new ball.
     129        if (this->center_ != nullptr) // There needs to be a PongCenterpoint, i.e. the area the game takes place.
     130        {
     131            if (this->ball_ == nullptr) // If there is no ball, create a new ball.
    132132            {
    133133                this->ball_ = new PongBall(this->center_->getContext());
     
    145145
    146146            // If one of the bats is missing, create it. Apply the template for the bats as specified in the centerpoint.
    147             for (size_t i = 0; i < 2; ++i)
     147            for (WeakPtr<orxonox::PongBat>& bat : this->bat_)
    148148            {
    149                 if (this->bat_[i] == NULL)
     149                if (bat == nullptr)
    150150                {
    151                     this->bat_[i] = new PongBat(this->center_->getContext());
    152                     this->bat_[i]->addTemplate(this->center_->getBattemplate());
     151                    bat = new PongBat(this->center_->getContext());
     152                    bat->addTemplate(this->center_->getBattemplate());
    153153                }
    154154            }
     
    211211    {
    212212        // first spawn human players to assign always the left bat to the player in singleplayer
    213         for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    214             if (it->first->isHumanPlayer() && (it->first->isReadyToSpawn() || this->bForceSpawn_))
    215                 this->spawnPlayer(it->first);
     213        for (const auto& mapEntry : this->players_)
     214            if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
     215                this->spawnPlayer(mapEntry.first);
    216216        // now spawn bots
    217         for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    218             if (!it->first->isHumanPlayer() && (it->first->isReadyToSpawn() || this->bForceSpawn_))
    219                 this->spawnPlayer(it->first);
     217        for (const auto& mapEntry : this->players_)
     218            if (!mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
     219                this->spawnPlayer(mapEntry.first);
    220220    }
    221221
     
    231231
    232232        // If the first (left) bat has no player.
    233         if (this->bat_[0]->getPlayer() == NULL)
     233        if (this->bat_[0]->getPlayer() == nullptr)
    234234        {
    235235            player->startControl(this->bat_[0]);
     
    237237        }
    238238        // If the second (right) bat has no player.
    239         else if (this->bat_[1]->getPlayer() == NULL)
     239        else if (this->bat_[1]->getPlayer() == nullptr)
    240240        {
    241241            player->startControl(this->bat_[1]);
     
    247247
    248248        // If the player is an AI, it receives a pointer to the ball.
    249         if (player->getController() != NULL && player->getController()->isA(Class(PongAI)))
     249        if (player->getController() != nullptr && player->getController()->isA(Class(PongAI)))
    250250        {
    251251            PongAI* ai = orxonox_cast<PongAI*>(player->getController());
     
    262262        Deathmatch::playerScored(player, score);
    263263
    264         if (this->center_ != NULL) // If there is a centerpoint.
     264        if (this->center_ != nullptr) // If there is a centerpoint.
    265265        {
    266266            // Fire an event for the player that has scored, to be able to react to it in the level, e.g. by displaying fireworks.
     
    271271
    272272            // Also announce, that the player has scored.
    273             if (player != NULL)
     273            if (player != nullptr)
    274274                this->gtinfo_->sendAnnounceMessage(player->getName() + " scored");
    275275        }
    276276
    277277        // If there is a ball present, reset its position, velocity and acceleration.
    278         if (this->ball_ != NULL)
     278        if (this->ball_ != nullptr)
    279279        {
    280280            this->ball_->setPosition(Vector3::ZERO);
     
    285285
    286286        // If there are bats reset them to the middle position.
    287         if (this->bat_[0] != NULL && this->bat_[1] != NULL)
     287        if (this->bat_[0] != nullptr && this->bat_[1] != nullptr)
    288288        {
    289289            this->bat_[0]->setPosition(-this->center_->getFieldDimension().x / 2, 0, 0);
     
    292292
    293293        // If a player gets enough points, he won the game -> end of game
    294         PlayerInfo* winningPlayer = NULL;
     294        PlayerInfo* winningPlayer = nullptr;
    295295        if (this->getLeftPlayer() && this->getScore(this->getLeftPlayer()) >= scoreLimit_)
    296296            winningPlayer = this->getLeftPlayer();
     
    314314    void Pong::startBall()
    315315    {
    316         if (this->ball_ != NULL && this->center_ != NULL)
     316        if (this->ball_ != nullptr && this->center_ != nullptr)
    317317            this->ball_->setSpeed(this->center_->getBallSpeed());
    318318    }
     
    322322        Get the left player.
    323323    @return
    324         Returns a pointer to the player playing on the left. If there is no left player, NULL is returned.
     324        Returns a pointer to the player playing on the left. If there is no left player, nullptr is returned.
    325325    */
    326326    PlayerInfo* Pong::getLeftPlayer() const
    327327    {
    328         if (this->bat_ != NULL && this->bat_[0] != NULL)
     328        if (this->bat_ != nullptr && this->bat_[0] != nullptr)
    329329            return this->bat_[0]->getPlayer();
    330330        else
    331             return 0;
     331            return nullptr;
    332332    }
    333333
     
    336336        Get the right player.
    337337    @return
    338         Returns a pointer to the player playing on the right. If there is no right player, NULL is returned.
     338        Returns a pointer to the player playing on the right. If there is no right player, nullptr is returned.
    339339    */
    340340    PlayerInfo* Pong::getRightPlayer() const
    341341    {
    342         if (this->bat_ != NULL && this->bat_[1] != NULL)
     342        if (this->bat_ != nullptr && this->bat_[1] != nullptr)
    343343            return this->bat_[1]->getPlayer();
    344344        else
    345             return 0;
     345            return nullptr;
    346346    }
    347347}
  • code/trunk/src/modules/pong/Pong.h

    r9667 r11071  
    6868            virtual ~Pong(); //!< Destructor. Cleans up, if initialized.
    6969
    70             virtual void start(); //!< Starts the Pong minigame.
    71             virtual void end(); ///!< Ends the Pong minigame.
     70            virtual void start() override; //!< Starts the Pong minigame.
     71            virtual void end() override; ///!< Ends the Pong minigame.
    7272
    73             virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player.
     73            virtual void spawnPlayer(PlayerInfo* player) override; //!< Spawns the input player.
    7474
    75             virtual void playerScored(PlayerInfo* player, int score = 1); //!< Is called when the player scored.
     75            virtual void playerScored(PlayerInfo* player, int score = 1) override; //!< Is called when the player scored.
    7676
    7777            /**
     
    8787
    8888        protected:
    89             virtual void spawnPlayersIfRequested(); //!< Spawns players, and fills the rest up with bots.
     89            virtual void spawnPlayersIfRequested() override; //!< Spawns players, and fills the rest up with bots.
    9090
    9191            void startBall(); //!< Starts the ball with some default speed.
  • code/trunk/src/modules/pong/PongAI.cc

    r11018 r11071  
    5757        RegisterObject(PongAI);
    5858
    59         this->ball_ = 0;
     59        this->ball_ = nullptr;
    6060        this->ballDirection_ = Vector2::ZERO;
    6161        this->ballEndPosition_ = 0;
     
    7777    PongAI::~PongAI()
    7878    {
    79         for (std::list<std::pair<Timer*, char> >::iterator it = this->reactionTimers_.begin(); it != this->reactionTimers_.end(); ++it)
    80             delete it->first;
     79        for (std::pair<Timer*, char>& pair : this->reactionTimers_)
     80            delete pair.first;
    8181    }
    8282
     
    101101    {
    102102        // If either the ball, or the controllable entity (i.e. the bat) don't exist (or aren't set).
    103         if (this->ball_  == NULL || this->getControllableEntity() == NULL)
     103        if (this->ball_  == nullptr || this->getControllableEntity() == nullptr)
    104104            return;
    105105
     
    362362            // Add a new Timer
    363363            Timer* timer = new Timer(delay, false, createExecutor(createFunctor(&PongAI::delayedMove, this)));
    364             this->reactionTimers_.push_back(std::pair<Timer*, char>(timer, direction));
     364            this->reactionTimers_.emplace_back(timer, direction);
    365365        }
    366366        else
  • code/trunk/src/modules/pong/PongAI.h

    r9667 r11071  
    6666            void setConfigValues();
    6767
    68             virtual void tick(float dt); //!< Implements the behavior of the PongAI (i.e. its intelligence).
     68            virtual void tick(float dt) override; //!< Implements the behavior of the PongAI (i.e. its intelligence).
    6969
    7070            /**
     
    8989            float strength_; //!< The strength of the AI. Ranging from 0 to 1.
    9090
    91             std::list<std::pair<Timer*, char> > reactionTimers_; //!< A list of reaction timers and the directions that take effect when their timer expires.
     91            std::list<std::pair<Timer*, char>> reactionTimers_; //!< A list of reaction timers and the directions that take effect when their timer expires.
    9292            char movement_; //!< The planned movement.
    9393            char oldMove_; //!< The previous movement.
  • code/trunk/src/modules/pong/PongBall.cc

    r9945 r11071  
    6161        this->speed_ = 0;
    6262        this->accelerationFactor_ = 1.0f;
    63         this->bat_ = 0;
     63        this->bat_ = nullptr;
    6464        this->bDeleteBats_ = false;
    6565        this->batID_ = new unsigned int[2];
     
    8282             else
    8383             {
    84                  this->defScoreSound_ = 0;
    85                  this->defBatSound_ = 0;
    86                  this->defBoundarySound_ = 0;
     84                 this->defScoreSound_ = nullptr;
     85                 this->defBatSound_ = nullptr;
     86                 this->defBoundarySound_ = nullptr;
    8787             }
    8888    }
     
    163163            float distance = 0;
    164164
    165             if (this->bat_ != NULL) // If there are bats.
     165            if (this->bat_ != nullptr) // If there are bats.
    166166            {
    167167                // If the right boundary has been crossed.
    168                 if (position.x > this->fieldWidth_ / 2 && this->bat_[1] != NULL)
     168                if (position.x > this->fieldWidth_ / 2 && this->bat_[1] != nullptr)
    169169                {
    170170                    // Calculate the distance (in z-direction) between the ball and the center of the bat, weighted by half of the effective length of the bat (with additional 10%)
     
    195195                }
    196196                // If the left boundary has been crossed.
    197                 else if (position.x < -this->fieldWidth_ / 2 && this->bat_[0] != NULL)
     197                else if (position.x < -this->fieldWidth_ / 2 && this->bat_[0] != nullptr)
    198198                {
    199199                    // Calculate the distance (in z-direction) between the ball and the center of the bat, weighted by half of the effective length of the bat (with additional 10%)
     
    285285    {
    286286        // Make space for the bats, if they don't exist, yet.
    287         if (this->bat_ == NULL)
     287        if (this->bat_ == nullptr)
    288288        {
    289289            this->bat_ = new WeakPtr<PongBat>[2];
  • code/trunk/src/modules/pong/PongBall.h

    r9939 r11071  
    6363            virtual ~PongBall();
    6464
    65             virtual void tick(float dt);
     65            virtual void tick(float dt) override;
    6666
    67             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     67            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    6868
    6969            /**
  • code/trunk/src/modules/pong/PongBat.h

    r9667 r11071  
    6060            virtual ~PongBat() {}
    6161
    62             virtual void tick(float dt);
     62            virtual void tick(float dt) override;
    6363
    64             virtual void moveFrontBack(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
    65             virtual void moveRightLeft(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
     64            virtual void moveFrontBack(const Vector2& value) override; //!< Overloaded the function to steer the bat up and down.
     65            virtual void moveRightLeft(const Vector2& value) override; //!< Overloaded the function to steer the bat up and down.
    6666
    67             virtual void changedPlayer(); //!< Is called when the player changed.
     67            virtual void changedPlayer() override; //!< Is called when the player changed.
    6868
    6969            /**
  • code/trunk/src/modules/pong/PongCenterpoint.cc

    r10624 r11071  
    8484    void PongCenterpoint::checkGametype()
    8585    {
    86         if (this->getGametype() != NULL && this->getGametype()->isA(Class(Pong)))
     86        if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Pong)))
    8787        {
    8888            Pong* pongGametype = orxonox_cast<Pong*>(this->getGametype());
  • code/trunk/src/modules/pong/PongCenterpoint.h

    r10624 r11071  
    124124            virtual ~PongCenterpoint() {}
    125125
    126             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method to create a PongCenterpoint through XML.
     126            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method to create a PongCenterpoint through XML.
    127127
    128128            /**
  • code/trunk/src/modules/pong/PongScore.cc

    r10624 r11071  
    5555        RegisterObject(PongScore);
    5656
    57         this->owner_ = 0;
     57        this->owner_ = nullptr;
    5858
    5959        this->bShowName_ = false;
     
    9797
    9898        // If the owner is set. The owner being a Pong game.
    99         if (this->owner_ != NULL)
     99        if (this->owner_ != nullptr)
    100100        {
    101101            if (!this->owner_->hasEnded())
     
    113113
    114114            // Save the name and score of each player as a string.
    115             if (player1_ != NULL)
     115            if (player1_ != nullptr)
    116116            {
    117117                name1 = player1_->getName();
    118118                score1 = multi_cast<std::string>(this->owner_->getScore(player1_));
    119119            }
    120             if (player2_ != NULL)
     120            if (player2_ != nullptr)
    121121            {
    122122                name2 = player2_->getName();
     
    128128            if (this->bShowLeftPlayer_)
    129129            {
    130                 if (this->bShowName_ && this->bShowScore_ && player1_ != NULL)
     130                if (this->bShowName_ && this->bShowScore_ && player1_ != nullptr)
    131131                    output1 = name1 + " - " + score1;
    132132                else if (this->bShowScore_)
     
    139139            if (this->bShowRightPlayer_)
    140140            {
    141                 if (this->bShowName_ && this->bShowScore_ && player2_ != NULL)
     141                if (this->bShowName_ && this->bShowScore_ && player2_ != nullptr)
    142142                    output2 = score2 + " - " + name2;
    143143                else if (this->bShowScore_)
     
    163163    @brief
    164164        Is called when the owner changes.
    165         Sets the owner to NULL, if it is not a pointer to a Pong game.
     165        Sets the owner to nullptr, if it is not a pointer to a Pong game.
    166166    */
    167167    void PongScore::changedOwner()
     
    169169        SUPER(PongScore, changedOwner);
    170170
    171         if (this->getOwner() != NULL && this->getOwner()->getGametype())
     171        if (this->getOwner() != nullptr && this->getOwner()->getGametype())
    172172            this->owner_ = orxonox_cast<Pong*>(this->getOwner()->getGametype());
    173173        else
    174             this->owner_ = 0;
     174            this->owner_ = nullptr;
    175175    }
    176176}
  • code/trunk/src/modules/pong/PongScore.h

    r9939 r11071  
    6060            virtual ~PongScore();
    6161
    62             virtual void tick(float dt); //!< Creates and sets the caption to be displayed by the PongScore.
    63             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    64             virtual void changedOwner(); //!< Is called when the owner changes.
     62            virtual void tick(float dt) override; //!< Creates and sets the caption to be displayed by the PongScore.
     63            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     64            virtual void changedOwner() override; //!< Is called when the owner changes.
    6565
    6666            /**
  • code/trunk/src/modules/portals/PortalEndPoint.cc

    r11022 r11071  
    4848    std::map<unsigned int, PortalEndPoint *> PortalEndPoint::idMap_s;
    4949
    50     PortalEndPoint::PortalEndPoint(Context* context) : StaticEntity(context), RadarViewable(this, static_cast<WorldEntity*>(this)), id_(0), trigger_(NULL), reenterDelay_(0)
     50    PortalEndPoint::PortalEndPoint(Context* context) : StaticEntity(context), RadarViewable(this, static_cast<WorldEntity*>(this)), id_(0), trigger_(nullptr), reenterDelay_(0)
    5151    {
    5252        RegisterObject(PortalEndPoint);
     
    5757
    5858        this->setRadarObjectColour(ColourValue::White);
    59         this->setRadarObjectShape(RadarViewable::Dot);
     59        this->setRadarObjectShape(RadarViewable::Shape::Dot);
    6060        this->setRadarVisibility(true);
    6161        if( GameMode::isMaster() )
     
    7272    {
    7373        if (this->isInitialized()) {
    74             if (this->trigger_ != NULL)
     74            if (this->trigger_ != nullptr)
    7575                this->trigger_->destroy();
    7676
    77             if (this->portalSound_ != NULL)
     77            if (this->portalSound_ != nullptr)
    7878                this->portalSound_->destroy();
    7979        }
     
    112112
    113113        MultiTriggerContainer * cont = orxonox_cast<MultiTriggerContainer *>(trigger);
    114         if(cont == 0)
     114        if(cont == nullptr)
    115115            return true;
    116116
    117117        DistanceMultiTrigger * originatingTrigger = orxonox_cast<DistanceMultiTrigger *>(cont->getOriginator());
    118         if(originatingTrigger == 0)
     118        if(originatingTrigger == nullptr)
    119119        {
    120120            return true;
     
    122122
    123123        MobileEntity * entity = orxonox_cast<MobileEntity *>(cont->getData());
    124         if(entity == 0)
     124        if(entity == nullptr)
    125125            return true;
    126126
  • code/trunk/src/modules/portals/PortalEndPoint.h

    r9667 r11071  
    6363            virtual ~PortalEndPoint();
    6464
    65             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    66             virtual void changedActivity(void);
     65            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     66            virtual void changedActivity(void) override;
    6767
    6868            inline void setTarget(const std::string & target)                 //!< add types which are allowed to activate the PortalEndPoint
    6969                { this->trigger_->addTarget(target); }
    7070
    71             void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
     71            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override;
    7272            static std::map<unsigned int, PortalEndPoint *> idMap_s; //!< Maps the id of each PortalEndPoint to a pointer to that PortalEndPoint
    7373            inline void setReenterDelay(unsigned int seconds)
  • code/trunk/src/modules/portals/PortalLink.cc

    r9667 r11071  
    4040    std::map<PortalEndPoint *, PortalEndPoint *> PortalLink::links_s;
    4141
    42     PortalLink::PortalLink(Context* context) : BaseObject(context), fromID_(0), toID_(0), from_(0), to_(0)
     42    PortalLink::PortalLink(Context* context) : BaseObject(context), fromID_(0), toID_(0), from_(nullptr), to_(nullptr)
    4343    {
    4444        RegisterObject(PortalLink);
     
    6767    void PortalLink::use(MobileEntity* entity, PortalEndPoint * entrance)
    6868    {
    69         if(entrance == 0)
     69        if(entrance == nullptr)
    7070            return;
    7171
  • code/trunk/src/modules/portals/PortalLink.h

    r9667 r11071  
    5656            PortalLink(Context* context);
    5757            virtual ~PortalLink();
    58             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     58            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    5959
    6060            inline void setFromID(unsigned int from)    //!< set the ID of the PortalEndPoint which should act as the entrance of this link
  • code/trunk/src/modules/questsystem/GlobalQuest.cc

    r9667 r11071  
    9494
    9595        // Iterate through all players possessing this Quest.
    96         for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
    97             QuestEffect::invokeEffects(*it, this->getFailEffectList());
     96        for(PlayerInfo* questPlayer : players_)
     97            QuestEffect::invokeEffects(questPlayer, this->getFailEffectList());
    9898
    9999        return true;
     
    119119
    120120        // Iterate through all players possessing the Quest.
    121         for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
    122             QuestEffect::invokeEffects(*it, this->getCompleteEffectList());
     121        for(PlayerInfo* questPlayer : players_)
     122            QuestEffect::invokeEffects(questPlayer, this->getCompleteEffectList());
    123123
    124124        Quest::complete(player);
     
    138138    bool GlobalQuest::isStartable(const PlayerInfo* player) const
    139139    {
    140         if(!(this->getParentQuest() == NULL || this->getParentQuest()->isActive(player)))
     140        if(!(this->getParentQuest() == nullptr || this->getParentQuest()->isActive(player)))
    141141            return false;
    142142
     
    177177        The player.
    178178    */
    179     QuestStatus::Value GlobalQuest::getStatus(const PlayerInfo* player) const
     179    QuestStatus GlobalQuest::getStatus(const PlayerInfo* player) const
    180180    {
    181181        assert(player);
     
    198198        The status to be set.
    199199    @return
    200         Returns false if player is NULL.
    201     */
    202     bool GlobalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status)
     200        Returns false if player is nullptr.
     201    */
     202    bool GlobalQuest::setStatus(PlayerInfo* player, const QuestStatus & status)
    203203    {
    204204        assert(player);
     
    242242    {
    243243        int i = index;
    244         for (std::list<QuestEffect*>::const_iterator effect = this->rewards_.begin(); effect != this->rewards_.end(); ++effect)
     244        for (QuestEffect* reward : this->rewards_)
    245245        {
    246246            if(i == 0)
    247                return *effect;
     247               return reward;
    248248
    249249            i--;
    250250        }
    251         return NULL;
     251        return nullptr;
    252252    }
    253253
  • code/trunk/src/modules/questsystem/GlobalQuest.h

    r9667 r11071  
    9393            virtual ~GlobalQuest();
    9494
    95             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a GlobalQuest object through XML.
     95            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a GlobalQuest object through XML.
    9696
    97             virtual bool fail(PlayerInfo* player); //!< Fails the Quest.
    98             virtual bool complete(PlayerInfo* player); //!< Completes the Quest.
     97            virtual bool fail(PlayerInfo* player) override; //!< Fails the Quest.
     98            virtual bool complete(PlayerInfo* player) override; //!< Completes the Quest.
    9999
    100100        protected:
    101             virtual bool isStartable(const PlayerInfo* player) const; //!< Checks whether the Quest can be started.
    102             virtual bool isFailable(const PlayerInfo* player) const; //!< Checks whether the Quest can be failed.
    103             virtual bool isCompletable(const PlayerInfo* player) const; //!< Checks whether the Quest can be completed.
     101            virtual bool isStartable(const PlayerInfo* player) const override; //!< Checks whether the Quest can be started.
     102            virtual bool isFailable(const PlayerInfo* player) const override; //!< Checks whether the Quest can be failed.
     103            virtual bool isCompletable(const PlayerInfo* player) const override; //!< Checks whether the Quest can be completed.
    104104
    105             virtual QuestStatus::Value getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player.
     105            virtual QuestStatus getStatus(const PlayerInfo* player) const override; //!< Returns the status of the Quest for a specific player.
    106106
    107             virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status); //!< Sets the status for a specific player.
     107            virtual bool setStatus(PlayerInfo* player, const QuestStatus & status) override; //!< Sets the status for a specific player.
    108108
    109109        private:
    110110            std::set<PlayerInfo*> players_; //!< The set of players which possess this Quest.
    111             QuestStatus::Value status_; //!< The status of this Quest.
     111            QuestStatus status_; //!< The status of this Quest.
    112112            std::list<QuestEffect*> rewards_; //!< Reward QuestEffects only invoked on the player completing the Quest.
    113113
  • code/trunk/src/modules/questsystem/LocalQuest.cc

    r9667 r11071  
    128128    bool LocalQuest::isStartable(const PlayerInfo* player) const
    129129    {
    130         if(!(this->getParentQuest() == NULL || this->getParentQuest()->isActive(player)))
     130        if(!(this->getParentQuest() == nullptr || this->getParentQuest()->isActive(player)))
    131131            return false;
    132132
     
    168168        Returns the status of the Quest for the input player.
    169169    */
    170     QuestStatus::Value LocalQuest::getStatus(const PlayerInfo* player) const
     170    QuestStatus LocalQuest::getStatus(const PlayerInfo* player) const
    171171    {
    172172        assert(player);
    173173
    174         std::map<const PlayerInfo*, QuestStatus::Value>::const_iterator it = this->playerStatus_.find(player);
     174        std::map<const PlayerInfo*, QuestStatus>::const_iterator it = this->playerStatus_.find(player);
    175175        if (it != this->playerStatus_.end()) // If there is a player in the map.
    176176            return it->second;
     
    188188        The status to be set.
    189189    @return
    190         Returns false if player is NULL.
    191     */
    192     bool LocalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status)
     190        Returns false if player is nullptr.
     191    */
     192    bool LocalQuest::setStatus(PlayerInfo* player, const QuestStatus & status)
    193193    {
    194194        assert(player);
  • code/trunk/src/modules/questsystem/LocalQuest.h

    r9667 r11071  
    8787            virtual ~LocalQuest();
    8888
    89             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a LocalQuest object through XML.
     89            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a LocalQuest object through XML.
    9090
    91             virtual bool fail(PlayerInfo* player); //!< Fails the Quest.
    92             virtual bool complete(PlayerInfo* player); //!< Completes the Quest.
     91            virtual bool fail(PlayerInfo* player) override; //!< Fails the Quest.
     92            virtual bool complete(PlayerInfo* player) override; //!< Completes the Quest.
    9393
    9494        protected:
    95             virtual bool isStartable(const PlayerInfo* player) const; //!< Checks whether the Quest can be started.
    96             virtual bool isFailable(const PlayerInfo* player) const; //!< Checks whether the Quest can be failed.
    97             virtual bool isCompletable(const PlayerInfo* player) const; //!< Checks whether the Quest can be completed.
     95            virtual bool isStartable(const PlayerInfo* player) const override; //!< Checks whether the Quest can be started.
     96            virtual bool isFailable(const PlayerInfo* player) const override; //!< Checks whether the Quest can be failed.
     97            virtual bool isCompletable(const PlayerInfo* player) const override; //!< Checks whether the Quest can be completed.
    9898
    99             virtual QuestStatus::Value getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player.
    100             virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status); //!< Sets the status for a specific player.
     99            virtual QuestStatus getStatus(const PlayerInfo* player) const override; //!< Returns the status of the Quest for a specific player.
     100            virtual bool setStatus(PlayerInfo* player, const QuestStatus & status) override; //!< Sets the status for a specific player.
    101101
    102102        private:
    103             std::map<const PlayerInfo*, QuestStatus::Value> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
     103            std::map<const PlayerInfo*, QuestStatus> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
    104104
    105105    };
  • code/trunk/src/modules/questsystem/Quest.cc

    r10624 r11071  
    5555        RegisterObject(Quest);
    5656
    57         this->parentQuest_ = NULL;
     57        this->parentQuest_ = nullptr;
    5858    }
    5959
     
    183183        The index.
    184184    @return
    185         Returns a pointer to the sub-quest at the given index. NULL if there is no element at the given index.
     185        Returns a pointer to the sub-quest at the given index. nullptr if there is no element at the given index.
    186186    */
    187187    const Quest* Quest::getSubQuest(unsigned int index) const
     
    190190
    191191        // Iterate through all subquests.
    192         for (std::list<Quest*>::const_iterator subQuest = this->subQuests_.begin(); subQuest != this->subQuests_.end(); ++subQuest)
     192        for (Quest* quest : this->subQuests_)
    193193        {
    194194            if(i == 0) // We're counting down...
    195                return *subQuest;
     195               return quest;
    196196
    197197            i--;
    198198        }
    199199
    200         return NULL; // If the index is greater than the number of elements in the list.
     200        return nullptr; // If the index is greater than the number of elements in the list.
    201201    }
    202202
     
    207207        The index.
    208208    @return
    209         Returns a pointer to the QuestHint at the given index. NULL if there is no element at the given index.
     209        Returns a pointer to the QuestHint at the given index. nullptr if there is no element at the given index.
    210210    */
    211211    const QuestHint* Quest::getHint(unsigned int index) const
     
    214214
    215215        // Iterate through all QuestHints.
    216         for (std::list<QuestHint*>::const_iterator hint = this->hints_.begin(); hint != this->hints_.end(); ++hint)
     216        for (QuestHint* hint : this->hints_)
    217217        {
    218218            if(i == 0) // We're counting down...
    219                return *hint;
     219               return hint;
    220220
    221221            i--;
    222222        }
    223         return NULL; // If the index is greater than the number of elements in the list.
     223        return nullptr; // If the index is greater than the number of elements in the list.
    224224    }
    225225
     
    230230        The index.
    231231    @return
    232         Returns a pointer to the fail QuestEffect at the given index. NULL if there is no element at the given index.
     232        Returns a pointer to the fail QuestEffect at the given index. nullptr if there is no element at the given index.
    233233    */
    234234    const QuestEffect* Quest::getFailEffect(unsigned int index) const
     
    237237
    238238        // Iterate through all fail QuestEffects.
    239         for (std::list<QuestEffect*>::const_iterator effect = this->failEffects_.begin(); effect != this->failEffects_.end(); ++effect)
     239        for (QuestEffect* effect : this->failEffects_)
    240240        {
    241241            if(i == 0) // We're counting down...
    242                return *effect;
     242               return effect;
    243243
    244244            i--;
    245245        }
    246         return NULL; // If the index is greater than the number of elements in the list.
     246        return nullptr; // If the index is greater than the number of elements in the list.
    247247    }
    248248
     
    253253        The index.
    254254    @return
    255         Returns a pointer to the complete QuestEffect at the given index. NULL if there is no element at the given index.
     255        Returns a pointer to the complete QuestEffect at the given index. nullptr if there is no element at the given index.
    256256    */
    257257    const QuestEffect* Quest::getCompleteEffect(unsigned int index) const
     
    260260
    261261        // Iterate through all complete QuestEffects.
    262         for (std::list<QuestEffect*>::const_iterator effect = this->completeEffects_.begin(); effect != this->completeEffects_.end(); ++effect)
     262        for (QuestEffect* effect : this->completeEffects_)
    263263        {
    264264            if(i == 0) // We're counting down...
    265                return *effect;
     265               return effect;
    266266
    267267            i--;
    268268        }
    269         return NULL; // If the index is greater than the number of elements in the list.
     269        return nullptr; // If the index is greater than the number of elements in the list.
    270270    }
    271271
     
    280280    bool Quest::isInactive(const PlayerInfo* player) const
    281281    {
    282         if(player == NULL)
     282        if(player == nullptr)
    283283            return true;
    284284        return this->getStatus(player) == QuestStatus::Inactive;
     
    295295    bool Quest::isActive(const PlayerInfo* player) const
    296296    {
    297         if(player == NULL)
     297        if(player == nullptr)
    298298            return false;
    299299        return this->getStatus(player) == QuestStatus::Active;
     
    310310    bool Quest::isFailed(const PlayerInfo* player) const
    311311    {
    312         if(player == NULL)
     312        if(player == nullptr)
    313313            return false;
    314314        return this->getStatus(player) == QuestStatus::Failed;
     
    325325    bool Quest::isCompleted(const PlayerInfo* player) const
    326326    {
    327         if(player == NULL)
     327        if(player == nullptr)
    328328            return false;
    329329        return this->getStatus(player) == QuestStatus::Completed;
  • code/trunk/src/modules/questsystem/Quest.h

    r9667 r11071  
    5151    @ingroup Questsystem
    5252    */
    53     namespace QuestStatus
     53    enum class QuestStatus
    5454    {
    55         enum Value
    56         {
    57             Inactive, //!< The @ref orxonox::Quest "Quest" is inactive.
    58             Active, //!< The @ref orxonox::Quest "Quest" is active.
    59             Failed, //!< The @ref orxonox::Quest "Quest" has been failed.
    60             Completed //!< The @ref orxonox::Quest "Quest" has been completed.
    61         };
    62     }
     55        Inactive, //!< The @ref orxonox::Quest "Quest" is inactive.
     56        Active, //!< The @ref orxonox::Quest "Quest" is active.
     57        Failed, //!< The @ref orxonox::Quest "Quest" has been failed.
     58        Completed //!< The @ref orxonox::Quest "Quest" has been completed.
     59    };
    6360
    6461    /**
     
    8582            virtual ~Quest();
    8683
    87             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a Quest object through XML.
     84            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a Quest object through XML.
    8885
    8986            /**
     
    143140                { return this->completeEffects_; }
    144141
    145             virtual QuestStatus::Value getStatus(const PlayerInfo* player) const = 0; //!< Returns the status of the Quest for a specific player.
    146             virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status) = 0; //!< Changes the status for a specific player.
     142            virtual QuestStatus getStatus(const PlayerInfo* player) const = 0; //!< Returns the status of the Quest for a specific player.
     143            virtual bool setStatus(PlayerInfo* player, const QuestStatus & status) = 0; //!< Changes the status for a specific player.
    147144
    148145        private:
  • code/trunk/src/modules/questsystem/QuestDescription.cc

    r9667 r11071  
    119119        }
    120120
    121         NotificationListener::sendNotification(message, QuestDescription::SENDER, notificationMessageType::info, notificationSendMode::network, player->getClientID());
     121        NotificationListener::sendNotification(message, QuestDescription::SENDER, NotificationMessageType::info, NotificationSendMode::network, player->getClientID());
    122122        return true;
    123123    }
  • code/trunk/src/modules/questsystem/QuestDescription.h

    r9667 r11071  
    6767            virtual ~QuestDescription();
    6868
    69             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestDescription object through XML.
     69            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a QuestDescription object through XML.
    7070
    7171// tolua_begin
  • code/trunk/src/modules/questsystem/QuestEffect.cc

    r10624 r11071  
    7474        orxout(verbose, context::quests) << "Invoking QuestEffects on player: " << player << " ."  << endl;
    7575
    76         for (std::list<QuestEffect*>::iterator effect = effects.begin(); effect != effects.end(); effect++)
    77             temp = temp && (*effect)->invoke(player);
     76        for (QuestEffect* effect : effects)
     77            temp = temp && effect->invoke(player);
    7878
    7979        return temp;
  • code/trunk/src/modules/questsystem/QuestEffectBeacon.cc

    r9667 r11071  
    113113
    114114        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
    115         PlayerInfo* player = NULL;
     115        PlayerInfo* player = nullptr;
    116116
    117117        // If the trigger is a PlayerTrigger.
    118         if(pTrigger != NULL)
     118        if(pTrigger != nullptr)
    119119        {
    120120            if(!pTrigger->isForPlayer())  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
     
    126126            return false;
    127127
    128         if(player == NULL)
     128        if(player == nullptr)
    129129        {
    130130            orxout(verbose, context::quests) << "The QuestEffectBeacon was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << endl;
     
    236236    {
    237237        int i = index;
    238         for (std::list<QuestEffect*>::const_iterator effect = this->effects_.begin(); effect != this->effects_.end(); ++effect)
     238        for (QuestEffect* effect : this->effects_)
    239239        {
    240240            if(i == 0)
    241                return *effect;
     241               return effect;
    242242
    243243            i--;
    244244        }
    245         return NULL;
     245        return nullptr;
    246246    }
    247247
  • code/trunk/src/modules/questsystem/QuestEffectBeacon.h

    r9667 r11071  
    5050    @ingroup Questsystem
    5151    */
    52     namespace QuestEffectBeaconStatus
     52    enum class QuestEffectBeaconStatus
    5353    {
    54         enum Value
    55         {
    56             Inactive, //!< The @ref orxonox::QuestEffectBeacon "QuestEffectBeacon" is inactive.
    57             Active //!< The @ref orxonox::QuestEffectBeacon "QuestEffectBeacon" is active.
    58         };
    59     }
     54        Inactive, //!< The @ref orxonox::QuestEffectBeacon "QuestEffectBeacon" is inactive.
     55        Active //!< The @ref orxonox::QuestEffectBeacon "QuestEffectBeacon" is active.
     56    };
    6057
    6158    /**
     
    9693            virtual ~QuestEffectBeacon();
    9794
    98             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestEffectBeacon object through XML.
    99             virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
     95            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a QuestEffectBeacon object through XML.
     96            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override;
    10097
    10198            bool execute(bool bTriggered, BaseObject* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon.
     
    125122            std::list<QuestEffect*> effects_; //!< The list of QuestEffects to be invoked on the executing player.
    126123            int times_; //!< Number of times the beacon can be exectued.
    127             QuestEffectBeaconStatus::Value status_; //!< The status of the QuestEffectBeacon, Can be eighter active or inactive.
     124            QuestEffectBeaconStatus status_; //!< The status of the QuestEffectBeacon, Can be eighter active or inactive.
    128125
    129126            bool setTimes(const int & n); //!< Set the number of times the QuestEffectBeacon can be executed.
  • code/trunk/src/modules/questsystem/QuestHint.cc

    r9667 r11071  
    8888    bool QuestHint::isActive(const PlayerInfo* player) const
    8989    {
    90         if(player == NULL) // If the player is NULL, the Quest obviously can't be active.
     90        if(player == nullptr) // If the player is nullptr, the Quest obviously can't be active.
    9191            return false;
    9292
    9393        // Find the player.
    94         std::map<const PlayerInfo*, QuestHintStatus::Value>::const_iterator it = this->playerStatus_.find(player);
     94        std::map<const PlayerInfo*, QuestHintStatus>::const_iterator it = this->playerStatus_.find(player);
    9595        if (it != this->playerStatus_.end()) // If the player is in the map.
    96             return it->second;
     96            return (it->second == QuestHintStatus::Active);
    9797
    98         return QuestStatus::Inactive;
     98        return false;
    9999    }
    100100
  • code/trunk/src/modules/questsystem/QuestHint.h

    r9667 r11071  
    5050    @ingroup Questsystem
    5151    */
    52     namespace QuestHintStatus
     52    enum class QuestHintStatus
    5353    {
    54         enum Value
    55         {
    56             Inactive, //!< The @ref orxonox::QuestHint "QuestHint" is inactive.
    57             Active //!< The @ref orxonox::QuestHint "QuestHint" is active.
    58         };
    59     }
     54        Inactive, //!< The @ref orxonox::QuestHint "QuestHint" is inactive.
     55        Active //!< The @ref orxonox::QuestHint "QuestHint" is active.
     56    };
    6057
    6158    /**
     
    8582            virtual ~QuestHint();
    8683
    87             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestHint object through XML.
     84            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a QuestHint object through XML.
    8885
    8986            bool isActive(const PlayerInfo* player) const; //!< Returns true if the QuestHint is active for the input player.
     
    10198        private:
    10299            Quest* quest_; //!< The Quest the QuestHint belongs to.
    103             std::map<const PlayerInfo*, QuestHintStatus::Value> playerStatus_; //!< List of the states for each player, with the Player-pointer as key.
     100            std::map<const PlayerInfo*, QuestHintStatus> playerStatus_; //!< List of the states for each player, with the Player-pointer as key.
    104101
    105102    }; // tolua_export
  • code/trunk/src/modules/questsystem/QuestItem.h

    r9667 r11071  
    6363            virtual ~QuestItem();
    6464
    65             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestItem object through XML.
     65            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a QuestItem object through XML.
    6666
    6767            /**
  • code/trunk/src/modules/questsystem/QuestListener.cc

    r9667 r11071  
    5959
    6060        this->mode_ = QuestListenerMode::All;
    61         this->quest_ = NULL;
     61        this->quest_ = nullptr;
    6262    }
    6363
     
    8181        XMLPortParam(QuestListener, "mode", setMode, getMode, xmlelement, mode);
    8282
    83         if(this->quest_ != NULL)
     83        if(this->quest_ != nullptr)
    8484            this->quest_->addListener(this); // Adds the QuestListener to the Quests list of listeners.
    8585
     
    9797    /* static */ void QuestListener::advertiseStatusChange(std::list<QuestListener*> & listeners, const std::string & status)
    9898    {
    99         for (std::list<QuestListener*>::iterator it = listeners.begin(); it != listeners.end(); ++it) // Iterate through all QuestListeners
    100         {
    101             QuestListener* listener = *it;
     99        for (QuestListener* listener : listeners) // Iterate through all QuestListeners
     100        {
    102101            if(listener->getMode() == status || listener->getMode() == QuestListener::ALL) // Check whether the status change affects the give QuestListener.
    103102                listener->execute();
     
    117116        this->quest_ = QuestManager::getInstance().findQuest(id); // Find the Quest corresponding to the given questId.
    118117
    119         if(this->quest_ == NULL) // If there is no such Quest.
     118        if(this->quest_ == nullptr) // If there is no such Quest.
    120119        {
    121120            ThrowException(Argument, "This is bad! The QuestListener has not found a Quest with a corresponding id..");
  • code/trunk/src/modules/questsystem/QuestListener.h

    r9667 r11071  
    5050    @ingroup Questsystem
    5151    */
    52     namespace QuestListenerMode
     52    enum class QuestListenerMode
    5353    {
    54         enum Value
    55         {
    56             All, //!< Listens to all events.
    57             Start, //!< Only listens to events pertaining the starting of @ref orxonox::Quest "Quests".
    58             Fail, //!< Only listens to events pertaining the failing of @ref orxonox::Quest "Quests".
    59             Complete //!< Only listens to events pertaining the completing of @ref orxonox::Quest "Quests".
    60         };
    61     }
     54        All, //!< Listens to all events.
     55        Start, //!< Only listens to events pertaining the starting of @ref orxonox::Quest "Quests".
     56        Fail, //!< Only listens to events pertaining the failing of @ref orxonox::Quest "Quests".
     57        Complete //!< Only listens to events pertaining the completing of @ref orxonox::Quest "Quests".
     58    };
    6259
    6360    /**
     
    9087            virtual ~QuestListener();
    9188
    92             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestListener object through XML.
     89            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a QuestListener object through XML.
    9390
    9491            static void advertiseStatusChange(std::list<QuestListener*> & listeners, const std::string & status); //!< Makes all QuestListener in the list aware that a certain status change has occured.
     
    103100
    104101        private:
    105             QuestListenerMode::Value mode_; //!< The mode of the QuestListener.
     102            QuestListenerMode mode_; //!< The mode of the QuestListener.
    106103            Quest* quest_; //!< A pointer to the Quest the QuestListener is reacting to.
    107104
  • code/trunk/src/modules/questsystem/QuestManager.cc

    r10624 r11071  
    9393    bool QuestManager::registerQuest(Quest* quest)
    9494    {
    95         if(quest == NULL)
    96         {
    97             orxout(internal_error, context::quests) << "Quest pointer is NULL." << endl;
     95        if(quest == nullptr)
     96        {
     97            orxout(internal_error, context::quests) << "Quest pointer is nullptr." << endl;
    9898            return false;
    9999        }
     
    135135    bool QuestManager::registerHint(QuestHint* hint)
    136136    {
    137         if(hint == NULL)
    138         {
    139             orxout(internal_error, context::quests) << "Quest pointer is NULL." << endl;
     137        if(hint == nullptr)
     138        {
     139            orxout(internal_error, context::quests) << "Quest pointer is nullptr." << endl;
    140140            return false;
    141141        }
     
    173173    @return
    174174        Returns a pointer to the Quest with the input id.
    175         Returns NULL if there is no Quest with the given questId.
     175        Returns nullptr if there is no Quest with the given questId.
    176176    @throws
    177177        Throws an exception if the given questId is invalid.
     
    188188        else
    189189        {
    190            quest = NULL;
     190           quest = nullptr;
    191191           orxout(internal_warning, context::quests) << "The quest with id {" << questId << "} is nowhere to be found." << endl;
    192192        }
     
    202202    @return
    203203        Returns a pointer to the QuestHint with the input id.
    204         Returns NULL if there is no QuestHint with the given hintId.
     204        Returns nullptr if there is no QuestHint with the given hintId.
    205205    @throws
    206206        Throws an exception if the given hintId is invalid.
     
    217217        else
    218218        {
    219            hint = NULL;
     219           hint = nullptr;
    220220           orxout(internal_warning, context::quests) << "The hint with id {" << hintId << "} is nowhere to be found." << endl;
    221221        }
     
    235235    {
    236236        int numQuests = 0;
    237         for(std::map<std::string, Quest*>::iterator it = this->questMap_.begin(); it != this->questMap_.end(); it++)
    238         {
    239             if(it->second->getParentQuest() == NULL && !it->second->isInactive(player))
     237        for(const auto& mapEntry : this->questMap_)
     238        {
     239            if(mapEntry.second->getParentQuest() == nullptr && !mapEntry.second->isInactive(player))
    240240                numQuests++;
    241241        }
     
    255255    Quest* QuestManager::getRootQuest(PlayerInfo* player, int index)
    256256    {
    257         for(std::map<std::string, Quest*>::iterator it = this->questMap_.begin(); it != this->questMap_.end(); it++)
    258         {
    259             if(it->second->getParentQuest() == NULL && !it->second->isInactive(player) && index-- == 0)
    260                 return it->second;
    261         }
    262         return NULL;
     257        for(const auto& mapEntry : this->questMap_)
     258        {
     259            if(mapEntry.second->getParentQuest() == nullptr && !mapEntry.second->isInactive(player) && index-- == 0)
     260                return mapEntry.second;
     261        }
     262        return nullptr;
    263263    }
    264264
     
    275275    int QuestManager::getNumSubQuests(Quest* quest, PlayerInfo* player)
    276276    {
    277         if(quest == NULL)
     277        if(quest == nullptr)
    278278            return this->getNumRootQuests(player);
    279279
    280280        std::list<Quest*> quests = quest->getSubQuestList();
    281281        int numQuests = 0;
    282         for(std::list<Quest*>::iterator it = quests.begin(); it != quests.end(); it++)
    283         {
    284             if(!(*it)->isInactive(player))
     282        for(Quest* subquest : quests)
     283        {
     284            if(!subquest->isInactive(player))
    285285                numQuests++;
    286286        }
     
    300300    Quest* QuestManager::getSubQuest(Quest* quest, PlayerInfo* player, int index)
    301301    {
    302         if(quest == NULL)
     302        if(quest == nullptr)
    303303            return this->getRootQuest(player, index);
    304304
    305305        std::list<Quest*> quests = quest->getSubQuestList();
    306         for(std::list<Quest*>::iterator it = quests.begin(); it != quests.end(); it++)
    307         {
    308             if(!(*it)->isInactive(player) && index-- == 0)
    309                 return *it;
    310         }
    311         return NULL;
     306        for(Quest* subquest : quests)
     307        {
     308            if(!subquest->isInactive(player) && index-- == 0)
     309                return quest;
     310        }
     311        return nullptr;
    312312    }
    313313
     
    326326        std::list<QuestHint*> hints = quest->getHintsList();
    327327        int numHints = 0;
    328         for(std::list<QuestHint*>::iterator it = hints.begin(); it != hints.end(); it++)
    329         {
    330             if((*it)->isActive(player))
     328        for(QuestHint* hint : hints)
     329        {
     330            if(hint->isActive(player))
    331331                numHints++;
    332332        }
     
    349349    {
    350350        std::list<QuestHint*> hints = quest->getHintsList();
    351         for(std::list<QuestHint*>::iterator it = hints.begin(); it != hints.end(); it++)
    352         {
    353             if((*it)->isActive(player) && index-- == 0)
    354                 return *it;
    355         }
    356         return NULL;
     351        for(QuestHint* hint : hints)
     352        {
     353            if(hint->isActive(player) && index-- == 0)
     354                return hint;
     355        }
     356        return nullptr;
    357357    }
    358358
     
    367367    Quest* QuestManager::getParentQuest(Quest* quest)
    368368    {
    369         OrxAssert(quest, "The input Quest is NULL.");
     369        OrxAssert(quest, "The input Quest is nullptr.");
    370370        return quest->getParentQuest();
    371371    }
     
    381381    QuestDescription* QuestManager::getDescription(Quest* item)
    382382    {
    383         OrxAssert(item, "The input Quest is NULL.");
     383        OrxAssert(item, "The input Quest is nullptr.");
    384384        return item->getDescription();
    385385    }
     
    395395    QuestDescription* QuestManager::getDescription(QuestHint* item)
    396396    {
    397         OrxAssert(item, "The input QuestHint is NULL.");
     397        OrxAssert(item, "The input QuestHint is nullptr.");
    398398        return item->getDescription();
    399399    }
     
    409409    const std::string QuestManager::getId(Quest* item) const
    410410    {
    411         OrxAssert(item, "The input Quest is NULL.");
     411        OrxAssert(item, "The input Quest is nullptr.");
    412412        return item->getId();
    413413    }
     
    423423    const std::string QuestManager::getId(QuestHint* item) const
    424424    {
    425         OrxAssert(item, "The input QuestHint is NULL.");
     425        OrxAssert(item, "The input QuestHint is nullptr.");
    426426        return item->getId();
    427427    }
     
    440440    {
    441441        PlayerInfo* player = GUIManager::getInstance().getPlayer(guiName);
    442         if(player == NULL)
     442        if(player == nullptr)
    443443        {
    444444            orxout(internal_error, context::quests) << "GUIOverlay with name '" << guiName << "' has no player." << endl;
    445             return NULL;
     445            return nullptr;
    446446        }
    447447
  • code/trunk/src/modules/questsystem/effects/AddQuest.cc

    r9667 r11071  
    9090        {
    9191            Quest* quest = QuestManager::getInstance().findQuest(this->getQuestId());
    92             if(quest == NULL || !quest->start(player))
     92            if(quest == nullptr || !quest->start(player))
    9393               return false;
    9494        }
  • code/trunk/src/modules/questsystem/effects/AddQuest.h

    r9667 r11071  
    6262        virtual ~AddQuest();
    6363
    64         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddQuest object through XML.
     64        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a AddQuest object through XML.
    6565
    66         virtual bool invoke(PlayerInfo* player); //!< Invokes the QuestEffect.
     66        virtual bool invoke(PlayerInfo* player) override; //!< Invokes the QuestEffect.
    6767
    6868    };
  • code/trunk/src/modules/questsystem/effects/AddQuestHint.cc

    r9667 r11071  
    113113        {
    114114            QuestHint* hint = QuestManager::getInstance().findHint(this->hintId_);
    115             if(hint == NULL || !hint->setActive(player))
     115            if(hint == nullptr || !hint->setActive(player))
    116116                return false;
    117117        }
  • code/trunk/src/modules/questsystem/effects/AddQuestHint.h

    r9667 r11071  
    6464            virtual ~AddQuestHint();
    6565
    66             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddQuestHint object through XML.
     66            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a AddQuestHint object through XML.
    6767
    68             virtual bool invoke(PlayerInfo* player); //!< Invokes the QuestEffect.
     68            virtual bool invoke(PlayerInfo* player) override; //!< Invokes the QuestEffect.
    6969
    7070        private:
  • code/trunk/src/modules/questsystem/effects/AddReward.cc

    r9667 r11071  
    8484    {
    8585        int i = index;
    86         for (std::list<Rewardable*>::const_iterator reward = this->rewards_.begin(); reward != this->rewards_.end(); ++reward)
     86        for (Rewardable* reward : this->rewards_)
    8787        {
    8888            if(i == 0)
    89                return *reward;
     89               return reward;
    9090            i--;
    9191        }
    92         return NULL;
     92        return nullptr;
    9393    }
    9494
     
    106106
    107107        bool temp = true;
    108         for ( std::list<Rewardable*>::iterator reward = this->rewards_.begin(); reward != this->rewards_.end(); ++reward )
    109             temp = temp && (*reward)->reward(player);
     108        for (Rewardable* reward : this->rewards_)
     109            temp = temp && reward->reward(player);
    110110
    111111        orxout(verbose, context::quests) << "Rewardable successfully added to player." << player << " ." << endl;
  • code/trunk/src/modules/questsystem/effects/AddReward.h

    r9667 r11071  
    6868            virtual ~AddReward();
    6969
    70             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddReward object through XML.
     70            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a AddReward object through XML.
    7171
    72             virtual bool invoke(PlayerInfo* player); //!< Invokes the QuestEffect.
     72            virtual bool invoke(PlayerInfo* player) override; //!< Invokes the QuestEffect.
    7373
    7474        private:
  • code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.h

    r9667 r11071  
    5959            virtual ~ChangeQuestStatus();
    6060
    61             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a ChangeQuestStatus object through XML.
     61            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a ChangeQuestStatus object through XML.
    6262
    6363            virtual bool invoke(PlayerInfo* player) = 0; //!< Invokes the QuestEffect.
  • code/trunk/src/modules/questsystem/effects/CompleteQuest.cc

    r9667 r11071  
    9292        {
    9393            quest = QuestManager::getInstance().findQuest(this->getQuestId());
    94             if(quest == NULL || !quest->complete(player))
     94            if(quest == nullptr || !quest->complete(player))
    9595               return false;
    9696        }
  • code/trunk/src/modules/questsystem/effects/CompleteQuest.h

    r9667 r11071  
    6262            virtual ~CompleteQuest();
    6363
    64             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a CompleteQuest object through XML.
     64            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a CompleteQuest object through XML.
    6565
    66             virtual bool invoke(PlayerInfo* player); //!< Invokes the QuestEffect.
     66            virtual bool invoke(PlayerInfo* player) override; //!< Invokes the QuestEffect.
    6767
    6868    };
  • code/trunk/src/modules/questsystem/effects/FailQuest.cc

    r9667 r11071  
    9191        {
    9292            quest = QuestManager::getInstance().findQuest(this->getQuestId());
    93             if(quest == NULL || !quest->fail(player))
     93            if(quest == nullptr || !quest->fail(player))
    9494               return false;
    9595        }
  • code/trunk/src/modules/questsystem/effects/FailQuest.h

    r9667 r11071  
    6262            virtual ~FailQuest();
    6363
    64             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a FailQuest object through XML.
     64            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a FailQuest object through XML.
    6565
    66             virtual bool invoke(PlayerInfo* player); //!< Invokes the QuestEffect.
     66            virtual bool invoke(PlayerInfo* player) override; //!< Invokes the QuestEffect.
    6767
    6868    };
  • code/trunk/src/modules/tetris/Tetris.cc

    r10624 r11071  
    6666        RegisterObject(Tetris);
    6767
    68         this->activeBrick_ = 0;
     68        this->activeBrick_ = nullptr;
    6969
    7070        // Pre-set the timer, but don't start it yet.
     
    7272        this->starttimer_.stopTimer();
    7373
    74         this->player_ = NULL;
     74        this->player_ = nullptr;
    7575        this->setHUDTemplate("TetrisHUD");
    76         this->futureBrick_ = 0;
     76        this->futureBrick_ = nullptr;
    7777    }
    7878
     
    9696        {
    9797            this->activeBrick_->destroy();
    98             this->activeBrick_ = 0;
     98            this->activeBrick_ = nullptr;
    9999        }
    100100        if (this->futureBrick_)
    101101        {
    102102            this->futureBrick_->destroy();
    103             this->futureBrick_ = 0;
    104         }
    105 
    106         for (std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
    107             (*it)->destroy();
     103            this->futureBrick_ = nullptr;
     104        }
     105
     106        for (TetrisStone* stone : this->stones_)
     107            stone->destroy();
    108108        this->stones_.clear();
    109109    }
     
    113113        SUPER(Tetris, tick, dt);
    114114
    115         if((this->activeBrick_ != NULL)&&(!this->hasEnded()))
     115        if((this->activeBrick_ != nullptr)&&(!this->hasEnded()))
    116116        {
    117117            if(!this->isValidBrickPosition(this->activeBrick_))
     
    136136            return false;
    137137
    138         for(std::list<StrongPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
    139         {
    140             const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
     138        for(TetrisStone* someStone : this->stones_)
     139        {
     140            const Vector3& currentStonePosition = someStone->getPosition(); //!< Saves the position of the currentStone
    141141
    142142            if((position.x == currentStonePosition.x) && abs(position.y-currentStonePosition.y) < this->center_->getStoneSize())
     
    192192
    193193        // check for collisions with all stones
    194         for(std::list<StrongPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
     194        for(TetrisStone* someStone : this->stones_)
    195195        {
    196196            //Vector3 currentStonePosition = rotateVector((*it)->getPosition(), this->activeBrick_->getRotationCount());
    197             const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
     197            const Vector3& currentStonePosition = someStone->getPosition(); //!< Saves the position of the currentStone
    198198
    199199            //filter out cases where the falling stone is already below a steady stone
     
    290290    void Tetris::start()
    291291    {
    292         if (this->center_ != NULL) // There needs to be a TetrisCenterpoint, i.e. the area the game takes place.
     292        if (this->center_ != nullptr) // There needs to be a TetrisCenterpoint, i.e. the area the game takes place.
    293293        {
    294294            // Create the first brick.
     
    323323    {
    324324        this->activeBrick_->setVelocity(Vector3::ZERO);
    325         if(this->activeBrick_ != NULL)
     325        if(this->activeBrick_ != nullptr)
    326326        {
    327327            this->player_->stopControl();
     
    341341    {
    342342        // Spawn a human player.
    343         for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    344             if (it->first->isHumanPlayer() && (it->first->isReadyToSpawn() || this->bForceSpawn_))
    345                 this->spawnPlayer(it->first);
     343        for (const auto& mapEntry : this->players_)
     344            if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
     345                this->spawnPlayer(mapEntry.first);
    346346    }
    347347   
     
    351351        if(player && player->isHumanPlayer())
    352352        {
    353             if(this->activeBrick_ != NULL)
     353            if(this->activeBrick_ != nullptr)
    354354            {
    355355                this->player_->stopControl();
     
    370370        assert(player);
    371371
    372         if(this->player_ == NULL)
     372        if(this->player_ == nullptr)
    373373        {
    374374            this->player_ = player;
     
    381381    void Tetris::startBrick(void)
    382382    {
    383         if(this->player_ == NULL)
     383        if(this->player_ == nullptr)
    384384            return;
    385385
    386386        unsigned int cameraIndex = 0;
    387         if(this->activeBrick_ != NULL)
     387        if(this->activeBrick_ != nullptr)
    388388        {
    389389            // Get camera settings
     
    396396        // Make the last brick to be created the active brick.
    397397        this->activeBrick_ = this->futureBrick_;
    398         this->futureBrick_ = 0;
     398        this->futureBrick_ = nullptr;
    399399
    400400        // set its position
     
    437437        Get the player.
    438438    @return
    439         Returns a pointer to the player. If there is no player, NULL is returned.
     439        Returns a pointer to the player. If there is no player, nullptr is returned.
    440440    */
    441441    PlayerInfo* Tetris::getPlayer(void) const
     
    469469        {
    470470            stonesPerRow = 0;
    471             for(std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
    472             {
    473                 std::list<StrongPtr<TetrisStone> >::iterator it_temp = it++;
     471            for(std::list<StrongPtr<TetrisStone>>::iterator it = this->stones_.begin(); it != this->stones_.end(); )
     472            {
     473                std::list<StrongPtr<TetrisStone>>::iterator it_temp = it++;
    474474                correctPosition = static_cast<unsigned int>(((*it_temp)->getPosition().y - 5)/this->center_->getStoneSize());
    475475                if(correctPosition == row)
     
    491491    void Tetris::clearRow(unsigned int row)
    492492    {// clear the full row
    493         for(std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
     493        for(std::list<StrongPtr<TetrisStone>>::iterator it = this->stones_.begin(); it != this->stones_.end(); )
    494494        {
    495495            if(static_cast<unsigned int>(((*it)->getPosition().y - 5)/this->center_->getStoneSize()) == row)
     
    502502        }
    503503      // adjust height of stones above the deleted row //TODO: check if this could be a source of a bug.
    504         for(std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
    505         {
    506             if(static_cast<unsigned int>(((*it)->getPosition().y - 5)/this->center_->getStoneSize()) > row)
    507                 (*it)->setPosition((*it)->getPosition()-Vector3(0,10,0));
     504        for(TetrisStone* stone : this->stones_)
     505        {
     506            if(static_cast<unsigned int>((stone->getPosition().y - 5)/this->center_->getStoneSize()) > row)
     507                stone->setPosition(stone->getPosition()-Vector3(0,10,0));
    508508        }
    509509
  • code/trunk/src/modules/tetris/Tetris.h

    r10624 r11071  
    5858            virtual ~Tetris(); //!< Destructor. Cleans up, if initialized.
    5959
    60             virtual void start(void); //!< Starts the Tetris minigame.
    61             virtual void end(void); ///!< Ends the Tetris minigame.
     60            virtual void start(void) override; //!< Starts the Tetris minigame.
     61            virtual void end(void) override; ///!< Ends the Tetris minigame.
    6262
    63             virtual void tick(float dt);
     63            virtual void tick(float dt) override;
    6464
    65             virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player.
    66             virtual bool playerLeft(PlayerInfo* player);
     65            virtual void spawnPlayer(PlayerInfo* player) override; //!< Spawns the input player.
     66            virtual bool playerLeft(PlayerInfo* player) override;
    6767
    6868            void setCenterpoint(TetrisCenterpoint* center);
     
    7777
    7878        protected:
    79             virtual void spawnPlayersIfRequested(); //!< Spawns player.
     79            virtual void spawnPlayersIfRequested() override; //!< Spawns player.
    8080
    8181
     
    9393
    9494            WeakPtr<TetrisCenterpoint> center_; //!< The playing field.
    95             std::list<StrongPtr<TetrisStone> > stones_; //!< A list of all stones in play.
     95            std::list<StrongPtr<TetrisStone>> stones_; //!< A list of all stones in play.
    9696            WeakPtr<TetrisBrick> activeBrick_;
    9797            WeakPtr<TetrisBrick> futureBrick_;
  • code/trunk/src/modules/tetris/TetrisBrick.cc

    r10624 r11071  
    8181            this->attach(stone);
    8282            this->formBrick(stone, i);
    83             if(this->tetris_ != NULL)
     83            if(this->tetris_ != nullptr)
    8484            {
    8585                stone->setGame(this->tetris_);
    86                 if(this->tetris_->getCenterpoint() != NULL)
     86                if(this->tetris_->getCenterpoint() != nullptr)
    8787                    stone->addTemplate(this->tetris_->getCenterpoint()->getStoneTemplate());
    8888                else
    89                     orxout()<< "tetris_->getCenterpoint == NULL in TetrisBrick.cc"<< endl;
     89                    orxout()<< "tetris_->getCenterpoint == nullptr in TetrisBrick.cc"<< endl;
    9090            }
    9191            else
    92                 orxout()<< "tetris_ == NULL in TetrisBrick.cc"<< endl;
     92                orxout()<< "tetris_ == nullptr in TetrisBrick.cc"<< endl;
    9393        }
    9494    }
     
    161161        if(i < this->brickStones_.size())
    162162            return this->brickStones_[i];
    163         else return NULL;
     163        else return nullptr;
    164164    }
    165165
     
    167167    Tetris* TetrisBrick::getTetris()
    168168    {
    169         if (this->getGametype() != NULL && this->getGametype()->isA(Class(Tetris)))
     169        if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Tetris)))
    170170        {
    171171            Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype());
    172172            return tetrisGametype;
    173173        }
    174         return NULL;
     174        return nullptr;
    175175    }
    176176
     
    239239    {
    240240        assert(this->tetris_);
    241         for(unsigned int i = 0; i < this->brickStones_.size(); i++)
    242         {
    243             this->brickStones_[i]->detachFromParent();
    244             this->brickStones_[i]->attachToParent(center);
    245             this->brickStones_[i]->setPosition(this->getPosition()+this->tetris_->rotateVector(this->brickStones_[i]->getPosition(),this->rotationCount_ ));
     241        for(TetrisStone* stone : this->brickStones_)
     242        {
     243            stone->detachFromParent();
     244            stone->attachToParent(center);
     245            stone->setPosition(this->getPosition()+this->tetris_->rotateVector(stone->getPosition(),this->rotationCount_ ));
    246246        }
    247247        this->brickStones_.clear();
  • code/trunk/src/modules/tetris/TetrisBrick.h

    r10262 r11071  
    5757            virtual ~TetrisBrick() {}
    5858
    59             virtual void moveFrontBack(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
    60             virtual void moveRightLeft(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
    61             virtual void changedPlayer(); //!< Is called when the player changed.
     59            virtual void moveFrontBack(const Vector2& value) override; //!< Overloaded the function to steer the bat up and down.
     60            virtual void moveRightLeft(const Vector2& value) override; //!< Overloaded the function to steer the bat up and down.
     61            virtual void changedPlayer() override; //!< Is called when the player changed.
    6262
    6363            bool isValidMove(const Vector3& position, bool isRotation);
  • code/trunk/src/modules/tetris/TetrisCenterpoint.cc

    r10624 r11071  
    8484    void TetrisCenterpoint::checkGametype()
    8585    {
    86         if (this->getGametype() != NULL && this->getGametype()->isA(Class(Tetris)))
     86        if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Tetris)))
    8787        {
    8888            Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype());
  • code/trunk/src/modules/tetris/TetrisCenterpoint.h

    r10624 r11071  
    6262            virtual ~TetrisCenterpoint() {}
    6363
    64             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method to create a TetrisCenterpoint through XML.
     64            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method to create a TetrisCenterpoint through XML.
    6565
    6666            /**
  • code/trunk/src/modules/tetris/TetrisScore.cc

    r10624 r11071  
    3636
    3737#include "core/CoreIncludes.h"
    38 #include "core/XMLPort.h"
    3938#include "util/Convert.h"
    4039
     
    5655        RegisterObject(TetrisScore);
    5756
    58         this->owner_ = 0;
    59         this->player_ = NULL;
     57        this->owner_ = nullptr;
     58        this->player_ = nullptr;
    6059    }
    6160
     
    6665    TetrisScore::~TetrisScore()
    6766    {
    68     }
    69 
    70     /**
    71     @brief
    72         Method to create a TetrisScore through XML.
    73     */
    74     void TetrisScore::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    75     {
    76         SUPER(TetrisScore, XMLPort, xmlelement, mode);
    7767    }
    7868
     
    8979
    9080        // If the owner is set. The owner being a Tetris game.
    91         if (this->owner_ != NULL)
     81        if (this->owner_ != nullptr)
    9282        {
    9383            std::string score("0");
     
    10191            {
    10292                // Save the name and score of each player as a string.
    103                 if (player_ != NULL)
     93                if (player_ != nullptr)
    10494                    score = multi_cast<std::string>(this->owner_->getScore(player_));
    10595            }
     
    111101    @brief
    112102        Is called when the owner changes.
    113         Sets the owner to NULL, if it is not a pointer to a Tetris game.
     103        Sets the owner to nullptr, if it is not a pointer to a Tetris game.
    114104    */
    115105    void TetrisScore::changedOwner()
     
    117107        SUPER(TetrisScore, changedOwner);
    118108
    119         if (this->getOwner() != NULL && this->getOwner()->getGametype())
     109        if (this->getOwner() != nullptr && this->getOwner()->getGametype())
    120110            this->owner_ = orxonox_cast<Tetris*>(this->getOwner()->getGametype());
    121111        else
    122             this->owner_ = 0;
     112            this->owner_ = nullptr;
    123113    }
    124114}
  • code/trunk/src/modules/tetris/TetrisScore.h

    r10262 r11071  
    6060            virtual ~TetrisScore();
    6161
    62             virtual void tick(float dt); //!< Creates and sets the caption to be displayed by the TetrisScore.
    63             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    64             virtual void changedOwner(); //!< Is called when the owner changes.
     62            virtual void tick(float dt) override; //!< Creates and sets the caption to be displayed by the TetrisScore.
     63            virtual void changedOwner() override; //!< Is called when the owner changes.
    6564
    6665        private:
  • code/trunk/src/modules/towerdefense/TowerDefense.cc

    r10727 r11071  
    9090        RegisterObject(TowerDefense);
    9191
    92         selecter = NULL;
    93         this->player_ = NULL;       
     92        selecter = nullptr;
     93        this->player_ = nullptr;
    9494        this->setHUDTemplate("TowerDefenseHUD");
    9595        this->waveNumber_ = 0;
     
    117117    void TowerDefense::start()
    118118    {       
    119         if (center_ != NULL) // There needs to be a TowerDefenseCenterpoint, i.e. the area the game takes place.
    120         {
    121             if (selecter == NULL)
     119        if (center_ != nullptr) // There needs to be a TowerDefenseCenterpoint, i.e. the area the game takes place.
     120        {
     121            if (selecter == nullptr)
    122122            {
    123123                selecter = new TowerDefenseSelecter(this->center_->getContext());               
     
    176176        WaypointController* controller = (WaypointController*)(en1->getXMLController());
    177177
    178         if (controller != NULL && waypoints_.size() > 1)
     178        if (controller != nullptr && waypoints_.size() > 1)
    179179        {
    180180            en1->setPosition(waypoints_.at(0)->getPosition() + offset_);
     
    183183            en1->lookAt(waypoints_.at(1)->getPosition() + offset_);
    184184
    185             for (unsigned int i = 0; i < waypoints_.size(); ++ i)
     185            for (TowerDefenseField* field : waypoints_)
    186186            {
    187187                orxonox::WeakPtr<MovableEntity> waypoint = new MovableEntity(this->center_->getContext());
    188                 waypoint->setPosition(waypoints_.at(i)->getPosition() + offset_);
     188                waypoint->setPosition(field->getPosition() + offset_);
    189189                controller->addWaypoint(waypoint);
    190190            }
     
    208208        player_ = player;
    209209
    210         if (selecter->getPlayer() == NULL)
     210        if (selecter->getPlayer() == nullptr)
    211211        {
    212212            player_->startControl(selecter);
     
    219219        Get the player.
    220220    @return
    221         Returns a pointer to the player. If there is no player, NULL is returned.
     221        Returns a pointer to the player. If there is no player, nullptr is returned.
    222222    */
    223223    PlayerInfo* TowerDefense::getPlayer(void) const
     
    265265        SUPER(TowerDefense, tick, dt);
    266266
    267         if (hasStarted() == false || player_ == NULL)
     267        if (hasStarted() == false || player_ == nullptr)
    268268        {
    269269            return;
     
    273273
    274274        //build/upgrade tower at selecter position
    275         if (selecter != NULL && selecter->buildTower_ == true)
     275        if (selecter != nullptr && selecter->buildTower_ == true)
    276276        {
    277277            selecter->buildTower_ = false;
     
    287287        }
    288288       
    289         for (std::list<WeakPtr<TowerDefenseEnemy> >::iterator it = enemies_.begin(); it != enemies_.end(); )
    290         {
    291             if (*it == NULL)
     289        for (std::list<WeakPtr<TowerDefenseEnemy>>::iterator it = enemies_.begin(); it != enemies_.end(); )
     290        {
     291            if (*it == nullptr)
    292292            {
    293293                // the enemy was destroyed by a tower - remove it from the list
     
    355355                fields_[i][j]->create(fields.at(pos), fields.at(pos+1));
    356356                pos += 2;
    357                 if (fields_[i][j]->getType() == START)
     357                if (fields_[i][j]->getType() == TowerDefenseFieldType::START)
    358358                {
    359359                    startCoord.Set(i,j);
     
    365365        TDCoordinate* thisCoord = &startCoord;
    366366        TDCoordinate* nextCoord;
    367         while ((nextCoord = getNextStreetCoord(thisCoord)) != NULL)
     367        while ((nextCoord = getNextStreetCoord(thisCoord)) != nullptr)
    368368        {
    369369            waypoints_.push_back(fields_[nextCoord->GetX()][nextCoord->GetY()]);           
     
    379379        TDCoordinate* nextCoord = new TDCoordinate(0,0);
    380380
    381         if (thisField->getType() != STREET && thisField->getType() != START)
    382         {
    383             return NULL;
     381        if (thisField->getType() != TowerDefenseFieldType::STREET && thisField->getType() != TowerDefenseFieldType::START)
     382        {
     383            return nullptr;
    384384        }
    385385
     
    406406        }
    407407
    408         return NULL;
     408        return nullptr;
    409409    }
    410410}
  • code/trunk/src/modules/towerdefense/TowerDefense.h

    r10629 r11071  
    5353        virtual ~TowerDefense();       
    5454        void addTowerDefenseEnemy(int templatenr);
    55         virtual void start(); //<! The function is called when the gametype starts
    56         virtual void end();
    57         virtual void tick(float dt);
    58         virtual void spawnPlayer(PlayerInfo* player);
     55        virtual void start() override; //<! The function is called when the gametype starts
     56        virtual void end() override;
     57        virtual void tick(float dt) override;
     58        virtual void spawnPlayer(PlayerInfo* player) override;
    5959        PlayerInfo* getPlayer(void) const;
    6060        int getCredit(){ return this->credit_; }
     
    8787        int waveNumber_;
    8888        int lifes_;
    89         std::list<orxonox::WeakPtr<TowerDefenseEnemy> > enemies_;
     89        std::list<orxonox::WeakPtr<TowerDefenseEnemy>> enemies_;
    9090        TowerDefenseField* fields_[16][16];
    91         std::vector<orxonox::WeakPtr<TowerDefenseField> > waypoints_;
     91        std::vector<orxonox::WeakPtr<TowerDefenseField>> waypoints_;
    9292        Vector3 endpoint_;
    9393        Vector3 offset_;       
  • code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.cc

    r10629 r11071  
    9292    void TowerDefenseCenterpoint::checkGametype()
    9393    {
    94         if (this->getGametype() != NULL && this->getGametype()->isA(Class(TowerDefense)))
     94        if (this->getGametype() != nullptr && this->getGametype()->isA(Class(TowerDefense)))
    9595        {
    9696            // Sets the centerpoint of the gametype. The gametype uses this to later spawn in towers, he needs the tower template stored in the center point
  • code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.h

    r10629 r11071  
    5252            virtual ~TowerDefenseCenterpoint() {}
    5353
    54             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     54            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    5555
    5656            /**
  • code/trunk/src/modules/towerdefense/TowerDefenseEnemy.cc

    r10629 r11071  
    2727        RegisterObject(TowerDefenseEnemy);
    2828
    29         this->setCollisionType(WorldEntity::Dynamic);
     29        this->setCollisionType(WorldEntity::CollisionType::Dynamic);
    3030        //needed to keep track of the PlayerStats coded in TowerDefense.h
    3131        this->td = orxonox_cast<TowerDefense*>(this->getGametype());
     
    3838    }
    3939
    40     void TowerDefenseEnemy::tick(float dt)
    41     {   
    42         //orxout() << "TDE tick1" << endl;
    43         SUPER(TowerDefenseEnemy, tick, dt);
    44         //orxout() << "TDE tick2" << endl;
    45     }
    46 
    4740    WeakPtr<TowerDefense> TowerDefenseEnemy::getGame()
    4841    {
    49         if (game == NULL)
     42        if (game == nullptr)
    5043        {
    51             for (ObjectList<TowerDefense>::iterator it = ObjectList<TowerDefense>::begin(); it != ObjectList<TowerDefense>::end(); ++it)
    52                 game = *it;
     44            for (TowerDefense* towerDefense : ObjectList<TowerDefense>())
     45                game = towerDefense;
    5346        }
    5447        return game;
    5548    }
    5649
    57     void TowerDefenseEnemy::damage(float damage, float healthdamage, float shielddamage, Pawn* originator)
     50    void TowerDefenseEnemy::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs)
    5851    {
    5952        Pawn::damage(damage, healthdamage, shielddamage, originator);
  • code/trunk/src/modules/towerdefense/TowerDefenseEnemy.h

    r10629 r11071  
    3737        //health gibt es unter: health_
    3838
    39         virtual void tick(float dt);
    40         virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator);
     39        virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) override;
    4140
    4241    private:
  • code/trunk/src/modules/towerdefense/TowerDefenseField.cc

    r11052 r11071  
    4949        RegisterObject(TowerDefenseField);
    5050
    51         tower_ = NULL;
    52         type_ = FREE;
    53         center_ = NULL;
     51        tower_ = nullptr;
     52        type_ = TowerDefenseFieldType::FREE;
     53        center_ = nullptr;
    5454        upgrade_ = 0;
    5555        setPosition(0,0,0);                           
     
    119119    bool TowerDefenseField::canUpgrade()
    120120    {
    121         if (tower_ != NULL && upgrade_ < 5)
     121        if (tower_ != nullptr && upgrade_ < 5)
    122122        {
    123123            return true;
     
    129129    void TowerDefenseField::setAngle(int newAngle)
    130130    {
    131         if (modelGround_ != NULL)
     131        if (modelGround_ != nullptr)
    132132        {
    133133            switch (newAngle)
     
    152152        }
    153153
    154         if (modelObject_ != NULL)
     154        if (modelObject_ != nullptr)
    155155        {
    156156            switch (newAngle)
     
    185185    {           
    186186        modelGround_->setMeshSource("TD_F1.mesh");
    187         tower_ = NULL;
    188         type_ = FREE;
     187        tower_ = nullptr;
     188        type_ = TowerDefenseFieldType::FREE;
    189189        setUpgrade(0);
    190190        setAngle(orientation);
     
    194194    {     
    195195        modelGround_->setMeshSource("TD_S5.mesh");
    196         tower_ = NULL;
    197         type_ = START;
     196        tower_ = nullptr;
     197        type_ = TowerDefenseFieldType::START;
    198198        setUpgrade(0);
    199199        setAngle(orientation);   
     
    204204    {     
    205205        modelGround_->setMeshSource("TD_S4.mesh");
    206         tower_ = NULL;
    207         type_ = END;
     206        tower_ = nullptr;
     207        type_ = TowerDefenseFieldType::END;
    208208        setUpgrade(0);
    209209        setAngle(orientation);
     
    213213    {     
    214214        modelGround_->setMeshSource("TD_S1.mesh");
    215         tower_ = NULL;
    216         type_ = STREET;
     215        tower_ = nullptr;
     216        type_ = TowerDefenseFieldType::STREET;
    217217        setUpgrade(0);
    218218        setAngle(orientation);
     
    222222    {     
    223223        modelGround_->setMeshSource("TD_S2.mesh");
    224         tower_ = NULL;
    225         type_ = STREET;
     224        tower_ = nullptr;
     225        type_ = TowerDefenseFieldType::STREET;
    226226        setUpgrade(0);
    227227        setAngle(orientation);
     
    231231    {   
    232232        modelGround_->setMeshSource("TD_S3.mesh");
    233         tower_ = NULL;
    234         type_ = STREET;
     233        tower_ = nullptr;
     234        type_ = TowerDefenseFieldType::STREET;
    235235        setUpgrade(0);
    236236        setAngle(orientation);
     
    241241        modelGround_->setMeshSource("TD_F1.mesh");
    242242        modelObject_->setMeshSource("TD_O1.mesh");
    243         tower_ = NULL;
    244         type_ = OBSTACLE;
     243        tower_ = nullptr;
     244        type_ = TowerDefenseFieldType::OBSTACLE;
    245245        setUpgrade(0);
    246246        setAngle(orientation);
     
    249249    void TowerDefenseField::createTower(int upgrade)
    250250    {       
    251         if (tower_ == NULL)
     251        if (tower_ == nullptr)
    252252        {
    253253            modelGround_->setMeshSource("TD_F1.mesh");
    254254            tower_ = new TowerDefenseTower(center_->getContext());
    255255            attach(tower_);
    256             type_ = TOWER;
     256            type_ = TowerDefenseFieldType::TOWER;
    257257            setUpgrade(upgrade);
    258             if (upgrade_ > 0 && modelObject_ != NULL)
     258            if (upgrade_ > 0 && modelObject_ != nullptr)
    259259            {
    260260                switch (upgrade_)
     
    287287    void TowerDefenseField::destroyTower()
    288288    {
    289         if (tower_ != NULL)
     289        if (tower_ != nullptr)
    290290        {
    291291            tower_->destroy();
    292             tower_ = NULL;
     292            tower_ = nullptr;
    293293        }
    294294    }
  • code/trunk/src/modules/towerdefense/TowerDefenseField.h

    r11052 r11071  
    4646namespace orxonox
    4747{
    48     enum TowerDefenseFieldType
     48    enum class TowerDefenseFieldType
    4949    {
    5050        FREE,
     
    6262            TowerDefenseField(Context* context);
    6363            virtual ~TowerDefenseField() {}
    64             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     64            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    6565            const bool isFree() const
    66                 { return type_==FREE; }
     66                { return type_==TowerDefenseFieldType::FREE; }
    6767            virtual void create(char object, char param);
    6868            virtual void setCenterpoint(TowerDefenseCenterpoint* center);
  • code/trunk/src/modules/towerdefense/TowerDefenseHUDController.cc

    r10629 r11071  
    3939    {
    4040        RegisterObject(TowerDefenseHUDController);
    41         this->td = 0;
     41        this->td = nullptr;
    4242    }
    4343
     
    8989                    else
    9090                    {
    91                         this->td = 0;
     91                        this->td = nullptr;
    9292                    }
    9393                }
  • code/trunk/src/modules/towerdefense/TowerDefenseHUDController.h

    r10258 r11071  
    5353
    5454
    55         virtual void tick(float dt);
    56         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    57         virtual void changedOwner();
     55        virtual void tick(float dt) override;
     56        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     57        virtual void changedOwner() override;
    5858        void setShowlives(bool temp)
    5959            { this->showlives = temp; }
  • code/trunk/src/modules/towerdefense/TowerDefenseSelecter.cc

    r11052 r11071  
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "core/XMLPort.h"
    3837#include "graphics/Model.h"
    3938
     
    5958    {
    6059
    61     }
    62 
    63     void TowerDefenseSelecter::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    64     {
    65         SUPER(TowerDefenseSelecter, XMLPort, xmlelement, mode);
    6660    }
    6761
  • code/trunk/src/modules/towerdefense/TowerDefenseSelecter.h

    r10629 r11071  
    4141            TowerDefenseSelecter(Context* context); //!< Constructor. Registers and initializes the object.
    4242            virtual ~TowerDefenseSelecter();
    43             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);         
    44             virtual void tick(float dt);           
    45             virtual void moveFrontBack(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
    46             virtual void moveRightLeft(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
    47             virtual void rotateYaw(const Vector2& value);
    48             virtual void rotatePitch(const Vector2& value);
    49             virtual void rotateRoll(const Vector2& value);
     43            virtual void tick(float dt) override;           
     44            virtual void moveFrontBack(const Vector2& value) override; //!< Overloaded the function to steer the bat up and down.
     45            virtual void moveRightLeft(const Vector2& value) override; //!< Overloaded the function to steer the bat up and down.
     46            virtual void rotateYaw(const Vector2& value) override;
     47            virtual void rotatePitch(const Vector2& value) override;
     48            virtual void rotateRoll(const Vector2& value) override;
    5049            void fire(unsigned int firemode);
    51             virtual void fired(unsigned int firemode);
    52             virtual void boost(bool bBoost);
     50            virtual void fired(unsigned int firemode) override;
     51            virtual void boost(bool bBoost) override;
    5352            virtual void setSelectedPosition(TDCoordinate* newPos);
    5453            virtual void setSelectedPosition(int x, int y);
  • code/trunk/src/modules/towerdefense/TowerDefenseTower.cc

    r11052 r11071  
    2525    {
    2626        RegisterObject(TowerDefenseTower);
    27         game_ =NULL;
    28         this->setCollisionType(WorldEntity::None);
     27        game_ =nullptr;
     28        this->setCollisionType(WorldEntity::CollisionType::None);
    2929        upgrade = 1;
    3030
  • code/trunk/src/modules/weapons/IceGunFreezer.cc

    r11052 r11071  
    6363    /**
    6464    @brief
    65         The controlling happens here. This method defines what the controller has to do each tick.
    66     @param dt
    67         The duration of the tick.
    68     */
    69     void IceGunFreezer::tick(float dt)
    70     {
    71         SUPER(IceGunFreezer, tick, dt);
    72 
    73 
    74     }
    75 
    76     /**
    77     @brief
    7865        Sets the freeze time variable to the passed value.
    7966    */
     
    10188
    10289        // Check if the freezer is attached to a parent and check if the parent is a SpaceShip
    103         if (parent != NULL && parent->isA(Class(SpaceShip)))
     90        if (parent != nullptr && parent->isA(Class(SpaceShip)))
    10491        {
    10592            freezedSpaceShip_ = orxonox_cast<SpaceShip*>(parent);
     
    118105    void IceGunFreezer::stopFreezing()
    119106    {
    120         if (freezedSpaceShip_ != NULL && freezeFactor_ != 0.0)
     107        if (freezedSpaceShip_ != nullptr && freezeFactor_ != 0.0)
    121108        {
    122109            freezedSpaceShip_->addSpeedFactor(1/freezeFactor_);
  • code/trunk/src/modules/weapons/IceGunFreezer.h

    r11052 r11071  
    3737#include "weapons/WeaponsPrereqs.h"
    3838
    39 #include "tools/interfaces/Tickable.h"
    4039#include "worldentities/StaticEntity.h"
    4140#include "graphics/Model.h"
     
    5049    @ingroup Weapons
    5150    */
    52     class _WeaponsExport IceGunFreezer : public StaticEntity, public Tickable
     51    class _WeaponsExport IceGunFreezer : public StaticEntity
    5352    {
    5453        public:
    5554            IceGunFreezer(Context* context);
    5655            virtual ~IceGunFreezer();
    57             virtual void tick(float dt);
    5856            virtual void startFreezing();
    5957            virtual void stopFreezing();
  • code/trunk/src/modules/weapons/RocketController.cc

    r10258 r11071  
    3838#include "projectiles/SimpleRocket.h"
    3939#include "weaponmodes/SimpleRocketFire.h"
     40#include "core/CoreIncludes.h"
    4041
    4142namespace orxonox
  • code/trunk/src/modules/weapons/RocketController.h

    r9667 r11071  
    5555            virtual ~RocketController();
    5656
    57             virtual void tick(float dt);
     57            virtual void tick(float dt) override;
    5858            /**
    5959            @brief Get the rocket that is controlled by this controller.
  • code/trunk/src/modules/weapons/munitions/FusionMunition.cc

    r11052 r11071  
    3434#include "FusionMunition.h"
    3535#include "core/CoreIncludes.h"
    36 #include "core/XMLPort.h"
    3736
    3837namespace orxonox
     
    5756        this->reloadTime_ = 0.5f;
    5857    }
    59 
    60     void FusionMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    61     {
    62         SUPER(FusionMunition, XMLPort, xmlelement, mode);
    63     }
    6458}
  • code/trunk/src/modules/weapons/munitions/FusionMunition.h

    r11052 r11071  
    5252        public:
    5353            FusionMunition(Context* context);
    54             virtual ~FusionMunition() {}
    55             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     54            virtual ~FusionMunition() = default;
    5655    };
    5756}
  • code/trunk/src/modules/weapons/munitions/GravityBombMunition.cc

    r11052 r11071  
    77#include "GravityBombMunition.h"
    88#include "core/CoreIncludes.h"
    9 #include "core/XMLPort.h"
    109
    1110namespace orxonox
     
    2726        this->reloadTime_ = 0.0f;
    2827    }
    29 
    30     void GravityBombMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    31     {
    32         SUPER(GravityBombMunition, XMLPort, xmlelement, mode);
    33     }
    3428}
    3529
  • code/trunk/src/modules/weapons/munitions/GravityBombMunition.h

    r11052 r11071  
    2727        public:
    2828            GravityBombMunition(Context* context);
    29             virtual ~GravityBombMunition() {}
    30             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     29            virtual ~GravityBombMunition() = default;
    3130    };
    3231
  • code/trunk/src/modules/weapons/munitions/IceMunition.cc

    r11052 r11071  
    3434#include "IceMunition.h"
    3535#include "core/CoreIncludes.h"
    36 #include "core/XMLPort.h"
    3736
    3837namespace orxonox
     
    5554        this->reloadTime_ = 0.5f;
    5655    }
    57 
    58     void IceMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    59     {
    60         SUPER(IceMunition, XMLPort, xmlelement, mode);
    61     }
    6256}
  • code/trunk/src/modules/weapons/munitions/IceMunition.h

    r11052 r11071  
    5252        public:
    5353            IceMunition(Context* context);
    54             virtual ~IceMunition() {}
    55             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     54            virtual ~IceMunition() = default;
    5655    };
    5756}
  • code/trunk/src/modules/weapons/munitions/LaserMunition.cc

    r11052 r11071  
    3434#include "LaserMunition.h"
    3535#include "core/CoreIncludes.h"
    36 #include "core/XMLPort.h"
    3736
    3837namespace orxonox
     
    5857        this->reloadTime_ = 0.5f;
    5958    }
    60 
    61     void LaserMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    62     {
    63         SUPER(LaserMunition, XMLPort, xmlelement, mode);
    64     }
    6559}
  • code/trunk/src/modules/weapons/munitions/LaserMunition.h

    r11052 r11071  
    5252        public:
    5353            LaserMunition(Context* context);
    54             virtual ~LaserMunition() {}
    55             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     54            virtual ~LaserMunition() = default;
    5655    };
    5756}
  • code/trunk/src/modules/weapons/munitions/LightningMunition.cc

    r11052 r11071  
    3434#include "LightningMunition.h"
    3535#include "core/CoreIncludes.h"
    36 #include "core/XMLPort.h"
    3736
    3837namespace orxonox
     
    5554        this->reloadTime_ = 0.5f;   
    5655    }
    57 
    58     void LightningMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    59     {
    60         SUPER(LightningMunition, XMLPort, xmlelement, mode);
    61     }
    6256}
  • code/trunk/src/modules/weapons/munitions/LightningMunition.h

    r11052 r11071  
    5252        public:
    5353            LightningMunition(Context* context);
    54             virtual ~LightningMunition() {}
    55             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     54            virtual ~LightningMunition() = default;
    5655    };
    5756}
  • code/trunk/src/modules/weapons/munitions/MineMunition.cc

    r11052 r11071  
    5454        this->reloadTime_ = 0.5f;
    5555    }
    56 
    57     void MineMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    58     {
    59         SUPER(MineMunition, XMLPort, xmlelement, mode);
    60     }
    6156}
  • code/trunk/src/modules/weapons/munitions/MineMunition.h

    r11052 r11071  
    5252        public:
    5353            MineMunition(Context* context);
    54             virtual ~MineMunition() {}
    55             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     54            virtual ~MineMunition() = default;
    5655    };
    5756}
  • code/trunk/src/modules/weapons/munitions/RocketMunition.cc

    r11052 r11071  
    3434#include "RocketMunition.h"
    3535#include "core/CoreIncludes.h"
    36 #include "core/XMLPort.h"
    3736
    3837namespace orxonox
     
    5554        this->reloadTime_ = 0.5f;
    5655    }
    57 
    58     void RocketMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    59     {
    60         SUPER(RocketMunition, XMLPort, xmlelement, mode);
    61     }
    6256}
  • code/trunk/src/modules/weapons/munitions/RocketMunition.h

    r11052 r11071  
    5252        public:
    5353            RocketMunition(Context* context);
    54             virtual ~RocketMunition() {}
    55             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     54            virtual ~RocketMunition() = default;
    5655    };
    5756}
  • code/trunk/src/modules/weapons/munitions/SplitMunition.cc

    r11052 r11071  
    3434#include "SplitMunition.h"
    3535#include "core/CoreIncludes.h"
    36 #include "core/XMLPort.h"
    3736
    3837namespace orxonox
     
    5554        this->reloadTime_ = 0.5f;
    5655    }
    57 
    58     void SplitMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    59     {
    60         SUPER(SplitMunition, XMLPort, xmlelement, mode);
    61     }
    6256}
  • code/trunk/src/modules/weapons/munitions/SplitMunition.h

    r11052 r11071  
    5252        public:
    5353            SplitMunition(Context* context);
    54             virtual ~SplitMunition() {}
    55             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     54            virtual ~SplitMunition() = default;
    5655    };
    5756}
  • code/trunk/src/modules/weapons/projectiles/BasicProjectile.cc

    r11052 r11071  
    8888                                    // The projectile is destroyed by its tick()-function (in the following tick).
    8989
    90             Pawn* victim = orxonox_cast<Pawn*>(otherObject); // If otherObject isn't a Pawn, then victim is NULL
     90            Pawn* victim = orxonox_cast<Pawn*>(otherObject); // If otherObject isn't a Pawn, then victim is nullptr
    9191
    9292            WorldEntity* entity = orxonox_cast<WorldEntity*>(this);
     
    146146    bool BasicProjectile::isObjectRelatedToShooter(WorldEntity* otherObject)
    147147    {
    148         for (WorldEntity* shooter = this->getShooter(); shooter != NULL; shooter = shooter->getParent())
     148        for (WorldEntity* shooter = this->getShooter(); shooter != nullptr; shooter = shooter->getParent())
    149149            if (otherObject == shooter)
    150150                return true;
    151         for (WorldEntity* object = otherObject; object != NULL; object = object->getParent())
     151        for (WorldEntity* object = otherObject; object != nullptr; object = object->getParent())
    152152            if (otherObject == this->getShooter())
    153153                return true;
  • code/trunk/src/modules/weapons/projectiles/BillboardProjectile.h

    r10629 r11071  
    6161            virtual void setMaterial(const std::string& material);
    6262            virtual const std::string& getMaterial();
    63             virtual void changedVisibility();
     63            virtual void changedVisibility() override;
    6464
    6565        private:
  • code/trunk/src/modules/weapons/projectiles/GravityBomb.cc

    r10622 r11071  
    2828                this->timeToLife_= LIFETIME;
    2929                this->setCollisionResponse(false);
    30                 this->setCollisionType(WorldEntity::Dynamic);
     30                this->setCollisionType(WorldEntity::CollisionType::Dynamic);
    3131                this->enableCollisionCallback();
    3232
  • code/trunk/src/modules/weapons/projectiles/GravityBomb.h

    r10622 r11071  
    4141            GravityBomb(Context* context);
    4242            virtual ~GravityBomb();
    43             virtual void tick(float dt);
     43            virtual void tick(float dt) override;
    4444
    45             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
     45            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
    4646            void detonate();
    4747        private:
  • code/trunk/src/modules/weapons/projectiles/GravityBombField.cc

    r11052 r11071  
    4141        //Make the Field visible on Radar and minimap.
    4242        this->setRadarObjectColour(ColourValue(1.0, 0.0, 0.2,1)); // Red
    43         this->setRadarObjectShape(RadarViewable::Dot);
     43        this->setRadarObjectShape(RadarViewable::Shape::Dot);
    4444        this->setRadarObjectScale(1.0f);
    4545       
     
    125125
    126126            //Check if any pawn is inside the shockwave and hit it with dammage proportional to the distance between explosion centre and pawn. Make sure, the same pawn is damaged only once.
    127             for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
     127            for (Pawn* pawn : ObjectList<Pawn>())
    128128            {
    129                 Vector3 distanceVector = it->getWorldPosition()-this->getWorldPosition();
     129                Vector3 distanceVector = pawn->getWorldPosition()-this->getWorldPosition();
    130130                 //orxout(debug_output) << "Found Pawn:" << it->getWorldPosition() << endl;
    131131                if(distanceVector.length()< forceSphereRadius_)
    132132                {
    133133                    //orxout(debug_output) << "Force sphere radius is: " << forceSphereRadius_ << " Distance to Pawn is: " << distanceVector.length();
    134                     if (std::find(victimsAlreadyDamaged_.begin(),victimsAlreadyDamaged_.end(),*it) == victimsAlreadyDamaged_.end())
     134                    if (std::find(victimsAlreadyDamaged_.begin(),victimsAlreadyDamaged_.end(),pawn) == victimsAlreadyDamaged_.end())
    135135                    {
    136136                        //orxout(debug_output) << "Found Pawn to damage: " << it->getWorldPosition() << endl;
    137137                        float damage = FORCE_FIELD_EXPLOSION_DAMMAGE*(1-distanceVector.length()/EXPLOSION_RADIUS);
    138138                        //orxout(debug_output) << "Damage: " << damage << endl;
    139                         it->hit(shooter_, it->getWorldPosition(), NULL, damage, 0,0);
    140                         victimsAlreadyDamaged_.push_back(*it);
     139                        pawn->hit(shooter_, pawn->getWorldPosition(), nullptr, damage, 0,0);
     140                        victimsAlreadyDamaged_.push_back(pawn);
    141141                    }
    142142                }
  • code/trunk/src/modules/weapons/projectiles/GravityBombField.h

    r10622 r11071  
    3939    GravityBombField(Context* context);
    4040    virtual ~GravityBombField();
    41     virtual void tick(float dt);
     41    virtual void tick(float dt) override;
    4242    virtual void destroy();
    4343
  • code/trunk/src/modules/weapons/projectiles/IceGunProjectile.cc

    r11052 r11071  
    120120            Vector3 offset = this->getWorldPosition() - otherObject->getWorldPosition();
    121121            freezer->setPosition(Vector3(0,0,0));
    122             freezer->translate(offset, WorldEntity::World);
     122            freezer->translate(offset, WorldEntity::TransformSpace::World);
    123123            // Start the freezing effect.
    124124            freezer->startFreezing();
  • code/trunk/src/modules/weapons/projectiles/IceGunProjectile.h

    r11052 r11071  
    6262
    6363        protected:
    64             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
     64            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
    6565            static const float particleDestructionDelay_;
    6666        private:
  • code/trunk/src/modules/weapons/projectiles/LightningGunProjectile.cc

    r10622 r11071  
    4848        this->textureIndex_ = 1;
    4949        this->setMass(2);
    50         this->setCollisionType(Dynamic);
     50        this->setCollisionType(CollisionType::Dynamic);
    5151        this->maxTextureIndex_ = 8;
    5252        this->textureTimer_.setTimer(0.01f, true, createExecutor(createFunctor(&LightningGunProjectile::changeTexture, this)));
  • code/trunk/src/modules/weapons/projectiles/LightningGunProjectile.h

    r9667 r11071  
    5858            virtual ~LightningGunProjectile() {}
    5959
    60             virtual void setMaterial(const std::string& material);
     60            virtual void setMaterial(const std::string& material) override;
    6161
    6262        private:
  • code/trunk/src/modules/weapons/projectiles/MineProjectile.cc

    r11052 r11071  
    112112        modelRing4_->yaw(Degree(270));
    113113
    114         emitter_ = NULL;
     114        emitter_ = nullptr;
    115115
    116116        if (GameMode::isMaster())
     
    121121            this->enableCollisionCallback();
    122122            this->setCollisionResponse(true);
    123             this->setCollisionType(Dynamic);
     123            this->setCollisionType(CollisionType::Dynamic);
    124124
    125125            // Create a sphere collision shape and attach it to the projectile.
     
    217217            {
    218218                // Damage all pawns within the damage radius
    219                 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++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/trunk/src/modules/weapons/projectiles/MineProjectile.h

    r11052 r11071  
    5757            virtual ~MineProjectile();
    5858
    59             virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
     59            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override;
    6060
    61             virtual void setMaxTimeUntilExplosion(float maxTimeUntilExplosion);
    62             virtual void setTimeUntilActivation(float timeUntilActivation);
     61            void setMaxTimeUntilExplosion(float maxTimeUntilExplosion);
     62            void setTimeUntilActivation(float timeUntilActivation);
    6363        protected:
    6464            static const float triggerRadius_;
     
    8484            WeakPtr<DistanceTrigger> distanceTrigger_;
    8585
    86             virtual void destructionEffect();
    87             virtual void allowExplosion();
    88             virtual void explode();
     86            void destructionEffect();
     87            void allowExplosion();
     88            void explode();
    8989    };
    9090}
  • code/trunk/src/modules/weapons/projectiles/ParticleProjectile.cc

    r10624 r11071  
    5858        }
    5959        else
    60             this->particles_ = 0;
     60            this->particles_ = nullptr;
    6161    }
    6262
  • code/trunk/src/modules/weapons/projectiles/ParticleProjectile.h

    r9667 r11071  
    5353            ParticleProjectile(Context* context);
    5454            virtual ~ParticleProjectile();
    55             virtual void changedVisibility();
     55            virtual void changedVisibility() override;
    5656
    5757        private:
  • code/trunk/src/modules/weapons/projectiles/Projectile.cc

    r10629 r11071  
    5757            this->enableCollisionCallback();
    5858            this->setCollisionResponse(false);
    59             this->setCollisionType(Dynamic);
     59            this->setCollisionType(CollisionType::Dynamic);
    6060
    6161            // Create a sphere collision shape and attach it to the projectile.
     
    9494    void Projectile::setCollisionShapeRadius(float radius)
    9595    {
    96         if (collisionShape_ != NULL && radius > 0)
     96        if (collisionShape_ != nullptr && radius > 0)
    9797        {
    9898            collisionShape_->setRadius(radius);
  • code/trunk/src/modules/weapons/projectiles/Projectile.h

    r11052 r11071  
    6464            void setConfigValues();
    6565
    66             virtual void tick(float dt);
    67             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
     66            virtual void tick(float dt) override;
     67            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
    6868
    6969        protected:
  • code/trunk/src/modules/weapons/projectiles/Rocket.cc

    r11052 r11071  
    7070        if (GameMode::isMaster())
    7171        {
    72             this->setCollisionType(WorldEntity::Kinematic);
     72            this->setCollisionType(WorldEntity::CollisionType::Kinematic);
    7373            this->setVelocity(0,0,-100);
    7474
     
    9292            this->enableCollisionCallback();
    9393            this->setCollisionResponse(false);
    94             this->setCollisionType(Kinematic);
     94            this->setCollisionType(CollisionType::Kinematic);
    9595
    9696            // Add collision shape
     
    117117        else
    118118        {
    119             this->defSndWpnEngine_ = 0;
    120             this->defSndWpnLaunch_ = 0;
     119            this->defSndWpnEngine_ = nullptr;
     120            this->defSndWpnLaunch_ = nullptr;
    121121        }
    122122
     
    128128
    129129        this->setRadarObjectColour(ColourValue(1.0, 0.5, 0.0)); // orange
    130         this->setRadarObjectShape(RadarViewable::Triangle);
     130        this->setRadarObjectShape(RadarViewable::Shape::Triangle);
    131131        this->setRadarObjectScale(0.5f);
    132132    }
  • code/trunk/src/modules/weapons/projectiles/Rocket.h

    r11052 r11071  
    6262            virtual ~Rocket();
    6363
    64             virtual void tick(float dt); //!< Defines which actions the Rocket has to take in each tick.
     64            virtual void tick(float dt) override; //!< Defines which actions the Rocket has to take in each tick.
    6565
    66             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
    67             virtual void destroyObject(void);
     66            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
     67            virtual void destroyObject(void) override;
    6868            void destructionEffect();
    6969
    70             virtual void moveFrontBack(const Vector2& value) {}
    71             virtual void moveRightLeft(const Vector2& value) {}
    72             virtual void moveUpDown(const Vector2& value) {}
     70            virtual void moveFrontBack(const Vector2& value) override {}
     71            virtual void moveRightLeft(const Vector2& value) override {}
     72            virtual void moveUpDown(const Vector2& value) override {}
    7373
    74             virtual void rotateYaw(const Vector2& value);
    75             virtual void rotatePitch(const Vector2& value);
    76             virtual void rotateRoll(const Vector2& value);
     74            virtual void rotateYaw(const Vector2& value) override;
     75            virtual void rotatePitch(const Vector2& value) override;
     76            virtual void rotateRoll(const Vector2& value) override;
    7777
    7878            /**
     
    114114                { this->rotateRoll(Vector2(value, 0)); }
    115115
    116             virtual void setShooter(Pawn* shooter);
     116            virtual void setShooter(Pawn* shooter) override;
    117117
    118             virtual void fired(unsigned int firemode);
     118            virtual void fired(unsigned int firemode) override;
    119119
    120120            /**
    121121            @brief Set the maximum lifetime of the rocket.
    122122            */
    123             virtual void setMaxFuel(float fuel);
     123            void setMaxFuel(float fuel);
    124124            /**
    125125            @brief Get the maximum lifetime of the rocket.
     
    127127            inline float getMaxFuel() const
    128128                { return lifetime_; }
    129             virtual float getFuel() const;
     129            float getFuel() const;
    130130
    131131        private:
  • code/trunk/src/modules/weapons/projectiles/RocketOld.cc

    r10622 r11071  
    7070        if (GameMode::isMaster())
    7171        {
    72             this->setCollisionType(WorldEntity::Kinematic);
     72            this->setCollisionType(WorldEntity::CollisionType::Kinematic);
    7373            this->setVelocity(0,0,-100);
    7474
     
    9292            this->enableCollisionCallback();
    9393            this->setCollisionResponse(false);
    94             this->setCollisionType(Kinematic);
     94            this->setCollisionType(CollisionType::Kinematic);
    9595
    9696            // Add collision shape
     
    117117        else
    118118        {
    119             this->defSndWpnEngine_ = 0;
    120             this->defSndWpnLaunch_ = 0;
     119            this->defSndWpnEngine_ = nullptr;
     120            this->defSndWpnLaunch_ = nullptr;
    121121        }
    122122
     
    128128
    129129        this->setRadarObjectColour(ColourValue(1.0, 0.5, 0.0)); // orange
    130         this->setRadarObjectShape(RadarViewable::Triangle);
     130        this->setRadarObjectShape(RadarViewable::Shape::Triangle);
    131131        this->setRadarObjectScale(0.5f);
    132132    }
  • code/trunk/src/modules/weapons/projectiles/RocketOld.h

    r10622 r11071  
    6262            virtual ~RocketOld();
    6363
    64             virtual void tick(float dt); //!< Defines which actions the RocketOld has to take in each tick.
     64            virtual void tick(float dt) override; //!< Defines which actions the RocketOld has to take in each tick.
    6565
    66             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
    67             virtual void destroyObject(void);
     66            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
     67            virtual void destroyObject(void) override;
    6868            void destructionEffect();
    6969
    70             virtual void moveFrontBack(const Vector2& value) {}
    71             virtual void moveRightLeft(const Vector2& value) {}
    72             virtual void moveUpDown(const Vector2& value) {}
     70            virtual void moveFrontBack(const Vector2& value) override {}
     71            virtual void moveRightLeft(const Vector2& value) override {}
     72            virtual void moveUpDown(const Vector2& value) override {}
    7373
    74             virtual void rotateYaw(const Vector2& value);
    75             virtual void rotatePitch(const Vector2& value);
    76             virtual void rotateRoll(const Vector2& value);
     74            virtual void rotateYaw(const Vector2& value) override;
     75            virtual void rotatePitch(const Vector2& value) override;
     76            virtual void rotateRoll(const Vector2& value) override;
    7777
    7878            /**
     
    114114                { this->rotateRoll(Vector2(value, 0)); }
    115115
    116             virtual void setShooter(Pawn* shooter);
     116            virtual void setShooter(Pawn* shooter) override;
    117117
    118             virtual void fired(unsigned int firemode);
     118            virtual void fired(unsigned int firemode) override;
    119119
    120120        private:
  • code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc

    r11052 r11071  
    7070        if (GameMode::isMaster())
    7171        {
    72             this->setCollisionType(WorldEntity::Kinematic);
     72            this->setCollisionType(WorldEntity::CollisionType::Kinematic);
    7373            this->fuel_ = true;
    7474
     
    8787            this->enableCollisionCallback();
    8888            this->setCollisionResponse(false);
    89             this->setCollisionType(Kinematic);
     89            this->setCollisionType(CollisionType::Kinematic);
    9090
    9191            // Add collision shape.
     
    101101
    102102        this->setRadarObjectColour(ColourValue(1.0, 1.0, 0.0)); // yellow
    103         this->setRadarObjectShape(RadarViewable::Triangle);
     103        this->setRadarObjectShape(RadarViewable::Shape::Triangle);
    104104        this->setRadarObjectScale(0.5f);
    105105    }
  • code/trunk/src/modules/weapons/projectiles/SimpleRocket.h

    r10216 r11071  
    6262            SimpleRocket(Context* context);
    6363            virtual ~SimpleRocket();
    64             virtual void tick(float dt);
     64            virtual void tick(float dt) override;
    6565
    66             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
     66            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
    6767
    6868            void disableFire(); //!< Method to disable the fire and stop all acceleration
    6969
    70             virtual void moveFrontBack(const Vector2& value){}
    71             virtual void moveRightLeft(const Vector2& value){}
    72             virtual void moveUpDown(const Vector2& value){}
     70            virtual void moveFrontBack(const Vector2& value) override{}
     71            virtual void moveRightLeft(const Vector2& value) override{}
     72            virtual void moveUpDown(const Vector2& value) override{}
    7373
    74             virtual void rotateYaw(const Vector2& value);
    75             virtual void rotatePitch(const Vector2& value);
    76             virtual void rotateRoll(const Vector2& value);
     74            virtual void rotateYaw(const Vector2& value) override;
     75            virtual void rotatePitch(const Vector2& value) override;
     76            virtual void rotateRoll(const Vector2& value) override;
    7777            void setDestroy();
    7878
     
    115115                { this->rotateRoll(Vector2(value, 0)); }
    116116
    117             virtual void setShooter(Pawn* shooter);
     117            virtual void setShooter(Pawn* shooter) override;
    118118
    119119            inline bool hasFuel() const
  • code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.h

    r9667 r11071  
    5757            virtual ~EnergyDrink() {}
    5858
    59             virtual void fire();
    60             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     59            virtual void fire() override;
     60            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    6161
    6262        private:
  • code/trunk/src/modules/weapons/weaponmodes/FusionFire.h

    r9667 r11071  
    5454            virtual ~FusionFire() {}
    5555
    56             virtual void fire();
     56            virtual void fire() override;
    5757
    5858        private:
  • code/trunk/src/modules/weapons/weaponmodes/GravityBombFire.h

    r10622 r11071  
    3434            virtual ~GravityBombFire();
    3535
    36             virtual void fire();
     36            virtual void fire() override;
    3737
    3838        private:
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.h

    r9945 r11071  
    5656            virtual ~HsW01();
    5757
    58             virtual void fire();
    59             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     58            virtual void fire() override;
     59            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    6060
    6161        protected:
  • code/trunk/src/modules/weapons/weaponmodes/IceGun.h

    r11052 r11071  
    5454            virtual ~IceGun();
    5555
    56             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    57             virtual void fire();
     56            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     57            virtual void fire() override;
    5858           
    5959            inline void setFreezeTime(float freezeTime)
  • code/trunk/src/modules/weapons/weaponmodes/LaserFire.h

    r9667 r11071  
    5454            virtual ~LaserFire() {}
    5555
    56             virtual void fire();
     56            virtual void fire() override;
    5757
    5858        private:
  • code/trunk/src/modules/weapons/weaponmodes/LightningGun.h

    r9667 r11071  
    5454            virtual ~LightningGun();
    5555
    56             virtual void fire();
     56            virtual void fire() override;
    5757
    5858       private:
  • code/trunk/src/modules/weapons/weaponmodes/MineGun.h

    r11052 r11071  
    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
  • code/trunk/src/modules/weapons/weaponmodes/RocketFire.h

    r11052 r11071  
    5454            virtual ~RocketFire();
    5555
    56             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     56            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    5757
    58             virtual void fire();
     58            virtual void fire() override;
    5959            inline void setFuel(float fuel)
    6060                { this->fuel_ = fuel; }
  • code/trunk/src/modules/weapons/weaponmodes/RocketFireOld.h

    r10622 r11071  
    5454            virtual ~RocketFireOld();
    5555
    56             virtual void fire();
     56            virtual void fire() override;
    5757
    5858        private:
  • code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.h

    r9667 r11071  
    5353            virtual ~SimpleRocketFire();
    5454            void deactivateFire();
    55             virtual void fire();
     55            virtual void fire() override;
    5656
    5757        private:
  • code/trunk/src/modules/weapons/weaponmodes/SplitGun.h

    r11052 r11071  
    5454            virtual ~SplitGun();
    5555
    56             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    57             virtual void fire();
     56            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     57            virtual void fire() override;
    5858
    5959            inline void setNumberOfSplits(int numberOfSplits)
Note: See TracChangeset for help on using the changeset viewer.