Changeset 10765 for code/branches/cpp11_v2/src/modules/tetris
- Timestamp:
- Nov 4, 2015, 10:25:42 PM (10 years ago)
- 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 72 72 this->starttimer_.stopTimer(); 73 73 74 this->player_ = NULL;74 this->player_ = nullptr; 75 75 this->setHUDTemplate("TetrisHUD"); 76 76 this->futureBrick_ = 0; … … 113 113 SUPER(Tetris, tick, dt); 114 114 115 if((this->activeBrick_ != NULL)&&(!this->hasEnded()))115 if((this->activeBrick_ != nullptr)&&(!this->hasEnded())) 116 116 { 117 117 if(!this->isValidBrickPosition(this->activeBrick_)) … … 290 290 void Tetris::start() 291 291 { 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. 293 293 { 294 294 // Create the first brick. … … 323 323 { 324 324 this->activeBrick_->setVelocity(Vector3::ZERO); 325 if(this->activeBrick_ != NULL)325 if(this->activeBrick_ != nullptr) 326 326 { 327 327 this->player_->stopControl(); … … 351 351 if(player && player->isHumanPlayer()) 352 352 { 353 if(this->activeBrick_ != NULL)353 if(this->activeBrick_ != nullptr) 354 354 { 355 355 this->player_->stopControl(); … … 370 370 assert(player); 371 371 372 if(this->player_ == NULL)372 if(this->player_ == nullptr) 373 373 { 374 374 this->player_ = player; … … 381 381 void Tetris::startBrick(void) 382 382 { 383 if(this->player_ == NULL)383 if(this->player_ == nullptr) 384 384 return; 385 385 386 386 unsigned int cameraIndex = 0; 387 if(this->activeBrick_ != NULL)387 if(this->activeBrick_ != nullptr) 388 388 { 389 389 // Get camera settings … … 437 437 Get the player. 438 438 @return 439 Returns a pointer to the player. If there is no player, NULLis returned.439 Returns a pointer to the player. If there is no player, nullptr is returned. 440 440 */ 441 441 PlayerInfo* Tetris::getPlayer(void) const -
code/branches/cpp11_v2/src/modules/tetris/TetrisBrick.cc
r10624 r10765 81 81 this->attach(stone); 82 82 this->formBrick(stone, i); 83 if(this->tetris_ != NULL)83 if(this->tetris_ != nullptr) 84 84 { 85 85 stone->setGame(this->tetris_); 86 if(this->tetris_->getCenterpoint() != NULL)86 if(this->tetris_->getCenterpoint() != nullptr) 87 87 stone->addTemplate(this->tetris_->getCenterpoint()->getStoneTemplate()); 88 88 else 89 orxout()<< "tetris_->getCenterpoint == NULLin TetrisBrick.cc"<< endl;89 orxout()<< "tetris_->getCenterpoint == nullptr in TetrisBrick.cc"<< endl; 90 90 } 91 91 else 92 orxout()<< "tetris_ == NULLin TetrisBrick.cc"<< endl;92 orxout()<< "tetris_ == nullptr in TetrisBrick.cc"<< endl; 93 93 } 94 94 } … … 161 161 if(i < this->brickStones_.size()) 162 162 return this->brickStones_[i]; 163 else return NULL;163 else return nullptr; 164 164 } 165 165 … … 167 167 Tetris* TetrisBrick::getTetris() 168 168 { 169 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(Tetris)))169 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Tetris))) 170 170 { 171 171 Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype()); 172 172 return tetrisGametype; 173 173 } 174 return NULL;174 return nullptr; 175 175 } 176 176 -
code/branches/cpp11_v2/src/modules/tetris/TetrisCenterpoint.cc
r10624 r10765 84 84 void TetrisCenterpoint::checkGametype() 85 85 { 86 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(Tetris)))86 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Tetris))) 87 87 { 88 88 Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype()); -
code/branches/cpp11_v2/src/modules/tetris/TetrisScore.cc
r10624 r10765 57 57 58 58 this->owner_ = 0; 59 this->player_ = NULL;59 this->player_ = nullptr; 60 60 } 61 61 … … 89 89 90 90 // If the owner is set. The owner being a Tetris game. 91 if (this->owner_ != NULL)91 if (this->owner_ != nullptr) 92 92 { 93 93 std::string score("0"); … … 101 101 { 102 102 // Save the name and score of each player as a string. 103 if (player_ != NULL)103 if (player_ != nullptr) 104 104 score = multi_cast<std::string>(this->owner_->getScore(player_)); 105 105 } … … 111 111 @brief 112 112 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. 114 114 */ 115 115 void TetrisScore::changedOwner() … … 117 117 SUPER(TetrisScore, changedOwner); 118 118 119 if (this->getOwner() != NULL&& this->getOwner()->getGametype())119 if (this->getOwner() != nullptr && this->getOwner()->getGametype()) 120 120 this->owner_ = orxonox_cast<Tetris*>(this->getOwner()->getGametype()); 121 121 else
Note: See TracChangeset
for help on using the changeset viewer.