Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 10, 2016, 1:54:11 PM (9 years ago)
Author:
landauf
Message:

merged branch cpp11_v2 into cpp11_v3

Location:
code/branches/cpp11_v3
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/modules/mini4dgame/Mini4Dgame.cc

    r10624 r11054  
    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/branches/cpp11_v3/src/modules/mini4dgame/Mini4Dgame.h

    r10230 r11054  
    6565            virtual ~Mini4Dgame(); //!< Destructor. Cleans up, if initialized.
    6666
    67             virtual void start(void); //!< Starts the Mini4Dgame minigame.
    68             virtual void end(void); ///!< Ends the Mini4Dgame minigame.
     67            virtual void start(void) override; //!< Starts the Mini4Dgame minigame.
     68            virtual void end(void) override; ///!< Ends the Mini4Dgame minigame.
    6969
    70             virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player.
     70            virtual void spawnPlayer(PlayerInfo* player) override; //!< Spawns the input player.
    7171
    7272            void setGameboard(Mini4DgameBoard* board)
     
    8484
    8585        protected:
    86             virtual void spawnPlayersIfRequested(); //!< Spawns player.
     86            virtual void spawnPlayersIfRequested() override; //!< Spawns player.
    8787
    8888
  • code/branches/cpp11_v3/src/modules/mini4dgame/Mini4DgameAI.cc

    r10230 r11054  
    6060
    6161        this->setConfigValues();
    62         this->center_ = 0;
     62        this->center_ = nullptr;
    6363    }
    6464
  • code/branches/cpp11_v3/src/modules/mini4dgame/Mini4DgameAI.h

    r10230 r11054  
    8181        protected:
    8282
    83             std::list<std::pair<Timer*, char> > reactionTimers_; //!< A list of reaction timers and the directions that take effect when their timer expires.
     83            std::list<std::pair<Timer*, char>> reactionTimers_; //!< A list of reaction timers and the directions that take effect when their timer expires.
    8484            Mini4DgameCenterpoint* center_;
    8585
  • code/branches/cpp11_v3/src/modules/mini4dgame/Mini4DgameBoard.cc

    r10624 r11054  
    6464                    for(int l=0;l<4;l++){
    6565                        this->board[i][j][k][l]=mini4DgamePlayerColor::none;
    66                         this->blinkingBillboards[i][j][k][l] = 0;
     66                        this->blinkingBillboards[i][j][k][l] = nullptr;
    6767                    }
    6868                }
     
    9797        this->board[move.x][move.y][move.z][move.w] = mini4DgamePlayerColor::none;
    9898        this->blinkingBillboards[move.x][move.y][move.z][move.w]->destroy();
    99         this->blinkingBillboards[move.x][move.y][move.z][move.w] = 0;
     99        this->blinkingBillboards[move.x][move.y][move.z][move.w] = nullptr;
    100100        if(player_toggle_){
    101101            this->player_toggle_ = false;
     
    905905    void Mini4DgameBoard::checkGametype()
    906906    {
    907         if (this->getGametype() != NULL && this->getGametype()->isA(Class(Mini4Dgame)))
     907        if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Mini4Dgame)))
    908908        {
    909909            Mini4Dgame* Mini4DgameGametype = orxonox_cast<Mini4Dgame*>(this->getGametype());
  • code/branches/cpp11_v3/src/modules/mini4dgame/Mini4DgameBoard.h

    r10624 r11054  
    7474            //virtual ~Mini4DgameBoard();
    7575
    76             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     76            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    7777
    7878            bool isValidMove(const Mini4DgamePosition& move);
Note: See TracChangeset for help on using the changeset viewer.