Changeset 10916 for code/branches/cpp11_v2/src/modules/tetris
- Timestamp:
- Dec 2, 2015, 11:22:03 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/modules/tetris
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/modules/tetris/Tetris.cc
r10821 r10916 104 104 } 105 105 106 for ( auto & elem: this->stones_)107 (elem)->destroy();106 for (TetrisStone* stone : this->stones_) 107 stone->destroy(); 108 108 this->stones_.clear(); 109 109 } … … 341 341 { 342 342 // Spawn a human player. 343 for (auto & elem: this->players_)344 if ( elem.first->isHumanPlayer() && (elem.first->isReadyToSpawn() || this->bForceSpawn_))345 this->spawnPlayer( elem.first);343 for (auto& mapEntry : this->players_) 344 if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_)) 345 this->spawnPlayer(mapEntry.first); 346 346 } 347 347 … … 502 502 } 503 503 // adjust height of stones above the deleted row //TODO: check if this could be a source of a bug. 504 for( auto & elem: this->stones_)505 { 506 if(static_cast<unsigned int>(( (elem)->getPosition().y - 5)/this->center_->getStoneSize()) > row)507 (elem)->setPosition((elem)->getPosition()-Vector3(0,10,0));504 for(TetrisStone* stone : this->stones_) 505 { 506 if(static_cast<unsigned int>((stone->getPosition().y - 5)/this->center_->getStoneSize()) > row) 507 stone->setPosition(stone->getPosition()-Vector3(0,10,0)); 508 508 } 509 509 -
code/branches/cpp11_v2/src/modules/tetris/TetrisBrick.cc
r10821 r10916 239 239 { 240 240 assert(this->tetris_); 241 for( auto & elem: this->brickStones_)242 { 243 elem->detachFromParent();244 elem->attachToParent(center);245 elem->setPosition(this->getPosition()+this->tetris_->rotateVector(elem->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.