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

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/infos/Bot.h

    r9667 r11071  
    4545            void setConfigValues();
    4646
    47             inline bool isInitialized() const
     47            virtual inline bool isInitialized() const override
    4848                { return true; }
    49             inline float getPing() const
     49            virtual inline float getPing() const override
    5050                { return 0; }
    51             inline float getPacketLossRatio() const
     51            virtual inline float getPacketLossRatio() const override
    5252                { return 0; }
    5353
  • code/trunk/src/orxonox/infos/GametypeInfo.cc

    r10624 r11071  
    291291        if(GameMode::isMaster())
    292292        {
    293             NotificationListener::sendNotification("Press [Fire] to respawn", GametypeInfo::NOTIFICATION_SENDER, notificationMessageType::info, notificationSendMode::network, player->getClientID());
     293            NotificationListener::sendNotification("Press [Fire] to respawn", GametypeInfo::NOTIFICATION_SENDER, NotificationMessageType::info, NotificationSendMode::network, player->getClientID());
    294294            // Remove the player from the list of players that have spawned, since it currently is not.
    295295            this->spawnedPlayers_.erase(player);
     
    346346                // Display "Press [Fire] to start the match" if the game has not yet ended.
    347347                if(!this->hasEnded())
    348                     NotificationListener::sendNotification("Press [Fire] to start the match", GametypeInfo::NOTIFICATION_SENDER, notificationMessageType::info, notificationSendMode::network, player->getClientID());
     348                    NotificationListener::sendNotification("Press [Fire] to start the match", GametypeInfo::NOTIFICATION_SENDER, NotificationMessageType::info, NotificationSendMode::network, player->getClientID());
    349349                // Else display "Game has ended".
    350350                else
    351                     NotificationListener::sendNotification("Game has ended", GametypeInfo::NOTIFICATION_SENDER, notificationMessageType::info, notificationSendMode::network, player->getClientID());
     351                    NotificationListener::sendNotification("Game has ended", GametypeInfo::NOTIFICATION_SENDER, NotificationMessageType::info, NotificationSendMode::network, player->getClientID());
    352352            }
    353353        }
     
    461461    void GametypeInfo::dispatchAnnounceMessage(const std::string& message) const
    462462    {
    463         for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
    464             it->announcemessage(this, message);
     463        for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>())
     464            listener->announcemessage(this, message);
    465465    }
    466466
    467467    void GametypeInfo::dispatchKillMessage(const std::string& message) const
    468468    {
    469         for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
    470             it->killmessage(this, message);
     469        for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>())
     470            listener->killmessage(this, message);
    471471    }
    472472
    473473    void GametypeInfo::dispatchDeathMessage(const std::string& message) const
    474474    {
    475         for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
    476             it->deathmessage(this, message);
     475        for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>())
     476            listener->deathmessage(this, message);
    477477    }
    478478
    479479     void GametypeInfo::dispatchStaticMessage(const std::string& message, const ColourValue& colour) const
    480480    {
    481         for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
    482             it->staticmessage(this, message, colour);
     481        for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>())
     482            listener->staticmessage(this, message, colour);
    483483    }
    484484
    485485     void GametypeInfo::dispatchFadingMessage(const std::string& message) const
    486486    {
    487         for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
    488             it->fadingmessage(this, message);
     487        for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>())
     488            listener->fadingmessage(this, message);
    489489    }
    490490}
  • code/trunk/src/orxonox/infos/HumanPlayer.cc

    r10624 r11071  
    5353        this->defaultController_ = Class(NewHumanController);
    5454
    55         this->humanHud_ = 0;
    56         this->gametypeHud_ = 0;
     55        this->humanHud_ = nullptr;
     56        this->gametypeHud_ = nullptr;
    5757
    5858        this->setConfigValues();
     
    178178        {
    179179            this->humanHud_->destroy();
    180             this->humanHud_ = 0;
     180            this->humanHud_ = nullptr;
    181181        }
    182182
     
    194194        {
    195195            this->gametypeHud_->destroy();
    196             this->gametypeHud_ = 0;
     196            this->gametypeHud_ = nullptr;
    197197        }
    198198
  • code/trunk/src/orxonox/infos/HumanPlayer.h

    r10624 r11071  
    4545            void setConfigValues();
    4646
    47             bool isInitialized() const;
    48             float getPing() const;
    49             float getPacketLossRatio() const;
     47            virtual bool isInitialized() const override;
     48            virtual float getPing() const override;
     49            virtual float getPacketLossRatio() const override;
    5050
    5151            void setClientID(unsigned int clientID);
    5252
    53             virtual void switchGametype(Gametype* gametype);
     53            virtual void switchGametype(Gametype* gametype) override;
    5454
    5555            inline void setHumanHUDTemplate(const std::string& name)
  • code/trunk/src/orxonox/infos/PlayerInfo.cc

    r11052 r11071  
    5151        this->bReadyToSpawn_ = false;
    5252        this->bSetUnreadyAfterSpawn_ = true;
    53         this->controller_ = 0;
    54         this->controllableEntity_ = 0;
     53        this->controller_ = nullptr;
     54        this->controllableEntity_ = nullptr;
    5555        this->controllableEntityID_ = OBJECTID_UNKNOWN;
    5656
    57         this->gtinfo_ = 0;
     57        this->gtinfo_ = nullptr;
    5858        this->gtinfoID_ = OBJECTID_UNKNOWN;
    5959        this->updateGametypeInfo(this->getGametype());
     
    7272            {
    7373                this->controller_->destroy();
    74                 this->controller_ = 0;
     74                this->controller_ = nullptr;
    7575            }
    7676
     
    126126    void PlayerInfo::updateGametypeInfo(Gametype* gametype)
    127127    {
    128         this->gtinfo_ = 0;
     128        this->gtinfo_ = nullptr;
    129129        this->gtinfoID_ = OBJECTID_UNKNOWN;
    130130
     
    141141        {
    142142            this->controller_->destroy();
    143             this->controller_ = 0;
     143            this->controller_ = nullptr;
    144144        }
    145145        this->controller_ = this->defaultController_.fabricate(this->getContext());
     
    181181
    182182        RadarViewable* radarviewable = orxonox_cast<RadarViewable*>(entity);
    183         if (radarviewable != NULL)
     183        if (radarviewable != nullptr)
    184184            radarviewable->setRadarName(this->getName());
    185185    }
     
    218218            return;
    219219
    220         this->controllableEntity_->setController(0);
    221         this->controllableEntity_ = 0;
     220        this->controllableEntity_->setController(nullptr);
     221        this->controllableEntity_ = nullptr;
    222222        this->controllableEntityID_ = OBJECTID_UNKNOWN;
    223223
    224224        if (this->controller_)
    225             this->controller_->setControllableEntity(0);
     225            this->controller_->setControllableEntity(nullptr);
    226226
    227227        if ( GameMode::isMaster() )
     
    239239
    240240        Controller* tmp =this->controllableEntity_->getController();
    241         if (tmp == NULL)
    242         {
    243             orxout(verbose) <<  "PlayerInfo: pauseControl, Controller is NULL " << endl;
     241        if (tmp == nullptr)
     242        {
     243            orxout(verbose) <<  "PlayerInfo: pauseControl, Controller is nullptr " << endl;
    244244            return;
    245245        }
    246246        tmp->setActive(false);
    247         //this->controllableEntity_->getController()->setControllableEntity(NULL);
    248         this->controllableEntity_->setController(0);
     247        //this->controllableEntity_->getController()->setControllableEntity(nullptr);
     248        this->controllableEntity_->setController(nullptr);
    249249    }
    250250
     
    253253        ControllableEntity* entity = this->controllableEntity_;
    254254
    255         assert(this->controllableEntity_ != NULL);
     255        assert(this->controllableEntity_ != nullptr);
    256256        if( !entity || this->previousControllableEntity_.size() == 0 )
    257257            return;
     
    259259        entity->destroyHud(); // HACK-ish
    260260
    261         this->controllableEntity_->setController(0);
     261        this->controllableEntity_->setController(nullptr);
    262262        if(this->isHumanPlayer()) // TODO: Multiplayer?
    263263            this->controllableEntity_->destroyHud(); // HACK-ish
     
    266266        do {
    267267            this->controllableEntity_ = this->previousControllableEntity_.back();
    268         } while(this->controllableEntity_ == NULL && this->previousControllableEntity_.size() > 0);
     268        } while(this->controllableEntity_ == nullptr && this->previousControllableEntity_.size() > 0);
    269269        this->controllableEntityID_ = this->controllableEntity_->getObjectID();
    270270        this->previousControllableEntity_.pop_back();
    271271
    272         if ( this->controllableEntity_ != NULL && this->controller_ != NULL)
     272        if ( this->controllableEntity_ != nullptr && this->controller_ != nullptr)
    273273            this->controller_->setControllableEntity(this->controllableEntity_);
    274274
    275275         // HACK-ish
    276         if(this->controllableEntity_ != NULL && this->isHumanPlayer())
     276        if(this->controllableEntity_ != nullptr && this->isHumanPlayer())
    277277            this->controllableEntity_->createHud();
    278278
  • code/trunk/src/orxonox/infos/PlayerInfo.h

    r10624 r11071  
    4444            virtual ~PlayerInfo();
    4545
    46             virtual void changedName();
     46            virtual void changedName() override;
    4747            virtual void switchGametype(Gametype* gametype);
    4848
     
    9999            Controller* controller_;
    100100            ControllableEntity* controllableEntity_;
    101             std::vector< WeakPtr<ControllableEntity> > previousControllableEntity_; //!< List of the previous ControllableEntities if repeatedly startTemporary control was called. The ControllableEntity at the back is the most recent.
     101            std::vector<WeakPtr<ControllableEntity>> previousControllableEntity_; //!< List of the previous ControllableEntities if repeatedly startTemporary control was called. The ControllableEntity at the back is the most recent.
    102102            unsigned int controllableEntityID_;
    103103
Note: See TracChangeset for help on using the changeset viewer.