Changeset 11071 for code/trunk/src/modules/tetris/TetrisBrick.cc
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (8 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/modules/tetris/TetrisBrick.cc
r10624 r11071 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 … … 239 239 { 240 240 assert(this->tetris_); 241 for( unsigned int i = 0; i < this->brickStones_.size(); i++)242 { 243 this->brickStones_[i]->detachFromParent();244 this->brickStones_[i]->attachToParent(center);245 this->brickStones_[i]->setPosition(this->getPosition()+this->tetris_->rotateVector(this->brickStones_[i]->getPosition(),this->rotationCount_ ));241 for(TetrisStone* stone : this->brickStones_) 242 { 243 stone->detachFromParent(); 244 stone->attachToParent(center); 245 stone->setPosition(this->getPosition()+this->tetris_->rotateVector(stone->getPosition(),this->rotationCount_ )); 246 246 } 247 247 this->brickStones_.clear();
Note: See TracChangeset
for help on using the changeset viewer.