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:
12 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • 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
Note: See TracChangeset for help on using the changeset viewer.