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/pong
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/modules/pong/Pong.cc

    r10821 r10916  
    145145
    146146            // If one of the bats is missing, create it. Apply the template for the bats as specified in the centerpoint.
    147             for (auto & elem : this->bat_)
     147            for (WeakPtr<orxonox::PongBat>& bat : this->bat_)
    148148            {
    149                 if (elem == nullptr)
     149                if (bat == nullptr)
    150150                {
    151                     elem = new PongBat(this->center_->getContext());
    152                     elem->addTemplate(this->center_->getBattemplate());
     151                    bat = new PongBat(this->center_->getContext());
     152                    bat->addTemplate(this->center_->getBattemplate());
    153153                }
    154154            }
     
    211211    {
    212212        // first spawn human players to assign always the left bat to the player in singleplayer
    213         for (auto & elem : this->players_)
    214             if (elem.first->isHumanPlayer() && (elem.first->isReadyToSpawn() || this->bForceSpawn_))
    215                 this->spawnPlayer(elem.first);
     213        for (auto& mapEntry : this->players_)
     214            if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
     215                this->spawnPlayer(mapEntry.first);
    216216        // now spawn bots
    217         for (auto & elem : this->players_)
    218             if (!elem.first->isHumanPlayer() && (elem.first->isReadyToSpawn() || this->bForceSpawn_))
    219                 this->spawnPlayer(elem.first);
     217        for (auto& mapEntry : this->players_)
     218            if (!mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
     219                this->spawnPlayer(mapEntry.first);
    220220    }
    221221
  • code/branches/cpp11_v2/src/modules/pong/PongAI.cc

    r10821 r10916  
    7777    PongAI::~PongAI()
    7878    {
    79         for (auto & elem : this->reactionTimers_)
    80             elem.first->destroy();
     79        for (std::pair<Timer*, char>& pair : this->reactionTimers_)
     80            pair.first->destroy();
    8181    }
    8282
Note: See TracChangeset for help on using the changeset viewer.