Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

merged branch cpp11_v2 into cpp11_v3

Location:
code/branches/cpp11_v3
Files:
2 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    }
Note: See TracChangeset for help on using the changeset viewer.