Changeset 10769 for code/branches/cpp11_v2/src/modules/tetris/Tetris.cc
- Timestamp:
- Nov 7, 2015, 10:23:42 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/modules/tetris/Tetris.cc
r10768 r10769 104 104 } 105 105 106 for (std::list<StrongPtr<TetrisStone> 106 for (std::list<StrongPtr<TetrisStone>>::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it) 107 107 (*it)->destroy(); 108 108 this->stones_.clear(); … … 136 136 return false; 137 137 138 for(std::list<StrongPtr<TetrisStone> 138 for(std::list<StrongPtr<TetrisStone>>::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it) 139 139 { 140 140 const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone … … 192 192 193 193 // check for collisions with all stones 194 for(std::list<StrongPtr<TetrisStone> 194 for(std::list<StrongPtr<TetrisStone>>::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it) 195 195 { 196 196 //Vector3 currentStonePosition = rotateVector((*it)->getPosition(), this->activeBrick_->getRotationCount()); … … 469 469 { 470 470 stonesPerRow = 0; 471 for(std::list<StrongPtr<TetrisStone> 472 { 473 std::list<StrongPtr<TetrisStone> 471 for(std::list<StrongPtr<TetrisStone>>::iterator it = this->stones_.begin(); it != this->stones_.end(); ) 472 { 473 std::list<StrongPtr<TetrisStone>>::iterator it_temp = it++; 474 474 correctPosition = static_cast<unsigned int>(((*it_temp)->getPosition().y - 5)/this->center_->getStoneSize()); 475 475 if(correctPosition == row) … … 491 491 void Tetris::clearRow(unsigned int row) 492 492 {// clear the full row 493 for(std::list<StrongPtr<TetrisStone> 493 for(std::list<StrongPtr<TetrisStone>>::iterator it = this->stones_.begin(); it != this->stones_.end(); ) 494 494 { 495 495 if(static_cast<unsigned int>(((*it)->getPosition().y - 5)/this->center_->getStoneSize()) == row) … … 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(std::list<StrongPtr<TetrisStone> 504 for(std::list<StrongPtr<TetrisStone>>::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it) 505 505 { 506 506 if(static_cast<unsigned int>(((*it)->getPosition().y - 5)/this->center_->getStoneSize()) > row)
Note: See TracChangeset
for help on using the changeset viewer.