Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2015, 11:22:03 PM (9 years ago)
Author:
landauf
Message:

use actual types instead of 'auto'. only exception is for complicated template types, e.g. when iterating over a map

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  
    104104        }
    105105
    106         for (auto & elem : this->stones_)
    107             (elem)->destroy();
     106        for (TetrisStone* stone : this->stones_)
     107            stone->destroy();
    108108        this->stones_.clear();
    109109    }
     
    341341    {
    342342        // 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);
    346346    }
    347347   
     
    502502        }
    503503      // 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));
    508508        }
    509509
  • code/branches/cpp11_v2/src/modules/tetris/TetrisBrick.cc

    r10821 r10916  
    239239    {
    240240        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_ ));
    246246        }
    247247        this->brickStones_.clear();
Note: See TracChangeset for help on using the changeset viewer.