Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 4, 2015, 10:25:42 PM (10 years ago)
Author:
landauf
Message:

replace 'NULL' by 'nullptr'

Location:
code/branches/cpp11_v2/src/modules/tetris
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/modules/tetris/Tetris.cc

    r10624 r10765  
    7272        this->starttimer_.stopTimer();
    7373
    74         this->player_ = NULL;
     74        this->player_ = nullptr;
    7575        this->setHUDTemplate("TetrisHUD");
    7676        this->futureBrick_ = 0;
     
    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_))
     
    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();
     
    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
     
    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
  • code/branches/cpp11_v2/src/modules/tetris/TetrisBrick.cc

    r10624 r10765  
    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
  • code/branches/cpp11_v2/src/modules/tetris/TetrisCenterpoint.cc

    r10624 r10765  
    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/branches/cpp11_v2/src/modules/tetris/TetrisScore.cc

    r10624 r10765  
    5757
    5858        this->owner_ = 0;
    59         this->player_ = NULL;
     59        this->player_ = nullptr;
    6060    }
    6161
     
    8989
    9090        // If the owner is set. The owner being a Tetris game.
    91         if (this->owner_ != NULL)
     91        if (this->owner_ != nullptr)
    9292        {
    9393            std::string score("0");
     
    101101            {
    102102                // Save the name and score of each player as a string.
    103                 if (player_ != NULL)
     103                if (player_ != nullptr)
    104104                    score = multi_cast<std::string>(this->owner_->getScore(player_));
    105105            }
     
    111111    @brief
    112112        Is called when the owner changes.
    113         Sets the owner to NULL, if it is not a pointer to a Tetris game.
     113        Sets the owner to nullptr, if it is not a pointer to a Tetris game.
    114114    */
    115115    void TetrisScore::changedOwner()
     
    117117        SUPER(TetrisScore, changedOwner);
    118118
    119         if (this->getOwner() != NULL && this->getOwner()->getGametype())
     119        if (this->getOwner() != nullptr && this->getOwner()->getGametype())
    120120            this->owner_ = orxonox_cast<Tetris*>(this->getOwner()->getGametype());
    121121        else
Note: See TracChangeset for help on using the changeset viewer.