Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 5, 2015, 10:47:51 PM (8 years ago)
Author:
landauf
Message:

use range-based for-loop where it makes sense (e.g. ObjectList)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/modules/tetris/Tetris.cc

    r10917 r10919  
    136136            return false;
    137137
    138         for(std::list<StrongPtr<TetrisStone>>::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
    139         {
    140             const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
     138        for(TetrisStone* someStone : this->stones_)
     139        {
     140            const Vector3& currentStonePosition = someStone->getPosition(); //!< Saves the position of the currentStone
    141141
    142142            if((position.x == currentStonePosition.x) && abs(position.y-currentStonePosition.y) < this->center_->getStoneSize())
     
    192192
    193193        // check for collisions with all stones
    194         for(std::list<StrongPtr<TetrisStone>>::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
     194        for(TetrisStone* someStone : this->stones_)
    195195        {
    196196            //Vector3 currentStonePosition = rotateVector((*it)->getPosition(), this->activeBrick_->getRotationCount());
    197             const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
     197            const Vector3& currentStonePosition = someStone->getPosition(); //!< Saves the position of the currentStone
    198198
    199199            //filter out cases where the falling stone is already below a steady stone
Note: See TracChangeset for help on using the changeset viewer.