Changeset 11054 for code/branches/cpp11_v3/src/modules/mini4dgame
- Timestamp:
- Jan 10, 2016, 1:54:11 PM (9 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/modules/mini4dgame/Mini4Dgame.cc
r10624 r11054 66 66 RegisterObject(Mini4Dgame); 67 67 68 this->board_ = 0;68 this->board_ = nullptr; 69 69 70 70 // Set the type of Bots for this particular Gametype. … … 88 88 void Mini4Dgame::cleanup() 89 89 { 90 if(this->board_ != NULL)// Destroy the board, if present.90 if(this->board_ != nullptr)// Destroy the board, if present. 91 91 { 92 92 //this->board_->destroy(); 93 this->board_ = 0;93 this->board_ = nullptr; 94 94 } 95 95 } … … 101 101 void Mini4Dgame::start() 102 102 { 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. 104 104 { 105 105 /* 106 if (this->board_ == NULL)106 if (this->board_ == nullptr) 107 107 { 108 108 this->board_ = new Mini4DgameBoard(this->board_->getContext()); … … 155 155 { 156 156 // 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); 160 160 // 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); 164 164 } 165 165 … … 174 174 assert(player); 175 175 176 if(false)//this->player_ == NULL)176 if(false)//this->player_ == nullptr) 177 177 { 178 178 //this->player_ = player; … … 183 183 void Mini4Dgame::undoStone()//Vector4 move, const int playerColor) 184 184 { 185 ObjectList<Mini4DgameBoard>::iterator it = ObjectList<Mini4DgameBoard> ::begin();185 ObjectList<Mini4DgameBoard>::iterator it = ObjectList<Mini4DgameBoard>().begin(); 186 186 it->undoMove(); 187 187 } … … 191 191 { 192 192 Mini4DgamePosition move = Mini4DgamePosition(x,y,z,w); 193 ObjectList<Mini4DgameBoard>::iterator it = ObjectList<Mini4DgameBoard> ::begin();193 ObjectList<Mini4DgameBoard>::iterator it = ObjectList<Mini4DgameBoard>().begin(); 194 194 it->makeMove(move); 195 195 } -
code/branches/cpp11_v3/src/modules/mini4dgame/Mini4Dgame.h
r10230 r11054 65 65 virtual ~Mini4Dgame(); //!< Destructor. Cleans up, if initialized. 66 66 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. 69 69 70 virtual void spawnPlayer(PlayerInfo* player) ; //!< Spawns the input player.70 virtual void spawnPlayer(PlayerInfo* player) override; //!< Spawns the input player. 71 71 72 72 void setGameboard(Mini4DgameBoard* board) … … 84 84 85 85 protected: 86 virtual void spawnPlayersIfRequested() ; //!< Spawns player.86 virtual void spawnPlayersIfRequested() override; //!< Spawns player. 87 87 88 88 -
code/branches/cpp11_v3/src/modules/mini4dgame/Mini4DgameAI.cc
r10230 r11054 60 60 61 61 this->setConfigValues(); 62 this->center_ = 0;62 this->center_ = nullptr; 63 63 } 64 64 -
code/branches/cpp11_v3/src/modules/mini4dgame/Mini4DgameAI.h
r10230 r11054 81 81 protected: 82 82 83 std::list<std::pair<Timer*, char> 83 std::list<std::pair<Timer*, char>> reactionTimers_; //!< A list of reaction timers and the directions that take effect when their timer expires. 84 84 Mini4DgameCenterpoint* center_; 85 85 -
code/branches/cpp11_v3/src/modules/mini4dgame/Mini4DgameBoard.cc
r10624 r11054 64 64 for(int l=0;l<4;l++){ 65 65 this->board[i][j][k][l]=mini4DgamePlayerColor::none; 66 this->blinkingBillboards[i][j][k][l] = 0;66 this->blinkingBillboards[i][j][k][l] = nullptr; 67 67 } 68 68 } … … 97 97 this->board[move.x][move.y][move.z][move.w] = mini4DgamePlayerColor::none; 98 98 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; 100 100 if(player_toggle_){ 101 101 this->player_toggle_ = false; … … 905 905 void Mini4DgameBoard::checkGametype() 906 906 { 907 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(Mini4Dgame)))907 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Mini4Dgame))) 908 908 { 909 909 Mini4Dgame* Mini4DgameGametype = orxonox_cast<Mini4Dgame*>(this->getGametype()); -
code/branches/cpp11_v3/src/modules/mini4dgame/Mini4DgameBoard.h
r10624 r11054 74 74 //virtual ~Mini4DgameBoard(); 75 75 76 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;76 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 77 77 78 78 bool isValidMove(const Mini4DgamePosition& move);
Note: See TracChangeset
for help on using the changeset viewer.