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/orxonox
Files:
35 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/orxonox/Level.cc

    r10821 r10916  
    106106    void Level::networkCallbackTemplatesChanged()
    107107    {
    108         for(const auto & elem : this->networkTemplateNames_)
    109         {
    110             assert(Template::getTemplate(elem));
    111             Template::getTemplate(elem)->applyOn(this);
     108        for(const std::string& name : this->networkTemplateNames_)
     109        {
     110            assert(Template::getTemplate(name));
     111            Template::getTemplate(name)->applyOn(this);
    112112        }
    113113    }
     
    135135        //       objects alive when ~Level is called. This is the reason why we cannot directly destroy() the Plugins - instead we need
    136136        //       to call destroyLater() to ensure that no instances from this plugin exist anymore.
    137         for (auto & elem : this->plugins_)
    138             (elem)->destroyLater();
     137        for (PluginReference* plugin : this->plugins_)
     138            plugin->destroyLater();
    139139        this->plugins_.clear();
    140140    }
     
    173173    {
    174174        unsigned int i = 0;
    175         for (const auto & elem : this->objects_)
     175        for (BaseObject* object : this->objects_)
    176176        {
    177177            if (i == index)
    178                 return (elem);
     178                return object;
    179179            ++i;
    180180        }
  • code/branches/cpp11_v2/src/orxonox/LevelInfo.cc

    r10821 r10916  
    106106    {
    107107        SubString substr = SubString(tags, ",", " "); // Split the string into tags.
    108         const std::vector<std::string>& strings = substr.getAllStrings();
    109         for (const auto & strings_it : strings)
    110             this->addTag(strings_it, false);
     108        const std::vector<std::string>& tokens = substr.getAllStrings();
     109        for (const std::string& token : tokens)
     110            this->addTag(token, false);
    111111
    112112        this->tagsUpdated();
     
    121121    {
    122122        SubString substr = SubString(ships, ",", " "); // Split the string into tags.
    123         const std::vector<std::string>& strings = substr.getAllStrings();
    124         for(const auto & strings_it : strings)
    125             this->addStartingShip(strings_it, false);
     123        const std::vector<std::string>& tokens = substr.getAllStrings();
     124        for(const std::string& token : tokens)
     125            this->addStartingShip(token, false);
    126126
    127127        this->startingshipsUpdated();
  • code/branches/cpp11_v2/src/orxonox/LevelManager.cc

    r10821 r10916  
    175175            this->levels_.front()->setActive(true);
    176176            // Make every player enter the newly activated level.
    177             for (const auto & elem : PlayerManager::getInstance().getClients())
    178                 this->levels_.front()->playerEntered(elem.second);
     177            for (const auto& mapEntry : PlayerManager::getInstance().getClients())
     178                this->levels_.front()->playerEntered(mapEntry.second);
    179179        }
    180180    }
  • code/branches/cpp11_v2/src/orxonox/Scene.cc

    r10821 r10916  
    220220        {
    221221            // Remove all WorldEntities and shove them to the queue since they would still like to be in a physical world.
    222             for (const auto & elem : this->physicalObjects_)
     222            for (WorldEntity* object : this->physicalObjects_)
    223223            {
    224                 this->physicalWorld_->removeRigidBody((elem)->physicalBody_);
    225                 this->physicalObjectQueue_.insert(elem);
     224                this->physicalWorld_->removeRigidBody(object->physicalBody_);
     225                this->physicalObjectQueue_.insert(object);
    226226            }
    227227            this->physicalObjects_.clear();
     
    255255            {
    256256                // Add all scheduled WorldEntities
    257                 for (const auto & elem : this->physicalObjectQueue_)
     257                for (WorldEntity* object : this->physicalObjectQueue_)
    258258                {
    259                     this->physicalWorld_->addRigidBody((elem)->physicalBody_);
    260                     this->physicalObjects_.insert(elem);
     259                    this->physicalWorld_->addRigidBody(object->physicalBody_);
     260                    this->physicalObjects_.insert(object);
    261261                }
    262262                this->physicalObjectQueue_.clear();
     
    319319    {
    320320        unsigned int i = 0;
    321         for (const auto & elem : this->objects_)
     321        for (BaseObject* object : this->objects_)
    322322        {
    323323            if (i == index)
    324                 return (elem);
     324                return object;
    325325            ++i;
    326326        }
  • code/branches/cpp11_v2/src/orxonox/collisionshapes/CompoundCollisionShape.cc

    r10821 r10916  
    6565        {
    6666            // Delete all children
    67             for (auto & elem : this->attachedShapes_)
     67            for (auto& mapEntry : this->attachedShapes_)
    6868            {
    6969                // make sure that the child doesn't want to detach itself --> speedup because of the missing update
    70                 elem.first->notifyDetached();
    71                 elem.first->destroy();
    72                 if (this->collisionShape_ == elem.second)
     70                mapEntry.first->notifyDetached();
     71                mapEntry.first->destroy();
     72                if (this->collisionShape_ == mapEntry.second)
    7373                    this->collisionShape_ = nullptr; // don't destroy it twice
    7474            }
     
    246246    {
    247247        unsigned int i = 0;
    248         for (const auto & elem : this->attachedShapes_)
     248        for (const auto& mapEntry : this->attachedShapes_)
    249249        {
    250250            if (i == index)
    251                 return elem.first;
     251                return mapEntry.first;
    252252            ++i;
    253253        }
     
    266266        std::vector<CollisionShape*> shapes;
    267267        // Iterate through all attached CollisionShapes and add them to the list of shapes.
    268         for(auto & elem : this->attachedShapes_)
    269             shapes.push_back(elem.first);
     268        for(auto& mapEntry : this->attachedShapes_)
     269            shapes.push_back(mapEntry.first);
    270270
    271271        // Delete the compound shape and create a new one.
     
    274274
    275275        // Re-attach all CollisionShapes.
    276         for(auto shape : shapes)
    277         {
    278            
     276        for(CollisionShape* shape : shapes)
     277        {
    279278            shape->setScale3D(this->getScale3D());
    280279            // Only actually attach if we didn't pick a CompoundCollisionShape with no content.
  • code/branches/cpp11_v2/src/orxonox/controllers/ArtificialController.cc

    r10768 r10916  
    231231    int ArtificialController::getFiremode(std::string name)
    232232    {
    233         for (auto firemode : this->weaponModes_)
    234         {
    235             if (firemode.first == name)
    236                 return firemode.second;
     233        for (auto& mapEntry : this->weaponModes_)
     234        {
     235            if (mapEntry.first == name)
     236                return mapEntry.second;
    237237        }
    238238        return -1;
  • code/branches/cpp11_v2/src/orxonox/controllers/FormationController.cc

    r10821 r10916  
    440440                if(newMaster->slaves_.size() > this->maxFormationSize_) continue;
    441441
    442                 for(auto & elem : this->slaves_)
     442                for(FormationController* slave : this->slaves_)
    443443                {
    444                     (elem)->myMaster_ = newMaster;
    445                     newMaster->slaves_.push_back(elem);
     444                    slave->myMaster_ = newMaster;
     445                    newMaster->slaves_.push_back(slave);
    446446                }
    447447                this->slaves_.clear();
     
    486486            int i = 1;
    487487
    488             for(auto & elem : slaves_)
     488            for(FormationController* slave : slaves_)
    489489            {
    490490                pos = Vector3::ZERO;
     
    497497                    dest+=FORMATION_LENGTH*(orient*WorldEntity::BACK);
    498498                }
    499                 (elem)->setTargetOrientation(orient);
    500                 (elem)->setTargetPosition(pos);
     499                slave->setTargetOrientation(orient);
     500                slave->setTargetPosition(pos);
    501501                left=!left;
    502502            }
     
    569569        if(this->state_ != MASTER) return;
    570570
    571         for(auto & elem : slaves_)
    572         {
    573             (elem)->state_ = FREE;
    574             (elem)->myMaster_ = nullptr;
     571        for(FormationController* slave : slaves_)
     572        {
     573            slave->state_ = FREE;
     574            slave->myMaster_ = nullptr;
    575575        }
    576576        this->slaves_.clear();
     
    584584        if(this->state_ != MASTER) return;
    585585
    586         for(auto & elem : slaves_)
    587         {
    588             (elem)->state_ = FREE;
    589             (elem)->forceFreedom();
    590             (elem)->targetPosition_ = this->targetPosition_;
    591             (elem)->bShooting_ = true;
     586        for(FormationController* slave : slaves_)
     587        {
     588            slave->state_ = FREE;
     589            slave->forceFreedom();
     590            slave->targetPosition_ = this->targetPosition_;
     591            slave->bShooting_ = true;
    592592//             (*it)->getControllableEntity()->fire(0);// fire once for fun
    593593        }
     
    650650            this->slaves_.push_back(this->myMaster_);
    651651            //set this as new master
    652             for(auto & elem : slaves_)
    653             {
    654                  (elem)->myMaster_=this;
     652            for(FormationController* slave : slaves_)
     653            {
     654                 slave->myMaster_=this;
    655655            }
    656656            this->myMaster_=nullptr;
     
    694694        if (this->state_ == MASTER)
    695695        {
    696             for(auto & elem : slaves_)
    697             {
    698                  (elem)->formationMode_ = val;
     696            for(FormationController* slave : slaves_)
     697            {
     698                 slave->formationMode_ = val;
    699699                 if (val == ATTACK)
    700                      (elem)->forgetTarget();
     700                     slave->forgetTarget();
    701701            }
    702702        }
  • code/branches/cpp11_v2/src/orxonox/controllers/WaypointController.cc

    r10821 r10916  
    4444    WaypointController::~WaypointController()
    4545    {
    46         for (auto & elem : this->waypoints_)
     46        for (WorldEntity* waypoint : this->waypoints_)
    4747        {
    48             if(elem)
    49                 elem->destroy();
     48            if(waypoint)
     49                waypoint->destroy();
    5050        }
    5151    }
  • code/branches/cpp11_v2/src/orxonox/gamestates/GSLevel.cc

    r10821 r10916  
    251251
    252252        // delete states
    253         for (auto & state : states)
     253        for (GSLevelMementoState* state : states)
    254254            delete state;
    255255    }
  • code/branches/cpp11_v2/src/orxonox/gametypes/Dynamicmatch.cc

    r10821 r10916  
    405405    void Dynamicmatch::rewardPig()
    406406    {
    407         for (auto & elem : this->playerParty_) //durch alle Spieler iterieren und alle piggys finden
    408         {
    409             if (elem.second==piggy)//Spieler mit der Pig-party frags++
    410             {
    411                  this->playerScored(elem.first);
     407        for (auto& mapEntry : this->playerParty_) //durch alle Spieler iterieren und alle piggys finden
     408        {
     409            if (mapEntry.second==piggy)//Spieler mit der Pig-party frags++
     410            {
     411                 this->playerScored(mapEntry.first);
    412412            }
    413413        }
     
    422422
    423423                std::set<WorldEntity*> pawnAttachments = pawn->getAttachedObjects();
    424                 for (const auto & pawnAttachment : pawnAttachments)
    425                 {
    426                     if ((pawnAttachment)->isA(Class(TeamColourable)))
     424                for (WorldEntity* pawnAttachment : pawnAttachments)
     425                {
     426                    if (pawnAttachment->isA(Class(TeamColourable)))
    427427                    {
    428428                        TeamColourable* tc = orxonox_cast<TeamColourable*>(pawnAttachment);
     
    441441            if (tutorial) // Announce selectionphase
    442442            {
    443              for (auto & elem : this->playerParty_)
    444                 {
    445                     if (!elem.first)//in order to catch nullpointer
     443             for (auto& mapEntry : this->playerParty_)
     444                {
     445                    if (!mapEntry.first)//in order to catch nullpointer
    446446                        continue;
    447                     if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
     447                    if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    448448                        continue;
    449                     this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",elem.first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
     449                    this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",mapEntry.first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
    450450                }
    451451            }
     
    456456             if(tutorial&&(!notEnoughKillers)&&(!notEnoughChasers)) //Selection phase over
    457457             {
    458                   for (auto & elem : this->playerParty_)
     458                  for (auto& mapEntry : this->playerParty_)
    459459                  {
    460                        if (!elem.first)//in order to catch nullpointer
     460                       if (!mapEntry.first)//in order to catch nullpointer
    461461                           continue;
    462                        if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
     462                       if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    463463                           continue;
    464                        else if (elem.second==chaser)
     464                       else if (mapEntry.second==chaser)
    465465                       {
    466466                           if (numberOf[killer]>0)
    467                                this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible. Defend yourself against the killers.",elem.first->getClientID(),partyColours_[piggy]);
     467                               this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible. Defend yourself against the killers.",mapEntry.first->getClientID(),partyColours_[piggy]);
    468468                           else
    469                                this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible.",elem.first->getClientID(),partyColours_[piggy]);
     469                               this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible.",mapEntry.first->getClientID(),partyColours_[piggy]);
    470470                           //this->gtinfo_->sendFadingMessage("You're now a chaser.",it->first->getClientID());
    471471                       }
    472                        else if (elem.second==piggy)
    473                        {
    474                            this->gtinfo_->sendStaticMessage("Either hide or shoot a chaser.",elem.first->getClientID(),partyColours_[chaser]);
     472                       else if (mapEntry.second==piggy)
     473                       {
     474                           this->gtinfo_->sendStaticMessage("Either hide or shoot a chaser.",mapEntry.first->getClientID(),partyColours_[chaser]);
    475475                           //this->gtinfo_->sendFadingMessage("You're now a victim.",it->first->getClientID());
    476476                       }
    477                        else if (elem.second==killer)
    478                        {
    479                            this->gtinfo_->sendStaticMessage("Take the chasers down.",elem.first->getClientID(),partyColours_[chaser]);
     477                       else if (mapEntry.second==killer)
     478                       {
     479                           this->gtinfo_->sendStaticMessage("Take the chasers down.",mapEntry.first->getClientID(),partyColours_[chaser]);
    480480                           //this->gtinfo_->sendFadingMessage("You're now a killer.",it->first->getClientID());
    481481                       }
     
    490490            if (tutorial) // Announce selectionphase
    491491            {
    492              for (auto & elem : this->playerParty_)
    493                 {
    494                     if (!elem.first)//in order to catch nullpointer
     492             for (auto& mapEntry : this->playerParty_)
     493                {
     494                    if (!mapEntry.first)//in order to catch nullpointer
    495495                        continue;
    496                     if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
     496                    if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    497497                        continue;
    498                     this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",elem.first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
     498                    this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",mapEntry.first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
    499499                }
    500500            }
     
    505505            if(tutorial&&(!notEnoughPigs)&&(!notEnoughChasers)) //Selection phase over
    506506             {
    507                   for (auto & elem : this->playerParty_)
     507                  for (auto& mapEntry : this->playerParty_)
    508508                  {
    509                        if (!elem.first)
     509                       if (!mapEntry.first)
    510510                           continue;
    511                        if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
     511                       if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    512512                           continue;
    513                        else if (elem.second==chaser)
     513                       else if (mapEntry.second==chaser)
    514514                       {
    515515                           if (numberOf[killer]>0)
    516                                this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible. Defend yourself against the killers.",elem.first->getClientID(),partyColours_[piggy]);
     516                               this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible. Defend yourself against the killers.",mapEntry.first->getClientID(),partyColours_[piggy]);
    517517                           else
    518                                this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible.",elem.first->getClientID(),partyColours_[piggy]);
     518                               this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible.",mapEntry.first->getClientID(),partyColours_[piggy]);
    519519                           //this->gtinfo_->sendFadingMessage("You're now a chaser.",it->first->getClientID());
    520520                       }
    521                        else if (elem.second==piggy)
    522                        {
    523                            this->gtinfo_->sendStaticMessage("Either hide or shoot a chaser.",elem.first->getClientID(),partyColours_[piggy]);
     521                       else if (mapEntry.second==piggy)
     522                       {
     523                           this->gtinfo_->sendStaticMessage("Either hide or shoot a chaser.",mapEntry.first->getClientID(),partyColours_[piggy]);
    524524                           //this->gtinfo_->sendFadingMessage("You're now a victim.",it->first->getClientID());
    525525                       }
    526                        else if (elem.second==killer)
    527                        {
    528                            this->gtinfo_->sendStaticMessage("Take the chasers down.",elem.first->getClientID(),partyColours_[piggy]);
     526                       else if (mapEntry.second==killer)
     527                       {
     528                           this->gtinfo_->sendStaticMessage("Take the chasers down.",mapEntry.first->getClientID(),partyColours_[piggy]);
    529529                           //this->gtinfo_->sendFadingMessage("You're now a killer.",it->first->getClientID());
    530530                       }
     
    540540            if (tutorial) // Announce selectionphase
    541541            {
    542              for (auto & elem : this->playerParty_)
    543                 {
    544                     if (!elem.first)//in order to catch nullpointer
     542             for (auto& mapEntry : this->playerParty_)
     543                {
     544                    if (!mapEntry.first)//in order to catch nullpointer
    545545                        continue;
    546                     if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
     546                    if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    547547                        continue;
    548                     this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",elem.first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
     548                    this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",mapEntry.first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
    549549                }
    550550            }
     
    555555             if(tutorial&&(!notEnoughPigs)&&(!notEnoughKillers)) //Selection phase over
    556556             {
    557                   for (auto & elem : this->playerParty_)
     557                  for (auto& mapEntry : this->playerParty_)
    558558                  {
    559                        if (!elem.first)
     559                       if (!mapEntry.first)
    560560                           continue;
    561                        if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
     561                       if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    562562                           continue;
    563                        else if (elem.second==chaser)
     563                       else if (mapEntry.second==chaser)
    564564                       {
    565565                           if (numberOf[killer]>0)
    566                                this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible. Defend yourself against the killers.",elem.first->getClientID(),partyColours_[piggy]);
     566                               this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible. Defend yourself against the killers.",mapEntry.first->getClientID(),partyColours_[piggy]);
    567567                           else
    568                                this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible.",elem.first->getClientID(),partyColours_[piggy]);
     568                               this->gtinfo_->sendStaticMessage("Shoot at the victim as often as possible.",mapEntry.first->getClientID(),partyColours_[piggy]);
    569569                           //this->gtinfo_->sendFadingMessage("You're now a chaser.",it->first->getClientID());
    570570                       }
    571                        else if (elem.second==piggy)
    572                        {
    573                            this->gtinfo_->sendStaticMessage("Either hide or shoot a chaser.",elem.first->getClientID(),partyColours_[chaser]);
     571                       else if (mapEntry.second==piggy)
     572                       {
     573                           this->gtinfo_->sendStaticMessage("Either hide or shoot a chaser.",mapEntry.first->getClientID(),partyColours_[chaser]);
    574574                           //this->gtinfo_->sendFadingMessage("You're now a victim.",it->first->getClientID());
    575575                       }
    576                        else if (elem.second==killer)
    577                        {
    578                            this->gtinfo_->sendStaticMessage("Take the chasers down.",elem.first->getClientID(),partyColours_[chaser]);
     576                       else if (mapEntry.second==killer)
     577                       {
     578                           this->gtinfo_->sendStaticMessage("Take the chasers down.",mapEntry.first->getClientID(),partyColours_[chaser]);
    579579                           //this->gtinfo_->sendFadingMessage("You're now a killer.",it->first->getClientID());
    580580                       }
     
    620620        else if(tutorial) // Announce selectionphase
    621621        {
    622             for (auto & elem : this->playerParty_)
    623             {
    624                 if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
     622            for (auto& mapEntry : this->playerParty_)
     623            {
     624                if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    625625                    continue;
    626                 this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",elem.first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
     626                this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",mapEntry.first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
    627627            }
    628628        }
     
    676676            unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size())));
    677677            unsigned int index = 0;
    678             for (const auto & teamSpawnPoint : teamSpawnPoints)
     678            for (SpawnPoint* teamSpawnPoint : teamSpawnPoints)
    679679            {
    680680                if (index == randomspawn)
    681                     return (teamSpawnPoint);
     681                    return teamSpawnPoint;
    682682
    683683                ++index;
  • code/branches/cpp11_v2/src/orxonox/gametypes/Gametype.cc

    r10821 r10916  
    139139        if (!this->gtinfo_->hasStarted())
    140140        {
    141             for (auto & elem : this->players_)
     141            for (auto& mapEntry : this->players_)
    142142            {
    143143                // Inform the GametypeInfo that the player is ready to spawn.
    144                 if(elem.first->isHumanPlayer() && elem.first->isReadyToSpawn())
    145                     this->gtinfo_->playerReadyToSpawn(elem.first);
     144                if(mapEntry.first->isHumanPlayer() && mapEntry.first->isReadyToSpawn())
     145                    this->gtinfo_->playerReadyToSpawn(mapEntry.first);
    146146            }
    147147
     
    169169        }
    170170
    171         for (auto & elem : this->players_)
    172         {
    173             if (elem.first->getControllableEntity())
    174             {
    175                 ControllableEntity* oldentity = elem.first->getControllableEntity();
     171        for (auto& mapEntry : this->players_)
     172        {
     173            if (mapEntry.first->getControllableEntity())
     174            {
     175                ControllableEntity* oldentity = mapEntry.first->getControllableEntity();
    176176
    177177                ControllableEntity* entity = this->defaultControllableEntity_.fabricate(oldentity->getContext());
     
    186186                    entity->setOrientation(oldentity->getWorldOrientation());
    187187                }
    188                 elem.first->startControl(entity);
     188                mapEntry.first->startControl(entity);
    189189            }
    190190            else
    191                 this->spawnPlayerAsDefaultPawn(elem.first);
     191                this->spawnPlayerAsDefaultPawn(mapEntry.first);
    192192        }
    193193    }
     
    341341            unsigned int index = 0;
    342342            std::vector<SpawnPoint*> activeSpawnPoints;
    343             for (const auto & elem : this->spawnpoints_)
     343            for (SpawnPoint* spawnpoint : this->spawnpoints_)
    344344            {
    345345                if (index == randomspawn)
    346                     fallbackSpawnPoint = (elem);
    347 
    348                 if (elem != nullptr && (elem)->isActive())
    349                     activeSpawnPoints.push_back(elem);
     346                    fallbackSpawnPoint = spawnpoint;
     347
     348                if (spawnpoint != nullptr && spawnpoint->isActive())
     349                    activeSpawnPoints.push_back(spawnpoint);
    350350
    351351                ++index;
     
    366366    void Gametype::assignDefaultPawnsIfNeeded()
    367367    {
    368         for (auto & elem : this->players_)
    369         {
    370             if (!elem.first->getControllableEntity())
    371             {
    372                 elem.second.state_ = PlayerState::Dead;
    373 
    374                 if (!elem.first->isReadyToSpawn() || !this->gtinfo_->hasStarted())
    375                 {
    376                     this->spawnPlayerAsDefaultPawn(elem.first);
    377                     elem.second.state_ = PlayerState::Dead;
     368        for (auto& mapEntry : this->players_)
     369        {
     370            if (!mapEntry.first->getControllableEntity())
     371            {
     372                mapEntry.second.state_ = PlayerState::Dead;
     373
     374                if (!mapEntry.first->isReadyToSpawn() || !this->gtinfo_->hasStarted())
     375                {
     376                    this->spawnPlayerAsDefaultPawn(mapEntry.first);
     377                    mapEntry.second.state_ = PlayerState::Dead;
    378378                }
    379379            }
     
    404404                    bool allplayersready = true;
    405405                    bool hashumanplayers = false;
    406                     for (auto & elem : this->players_)
     406                    for (auto& mapEntry : this->players_)
    407407                    {
    408                         if (!elem.first->isReadyToSpawn())
     408                        if (!mapEntry.first->isReadyToSpawn())
    409409                            allplayersready = false;
    410                         if (elem.first->isHumanPlayer())
     410                        if (mapEntry.first->isHumanPlayer())
    411411                            hashumanplayers = true;
    412412                    }
     
    430430    void Gametype::spawnPlayersIfRequested()
    431431    {
    432         for (auto & elem : this->players_)
    433         {
    434             if (elem.first->isReadyToSpawn() || this->bForceSpawn_)
    435                 this->spawnPlayer(elem.first);
     432        for (auto& mapEntry : this->players_)
     433        {
     434            if (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_)
     435                this->spawnPlayer(mapEntry.first);
    436436        }
    437437    }
     
    439439    void Gametype::spawnDeadPlayersIfRequested()
    440440    {
    441         for (auto & elem : this->players_)
    442             if (elem.second.state_ == PlayerState::Dead)
    443                 if (elem.first->isReadyToSpawn() || this->bForceSpawn_)
    444                     this->spawnPlayer(elem.first);
     441        for (auto& mapEntry : this->players_)
     442            if (mapEntry.second.state_ == PlayerState::Dead)
     443                if (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_)
     444                    this->spawnPlayer(mapEntry.first);
    445445    }
    446446
     
    538538    GSLevelMementoState* Gametype::exportMementoState()
    539539    {
    540         for (auto & elem : this->players_)
    541         {
    542             if (elem.first->isHumanPlayer() && elem.first->getControllableEntity() && elem.first->getControllableEntity()->getCamera())
    543             {
    544                 Camera* camera = elem.first->getControllableEntity()->getCamera();
     540        for (auto& mapEntry : this->players_)
     541        {
     542            if (mapEntry.first->isHumanPlayer() && mapEntry.first->getControllableEntity() && mapEntry.first->getControllableEntity()->getCamera())
     543            {
     544                Camera* camera = mapEntry.first->getControllableEntity()->getCamera();
    545545
    546546                GametypeMementoState* state = new GametypeMementoState();
     
    559559        // find correct memento state
    560560        GametypeMementoState* state = nullptr;
    561         for (auto & states_i : states)
    562         {
    563             state = dynamic_cast<GametypeMementoState*>(states_i);
     561        for (GSLevelMementoState* temp : states)
     562        {
     563            state = dynamic_cast<GametypeMementoState*>(temp);
    564564            if (state)
    565565                break;
     
    587587
    588588        // find correct player and assign default entity with original position & orientation
    589         for (auto & elem : this->players_)
    590         {
    591             if (elem.first->isHumanPlayer())
     589        for (auto& mapEntry : this->players_)
     590        {
     591            if (mapEntry.first->isHumanPlayer())
    592592            {
    593593                ControllableEntity* entity = this->defaultControllableEntity_.fabricate(scene->getContext());
    594594                entity->setPosition(state->cameraPosition_);
    595595                entity->setOrientation(state->cameraOrientation_);
    596                 elem.first->startControl(entity);
     596                mapEntry.first->startControl(entity);
    597597                break;
    598598            }
  • code/branches/cpp11_v2/src/orxonox/gametypes/LastManStanding.cc

    r10821 r10916  
    5656    void LastManStanding::spawnDeadPlayersIfRequested()
    5757    {
    58         for (auto & elem : this->players_)
    59             if (elem.second.state_ == PlayerState::Dead)
    60             {
    61                 bool alive = (0<playerLives_[elem.first]&&(inGame_[elem.first]));
    62                 if (alive&&(elem.first->isReadyToSpawn() || this->bForceSpawn_))
    63                 {
    64                     this->spawnPlayer(elem.first);
     58        for (auto& mapEntry : this->players_)
     59            if (mapEntry.second.state_ == PlayerState::Dead)
     60            {
     61                bool alive = (0<playerLives_[mapEntry.first]&&(inGame_[mapEntry.first]));
     62                if (alive&&(mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
     63                {
     64                    this->spawnPlayer(mapEntry.first);
    6565                }
    6666            }
     
    114114    {
    115115        int min=lives;
    116         for (auto & elem : this->playerLives_)
    117         {
    118             if (elem.second<=0)
     116        for (auto& mapEntry : this->playerLives_)
     117        {
     118            if (mapEntry.second<=0)
    119119                continue;
    120             if (elem.second<lives)
    121                 min=elem.second;
     120            if (mapEntry.second<lives)
     121                min=mapEntry.second;
    122122        }
    123123        return min;
     
    128128        Gametype::end();
    129129
    130         for (auto & elem : this->playerLives_)
    131         {
    132             if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
     130        for (auto& mapEntry : this->playerLives_)
     131        {
     132            if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    133133                continue;
    134134
    135             if (elem.second > 0)
    136                 this->gtinfo_->sendAnnounceMessage("You have won the match!", elem.first->getClientID());
     135            if (mapEntry.second > 0)
     136                this->gtinfo_->sendAnnounceMessage("You have won the match!", mapEntry.first->getClientID());
    137137            else
    138                 this->gtinfo_->sendAnnounceMessage("You have lost the match!", elem.first->getClientID());
     138                this->gtinfo_->sendAnnounceMessage("You have lost the match!", mapEntry.first->getClientID());
    139139        }
    140140    }
     
    237237                this->end();
    238238            }
    239             for (auto & elem : this->timeToAct_)
    240             {
    241                 if (playerGetLives(elem.first)<=0)//Players without lives shouldn't be affected by time.
     239            for (auto& mapEntry : this->timeToAct_)
     240            {
     241                if (playerGetLives(mapEntry.first)<=0)//Players without lives shouldn't be affected by time.
    242242                    continue;
    243                 elem.second-=dt;//Decreases punishment time.
    244                 if (!inGame_[elem.first])//Manages respawn delay - player is forced to respawn after the delaytime is used up.
    245                 {
    246                     playerDelayTime_[elem.first]-=dt;
    247                     if (playerDelayTime_[elem.first]<=0)
    248                     this->inGame_[elem.first]=true;
    249 
    250                     if (elem.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
     243                mapEntry.second-=dt;//Decreases punishment time.
     244                if (!inGame_[mapEntry.first])//Manages respawn delay - player is forced to respawn after the delaytime is used up.
     245                {
     246                    playerDelayTime_[mapEntry.first]-=dt;
     247                    if (playerDelayTime_[mapEntry.first]<=0)
     248                    this->inGame_[mapEntry.first]=true;
     249
     250                    if (mapEntry.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
    251251                        continue;
    252                     int output=1+(int)playerDelayTime_[elem.first];
     252                    int output=1+(int)playerDelayTime_[mapEntry.first];
    253253                    const std::string& message = "Respawn in " +multi_cast<std::string>(output)+ " seconds." ;//Countdown
    254                     this->gtinfo_->sendFadingMessage(message,elem.first->getClientID());
    255                 }
    256                 else if (elem.second<0.0f)
    257                 {
    258                     elem.second=timeRemaining+3.0f;//reset punishment-timer
    259                     if (playerGetLives(elem.first)>0)
     254                    this->gtinfo_->sendFadingMessage(message,mapEntry.first->getClientID());
     255                }
     256                else if (mapEntry.second<0.0f)
     257                {
     258                    mapEntry.second=timeRemaining+3.0f;//reset punishment-timer
     259                    if (playerGetLives(mapEntry.first)>0)
    260260                    {
    261                         this->punishPlayer(elem.first);
    262                         if (elem.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
     261                        this->punishPlayer(mapEntry.first);
     262                        if (mapEntry.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
    263263                            return;
    264264                        const std::string& message = ""; // resets Camper-Warning-message
    265                         this->gtinfo_->sendFadingMessage(message,elem.first->getClientID());
     265                        this->gtinfo_->sendFadingMessage(message,mapEntry.first->getClientID());
    266266                    }
    267267                }
    268                 else if (elem.second<timeRemaining/5)//Warning message
    269                 {
    270                     if (elem.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
     268                else if (mapEntry.second<timeRemaining/5)//Warning message
     269                {
     270                    if (mapEntry.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
    271271                        continue;
    272272                    const std::string& message = "Camper Warning! Don't forget to shoot.";
    273                     this->gtinfo_->sendFadingMessage(message,elem.first->getClientID());
     273                    this->gtinfo_->sendFadingMessage(message,mapEntry.first->getClientID());
    274274                }
    275275            }
  • code/branches/cpp11_v2/src/orxonox/gametypes/LastTeamStanding.cc

    r10821 r10916  
    145145    void LastTeamStanding::spawnDeadPlayersIfRequested()
    146146    {
    147         for (auto & elem : this->players_)
    148             if (elem.second.state_ == PlayerState::Dead)
    149             {
    150                 bool alive = (0 < playerLives_[elem.first]&&(inGame_[elem.first]));
    151                 if (alive&&(elem.first->isReadyToSpawn() || this->bForceSpawn_))
    152                 {
    153                     this->spawnPlayer(elem.first);
     147        for (auto& mapEntry : this->players_)
     148            if (mapEntry.second.state_ == PlayerState::Dead)
     149            {
     150                bool alive = (0 < playerLives_[mapEntry.first]&&(inGame_[mapEntry.first]));
     151                if (alive&&(mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
     152                {
     153                    this->spawnPlayer(mapEntry.first);
    154154                }
    155155            }
     
    184184                this->end();
    185185            }
    186             for (auto & elem : this->timeToAct_)
    187             {
    188                 if (playerGetLives(elem.first) <= 0)//Players without lives shouldn't be affected by time.
     186            for (auto& mapEntry : this->timeToAct_)
     187            {
     188                if (playerGetLives(mapEntry.first) <= 0)//Players without lives shouldn't be affected by time.
    189189                    continue;
    190                 elem.second -= dt;//Decreases punishment time.
    191                 if (!inGame_[elem.first])//Manages respawn delay - player is forced to respawn after the delaytime is used up.
    192                 {
    193                     playerDelayTime_[elem.first] -= dt;
    194                     if (playerDelayTime_[elem.first] <= 0)
    195                     this->inGame_[elem.first] = true;
    196 
    197                     if (elem.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
     190                mapEntry.second -= dt;//Decreases punishment time.
     191                if (!inGame_[mapEntry.first])//Manages respawn delay - player is forced to respawn after the delaytime is used up.
     192                {
     193                    playerDelayTime_[mapEntry.first] -= dt;
     194                    if (playerDelayTime_[mapEntry.first] <= 0)
     195                    this->inGame_[mapEntry.first] = true;
     196
     197                    if (mapEntry.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
    198198                        continue;
    199                     int output = 1 + (int)playerDelayTime_[elem.first];
     199                    int output = 1 + (int)playerDelayTime_[mapEntry.first];
    200200                    const std::string& message = "Respawn in " +multi_cast<std::string>(output)+ " seconds." ;//Countdown
    201                     this->gtinfo_->sendFadingMessage(message,elem.first->getClientID());
    202                 }
    203                 else if (elem.second < 0.0f)
    204                 {
    205                     elem.second = timeRemaining + 3.0f;//reset punishment-timer
    206                     if (playerGetLives(elem.first) > 0)
     201                    this->gtinfo_->sendFadingMessage(message,mapEntry.first->getClientID());
     202                }
     203                else if (mapEntry.second < 0.0f)
     204                {
     205                    mapEntry.second = timeRemaining + 3.0f;//reset punishment-timer
     206                    if (playerGetLives(mapEntry.first) > 0)
    207207                    {
    208                         this->punishPlayer(elem.first);
    209                         if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
     208                        this->punishPlayer(mapEntry.first);
     209                        if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    210210                            return;
    211211                        const std::string& message = ""; // resets Camper-Warning-message
    212                         this->gtinfo_->sendFadingMessage(message, elem.first->getClientID());
     212                        this->gtinfo_->sendFadingMessage(message, mapEntry.first->getClientID());
    213213                    }
    214214                }
    215                 else if (elem.second < timeRemaining/5)//Warning message
    216                 {
    217                   if (elem.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
     215                else if (mapEntry.second < timeRemaining/5)//Warning message
     216                {
     217                  if (mapEntry.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
    218218                        continue;
    219219                    const std::string& message = "Camper Warning! Don't forget to shoot.";
    220                     this->gtinfo_->sendFadingMessage(message, elem.first->getClientID());
     220                    this->gtinfo_->sendFadingMessage(message, mapEntry.first->getClientID());
    221221                }
    222222            }
     
    229229        int party = -1;
    230230        //find a player who survived
    231         for (auto & elem : this->playerLives_)
    232         {
    233           if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
     231        for (auto& mapEntry : this->playerLives_)
     232        {
     233          if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    234234                continue;
    235235
    236             if (elem.second > 0)//a player that is alive
     236            if (mapEntry.second > 0)//a player that is alive
    237237            {
    238238                //which party has survived?
    239                 std::map<PlayerInfo*, int>::iterator it2 = this->teamnumbers_.find(elem.first);
     239                std::map<PlayerInfo*, int>::iterator it2 = this->teamnumbers_.find(mapEntry.first);
    240240                if (it2 != this->teamnumbers_.end())
    241241                {
     
    255255    {
    256256        int min = lives;
    257         for (auto & elem : this->playerLives_)
    258         {
    259             if (elem.second <= 0)
     257        for (auto& mapEntry : this->playerLives_)
     258        {
     259            if (mapEntry.second <= 0)
    260260                continue;
    261             if (elem.second < lives)
    262                 min = elem.second;
     261            if (mapEntry.second < lives)
     262                min = mapEntry.second;
    263263        }
    264264        return min;
  • code/branches/cpp11_v2/src/orxonox/gametypes/TeamBaseMatch.cc

    r10821 r10916  
    152152        int amountControlled2 = 0;
    153153
    154         for (const auto & elem : this->bases_)
    155         {
    156             if((elem)->getState() == BaseState::ControlTeam1)
     154        for (TeamBaseMatchBase* base : this->bases_)
     155        {
     156            if(base->getState() == BaseState::ControlTeam1)
    157157            {
    158158                amountControlled++;
    159159            }
    160             if((elem)->getState() == BaseState::ControlTeam2)
     160            if(base->getState() == BaseState::ControlTeam2)
    161161            {
    162162                amountControlled2++;
     
    187187            }
    188188
    189             for (auto & elem : this->teamnumbers_)
    190             {
    191                 if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
     189            for (auto& mapEntry : this->teamnumbers_)
     190            {
     191                if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    192192                    continue;
    193193
    194                 if (elem.second == winningteam)
    195                     this->gtinfo_->sendAnnounceMessage("You have won the match!", elem.first->getClientID());
     194                if (mapEntry.second == winningteam)
     195                    this->gtinfo_->sendAnnounceMessage("You have won the match!", mapEntry.first->getClientID());
    196196                else
    197                     this->gtinfo_->sendAnnounceMessage("You have lost the match!", elem.first->getClientID());
     197                    this->gtinfo_->sendAnnounceMessage("You have lost the match!", mapEntry.first->getClientID());
    198198            }
    199199
     
    238238        int count = 0;
    239239
    240         for (const auto & elem : this->bases_)
    241         {
    242             if ((elem)->getState() == BaseState::ControlTeam1 && team == 0)
     240        for (TeamBaseMatchBase* base : this->bases_)
     241        {
     242            if (base->getState() == BaseState::ControlTeam1 && team == 0)
    243243                count++;
    244             if ((elem)->getState() == BaseState::ControlTeam2 && team == 1)
     244            if (base->getState() == BaseState::ControlTeam2 && team == 1)
    245245                count++;
    246246        }
     
    258258    {
    259259        unsigned int i = 0;
    260         for (const auto & elem : this->bases_)
     260        for (TeamBaseMatchBase* base : this->bases_)
    261261        {
    262262            i++;
    263263            if (i > index)
    264                 return (elem);
     264                return base;
    265265        }
    266266        return nullptr;
  • code/branches/cpp11_v2/src/orxonox/gametypes/TeamDeathmatch.cc

    r10821 r10916  
    6969        int winnerTeam = 0;
    7070        int highestScore = 0;
    71         for (auto & elem : this->players_)
     71        for (auto& mapEntry : this->players_)
    7272        {
    73             if ( this->getTeamScore(elem.first) > highestScore )
     73            if ( this->getTeamScore(mapEntry.first) > highestScore )
    7474            {
    75                 winnerTeam = this->getTeam(elem.first);
    76                 highestScore = this->getTeamScore(elem.first);
     75                winnerTeam = this->getTeam(mapEntry.first);
     76                highestScore = this->getTeamScore(mapEntry.first);
    7777            }
    7878        }
  • code/branches/cpp11_v2/src/orxonox/gametypes/TeamGametype.cc

    r10821 r10916  
    9999        std::vector<unsigned int> playersperteam(this->teams_, 0);
    100100
    101         for (auto & elem : this->teamnumbers_)
    102             if (elem.second < static_cast<int>(this->teams_) && elem.second >= 0)
    103                 playersperteam[elem.second]++;
     101        for (auto& mapEntry : this->teamnumbers_)
     102            if (mapEntry.second < static_cast<int>(this->teams_) && mapEntry.second >= 0)
     103                playersperteam[mapEntry.second]++;
    104104
    105105        unsigned int minplayers = static_cast<unsigned int>(-1);
     
    123123        if( (this->players_.size() >= maxPlayers_) && (allowedInGame_[player] == true) ) // if there's a "waiting list"
    124124        {
    125             for (auto & elem : this->allowedInGame_)
    126             {
    127                  if(elem.second == false) // waiting player found
    128                  {elem.second = true; break;} // allow player to enter
     125            for (auto& mapEntry : this->allowedInGame_)
     126            {
     127                 if(mapEntry.second == false) // waiting player found
     128                 {mapEntry.second = true; break;} // allow player to enter
    129129            }
    130130        }
     
    141141    void TeamGametype::spawnDeadPlayersIfRequested()
    142142    {
    143         for (auto & elem : this->players_)\
    144         {
    145             if(allowedInGame_[elem.first] == false)//check if dead player is allowed to enter
     143        for (auto& mapEntry : this->players_)\
     144        {
     145            if(allowedInGame_[mapEntry.first] == false)//check if dead player is allowed to enter
    146146            {
    147147                continue;
    148148            }
    149             if (elem.second.state_ == PlayerState::Dead)
    150             {
    151                 if ((elem.first->isReadyToSpawn() || this->bForceSpawn_))
     149            if (mapEntry.second.state_ == PlayerState::Dead)
     150            {
     151                if ((mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
    152152                {
    153                    this->spawnPlayer(elem.first);
     153                   this->spawnPlayer(mapEntry.first);
    154154                }
    155155            }
     
    178178        if(!player || this->getTeam(player) == -1)
    179179            return 0;
    180         for (auto & elem : this->players_)
    181         {
    182             if ( this->getTeam(elem.first) ==  this->getTeam(player) )
    183             {
    184                 teamscore += elem.second.frags_;
     180        for (auto& mapEntry : this->players_)
     181        {
     182            if ( this->getTeam(mapEntry.first) ==  this->getTeam(player) )
     183            {
     184                teamscore += mapEntry.second.frags_;
    185185            }
    186186        }
     
    191191    {
    192192        int teamSize = 0;
    193         for (auto & elem : this->teamnumbers_)
    194         {
    195             if (elem.second == team)
     193        for (auto& mapEntry : this->teamnumbers_)
     194        {
     195            if (mapEntry.second == team)
    196196                teamSize++;
    197197        }
     
    202202    {
    203203        int teamSize = 0;
    204         for (auto & elem : this->teamnumbers_)
    205         {
    206             if (elem.second == team  && elem.first->isHumanPlayer())
     204        for (auto& mapEntry : this->teamnumbers_)
     205        {
     206            if (mapEntry.second == team  && mapEntry.first->isHumanPlayer())
    207207                teamSize++;
    208208        }
     
    241241            unsigned int index = 0;
    242242            // Get random fallback spawnpoint in case there is no active SpawnPoint.
    243             for (const auto & teamSpawnPoint : teamSpawnPoints)
     243            for (SpawnPoint* teamSpawnPoint : teamSpawnPoints)
    244244            {
    245245                if (index == randomspawn)
    246246                {
    247                     fallbackSpawnPoint = (teamSpawnPoint);
     247                    fallbackSpawnPoint = teamSpawnPoint;
    248248                    break;
    249249                }
     
    266266            randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size())));
    267267            index = 0;
    268             for (const auto & teamSpawnPoint : teamSpawnPoints)
     268            for (SpawnPoint* teamSpawnPoint : teamSpawnPoints)
    269269            {
    270270                if (index == randomspawn)
    271                     return (teamSpawnPoint);
     271                    return teamSpawnPoint;
    272272
    273273                ++index;
     
    364364
    365365        std::set<WorldEntity*> pawnAttachments = pawn->getAttachedObjects();
    366         for (const auto & pawnAttachment : pawnAttachments)
    367         {
    368             if ((pawnAttachment)->isA(Class(TeamColourable)))
     366        for (WorldEntity* pawnAttachment : pawnAttachments)
     367        {
     368            if (pawnAttachment->isA(Class(TeamColourable)))
    369369            {
    370370                TeamColourable* tc = orxonox_cast<TeamColourable*>(pawnAttachment);
     
    376376    void TeamGametype::announceTeamWin(int winnerTeam)
    377377    {
    378         for (auto & elem : this->teamnumbers_)
    379         {
    380             if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
     378        for (auto& mapEntry : this->teamnumbers_)
     379        {
     380            if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    381381                continue;
    382             if (elem.second == winnerTeam)
    383             {
    384                 this->gtinfo_->sendAnnounceMessage("Your team has won the match!", elem.first->getClientID());
     382            if (mapEntry.second == winnerTeam)
     383            {
     384                this->gtinfo_->sendAnnounceMessage("Your team has won the match!", mapEntry.first->getClientID());
    385385            }
    386386            else
    387387            {
    388                 this->gtinfo_->sendAnnounceMessage("Your team has lost the match!", elem.first->getClientID());
     388                this->gtinfo_->sendAnnounceMessage("Your team has lost the match!", mapEntry.first->getClientID());
    389389            }
    390390        }   
  • code/branches/cpp11_v2/src/orxonox/gametypes/UnderAttack.cc

    r10821 r10916  
    7474        this->gameEnded_ = true;
    7575
    76         for (auto & elem : this->teamnumbers_)
    77         {
    78             if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
     76        for (auto& mapEntry : this->teamnumbers_)
     77        {
     78            if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    7979                continue;
    8080
    81             if (elem.second == attacker_)
    82                 this->gtinfo_->sendAnnounceMessage("You have won the match!", elem.first->getClientID());
     81            if (mapEntry.second == attacker_)
     82                this->gtinfo_->sendAnnounceMessage("You have won the match!", mapEntry.first->getClientID());
    8383            else
    84                 this->gtinfo_->sendAnnounceMessage("You have lost the match!", elem.first->getClientID());
     84                this->gtinfo_->sendAnnounceMessage("You have lost the match!", mapEntry.first->getClientID());
    8585        }
    8686    }
     
    155155                ChatManager::message(message);
    156156
    157                 for (auto & elem : this->teamnumbers_)
    158                 {
    159                     if (elem.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
     157                for (auto& mapEntry : this->teamnumbers_)
     158                {
     159                    if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    160160                        continue;
    161161
    162                     if (elem.second == 1)
    163                         this->gtinfo_->sendAnnounceMessage("You have won the match!", elem.first->getClientID());
     162                    if (mapEntry.second == 1)
     163                        this->gtinfo_->sendAnnounceMessage("You have won the match!", mapEntry.first->getClientID());
    164164                    else
    165                         this->gtinfo_->sendAnnounceMessage("You have lost the match!", elem.first->getClientID());
     165                        this->gtinfo_->sendAnnounceMessage("You have lost the match!", mapEntry.first->getClientID());
    166166                }
    167167            }
  • code/branches/cpp11_v2/src/orxonox/interfaces/PickupCarrier.cc

    r10821 r10916  
    135135        // Go recursively through all children to check whether they are the target.
    136136        std::vector<PickupCarrier*>* children = this->getCarrierChildren();
    137         for(auto & elem : *children)
     137        for(PickupCarrier* child : *children)
    138138        {
    139             if(pickup->isTarget(elem))
     139            if(pickup->isTarget(child))
    140140            {
    141                 target = elem;
     141                target = child;
    142142                break;
    143143            }
  • code/branches/cpp11_v2/src/orxonox/interfaces/Pickupable.cc

    r10821 r10916  
    160160    {
    161161        // Iterate through all targets of this Pickupable.
    162         for(const auto & elem : this->targets_)
     162        for(Identifier* target : this->targets_)
    163163        {
    164             if(identifier->isA(elem))
     164            if(identifier->isA(target))
    165165                return true;
    166166        }
  • code/branches/cpp11_v2/src/orxonox/items/MultiStateEngine.cc

    r10821 r10916  
    219219    {
    220220        unsigned int i = 0;
    221         for (const auto & elem : this->effectContainers_)
     221        for (EffectContainer* effectContainer : this->effectContainers_)
    222222        {
    223223            if (i == index)
    224                 return (elem);
     224                return effectContainer;
    225225            i++;
    226226        }
  • code/branches/cpp11_v2/src/orxonox/items/ShipPart.cc

    r10821 r10916  
    143143    @brief
    144144        Check whether the ShipPart has a particular Entity.
    145     @param engine
     145    @param search
    146146        A pointer to the Entity to be checked.
    147147    */
    148     bool ShipPart::hasEntity(StaticEntity* entity) const
    149     {
    150         for(auto & elem : this->entityList_)
    151         {
    152             if(elem == entity)
     148    bool ShipPart::hasEntity(StaticEntity* search) const
     149    {
     150        for(StaticEntity* entity : this->entityList_)
     151        {
     152            if(entity == search)
    153153                return true;
    154154        }
  • code/branches/cpp11_v2/src/orxonox/overlays/OverlayGroup.cc

    r10821 r10916  
    6262    OverlayGroup::~OverlayGroup()
    6363    {
    64         for (const auto & elem : hudElements_)
    65             (elem)->destroy();
     64        for (OrxonoxOverlay* hudElement : hudElements_)
     65            hudElement->destroy();
    6666        this->hudElements_.clear();
    6767    }
     
    8686    void OverlayGroup::setScale(const Vector2& scale)
    8787    {
    88         for (const auto & elem : hudElements_)
    89             (elem)->scale(scale / this->scale_);
     88        for (OrxonoxOverlay* hudElement : hudElements_)
     89            hudElement->scale(scale / this->scale_);
    9090        this->scale_ = scale;
    9191    }
     
    9494    void OverlayGroup::setScroll(const Vector2& scroll)
    9595    {
    96         for (const auto & elem : hudElements_)
    97             (elem)->scroll(scroll - this->scroll_);
     96        for (OrxonoxOverlay* hudElement : hudElements_)
     97            hudElement->scroll(scroll - this->scroll_);
    9898        this->scroll_ = scroll;
    9999    }
     
    147147        SUPER( OverlayGroup, changedVisibility );
    148148
    149         for (const auto & elem : hudElements_)
    150             (elem)->changedVisibility(); //inform all Child Overlays that our visibility has changed
     149        for (OrxonoxOverlay* hudElement : hudElements_)
     150            hudElement->changedVisibility(); //inform all Child Overlays that our visibility has changed
    151151    }
    152152
     
    155155        this->owner_ = owner;
    156156
    157         for (const auto & elem : hudElements_)
    158             (elem)->setOwner(owner);
     157        for (OrxonoxOverlay* hudElement : hudElements_)
     158            hudElement->setOwner(owner);
    159159    }
    160160
  • code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc

    r10821 r10916  
    407407        if (ambient != nullptr)
    408408        {
    409             for (auto & elem : this->ambientSounds_)
    410             {
    411                 if (elem.first == ambient)
     409            for (std::pair<AmbientSound*, bool>& pair : this->ambientSounds_)
     410            {
     411                if (pair.first == ambient)
    412412                {
    413                     elem.second = true;
    414                     this->fadeOut(elem.first);
     413                    pair.second = true;
     414                    this->fadeOut(pair.first);
    415415                    return;
    416416                }
  • code/branches/cpp11_v2/src/orxonox/sound/SoundStreamer.cc

    r10821 r10916  
    6868        int current_section;
    6969
    70         for(auto & initbuffer : initbuffers)
     70        for(ALuint& initbuffer : initbuffers)
    7171        {
    7272            long ret = ov_read(&vf, inbuffer, sizeof(inbuffer), 0, 2, 1, &current_section);
  • code/branches/cpp11_v2/src/orxonox/weaponsystem/Munition.cc

    r10821 r10916  
    5555    Munition::~Munition()
    5656    {
    57         for (auto & elem : this->currentMagazines_)
    58             delete elem.second;
     57        for (auto& mapEntry : this->currentMagazines_)
     58            delete mapEntry.second;
    5959    }
    6060
     
    268268        {
    269269            // Return true if any of the current magazines is not full (loading counts as full although it returns 0 munition)
    270             for (const auto & elem : this->currentMagazines_)
    271                 if (elem.second->munition_ < this->maxMunitionPerMagazine_ && elem.second->bLoaded_)
     270            for (const auto& mapEntry : this->currentMagazines_)
     271                if (mapEntry.second->munition_ < this->maxMunitionPerMagazine_ && mapEntry.second->bLoaded_)
    272272                    return true;
    273273        }
     
    316316            {
    317317                bool change = false;
    318                 for (auto & elem : this->currentMagazines_)
     318                for (auto& mapEntry : this->currentMagazines_)
    319319                {
    320320                    // Add munition if the magazine isn't full (but only to loaded magazines)
    321                     if (amount > 0 && elem.second->munition_ < this->maxMunitionPerMagazine_ && elem.second->bLoaded_)
     321                    if (amount > 0 && mapEntry.second->munition_ < this->maxMunitionPerMagazine_ && mapEntry.second->bLoaded_)
    322322                    {
    323                         elem.second->munition_++;
     323                        mapEntry.second->munition_++;
    324324                        amount--;
    325325                        change = true;
  • code/branches/cpp11_v2/src/orxonox/weaponsystem/Weapon.cc

    r10821 r10916  
    6161                this->weaponPack_->removeWeapon(this);
    6262
    63             for (auto & elem : this->weaponmodes_)
    64                 elem.second->destroy();
     63            for (auto& mapEntry : this->weaponmodes_)
     64                mapEntry.second->destroy();
    6565        }
    6666    }
     
    8585    {
    8686        unsigned int i = 0;
    87         for (const auto & elem : this->weaponmodes_)
     87        for (const auto& mapEntry : this->weaponmodes_)
    8888        {
    8989            if (i == index)
    90                 return elem.second;
     90                return mapEntry.second;
    9191
    9292            ++i;
     
    136136    void Weapon::reload()
    137137    {
    138         for (auto & elem : this->weaponmodes_)
    139             elem.second->reload();
     138        for (auto& mapEntry : this->weaponmodes_)
     139            mapEntry.second->reload();
    140140    }
    141141
     
    148148    void Weapon::notifyWeaponModes()
    149149    {
    150         for (auto & elem : this->weaponmodes_)
    151             elem.second->setWeapon(this);
     150        for (auto& mapEntry : this->weaponmodes_)
     151            mapEntry.second->setWeapon(this);
    152152    }
    153153}
  • code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponPack.cc

    r10821 r10916  
    7676    void WeaponPack::fire(unsigned int weaponmode)
    7777    {
    78         for (auto & elem : this->weapons_)
    79             (elem)->fire(weaponmode);
     78        for (Weapon* weapon : this->weapons_)
     79            weapon->fire(weaponmode);
    8080    }
    8181
     
    8686    void WeaponPack::reload()
    8787    {
    88         for (auto & elem : this->weapons_)
    89             (elem)->reload();
     88        for (Weapon* weapon : this->weapons_)
     89            weapon->reload();
    9090    }
    9191
     
    114114        unsigned int i = 0;
    115115
    116         for (const auto & elem : this->weapons_)
     116        for (Weapon* weapon : this->weapons_)
    117117        {
    118118            if (i == index)
    119                 return (elem);
     119                return weapon;
    120120            ++i;
    121121        }
     
    132132    {
    133133        unsigned int i = 0;
    134         for (const auto & elem : this->links_)
     134        for (DefaultWeaponmodeLink* link : this->links_)
    135135        {
    136136            if (i == index)
    137                 return (elem);
     137                return link;
    138138
    139139            ++i;
     
    144144    unsigned int WeaponPack::getDesiredWeaponmode(unsigned int firemode) const
    145145    {
    146         for (const auto & elem : this->links_)
    147             if ((elem)->getFiremode() == firemode)
    148                 return (elem)->getWeaponmode();
     146        for (DefaultWeaponmodeLink* link : this->links_)
     147            if (link->getFiremode() == firemode)
     148                return link->getWeaponmode();
    149149
    150150        return WeaponSystem::WEAPON_MODE_UNASSIGNED;
  • code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponSet.cc

    r10821 r10916  
    6363    {
    6464        // Fire all WeaponPacks with their defined weaponmode
    65         for (auto & elem : this->weaponpacks_)
    66             if (elem.second != WeaponSystem::WEAPON_MODE_UNASSIGNED)
    67                 elem.first->fire(elem.second);
     65        for (auto& mapEntry : this->weaponpacks_)
     66            if (mapEntry.second != WeaponSystem::WEAPON_MODE_UNASSIGNED)
     67                mapEntry.first->fire(mapEntry.second);
    6868    }
    6969
     
    7171    {
    7272        // Reload all WeaponPacks with their defined weaponmode
    73         for (auto & elem : this->weaponpacks_)
    74             elem.first->reload();
     73        for (auto& mapEntry : this->weaponpacks_)
     74            mapEntry.first->reload();
    7575    }
    7676
  • code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponSystem.cc

    r10821 r10916  
    106106    {
    107107        unsigned int i = 0;
    108         for (const auto & elem : this->weaponSlots_)
     108        for (WeaponSlot* weaponSlot : this->weaponSlots_)
    109109        {
    110110            ++i;
    111111            if (i > index)
    112                 return (elem);
     112                return weaponSlot;
    113113        }
    114114        return nullptr;
     
    153153    {
    154154        unsigned int i = 0;
    155         for (const auto & elem : this->weaponSets_)
     155        for (const auto& mapEntry : this->weaponSets_)
    156156        {
    157157            ++i;
    158158            if (i > index)
    159                 return elem.second;
     159                return mapEntry.second;
    160160        }
    161161        return nullptr;
     
    168168
    169169        unsigned int freeSlots = 0;
    170         for (auto & elem : this->weaponSlots_)
    171         {
    172             if (!(elem)->isOccupied())
     170        for (WeaponSlot* weaponSlot : this->weaponSlots_)
     171        {
     172            if (!weaponSlot->isOccupied())
    173173                ++freeSlots;
    174174        }
     
    184184        // Attach all weapons to the first free slots (and to the Pawn)
    185185        unsigned int i = 0;
    186         for (auto & elem : this->weaponSlots_)
    187         {
    188             if (!(elem)->isOccupied() && i < wPack->getNumWeapons())
     186        for (WeaponSlot* weaponSlot : this->weaponSlots_)
     187        {
     188            if (!weaponSlot->isOccupied() && i < wPack->getNumWeapons())
    189189            {
    190190                Weapon* weapon = wPack->getWeapon(i);
    191                 (elem)->attachWeapon(weapon);
     191                weaponSlot->attachWeapon(weapon);
    192192                this->getPawn()->attach(weapon);
    193193                ++i;
     
    196196
    197197        // Assign the desired weaponmode to the firemodes
    198         for (auto & elem : this->weaponSets_)
    199         {
    200             unsigned int weaponmode = wPack->getDesiredWeaponmode(elem.first);
     198        for (auto& mapEntry : this->weaponSets_)
     199        {
     200            unsigned int weaponmode = wPack->getDesiredWeaponmode(mapEntry.first);
    201201            if (weaponmode != WeaponSystem::WEAPON_MODE_UNASSIGNED)
    202                 elem.second->setWeaponmodeLink(wPack, weaponmode);
     202                mapEntry.second->setWeaponmodeLink(wPack, weaponmode);
    203203        }
    204204
     
    219219
    220220        // Remove all added links from the WeaponSets
    221         for (auto & elem : this->weaponSets_)
    222             elem.second->removeWeaponmodeLink(wPack);
     221        for (auto& mapEntry : this->weaponSets_)
     222            mapEntry.second->removeWeaponmodeLink(wPack);
    223223
    224224        // Remove the WeaponPack from the WeaponSystem
     
    231231    {
    232232        unsigned int i = 0;
    233         for (const auto & elem : this->weaponPacks_)
     233        for (WeaponPack* weaponPack : this->weaponPacks_)
    234234        {
    235235            ++i;
    236236            if (i > index)
    237                 return (elem);
     237                return weaponPack;
    238238        }
    239239        return nullptr;
     
    268268        // Check if the WeaponSet belongs to this WeaponSystem
    269269        bool foundWeaponSet = false;
    270         for (auto & elem : this->weaponSets_)
    271         {
    272             if (elem.second == wSet)
     270        for (auto& mapEntry : this->weaponSets_)
     271        {
     272            if (mapEntry.second == wSet)
    273273            {
    274274                foundWeaponSet = true;
     
    296296    void WeaponSystem::reload()
    297297    {
    298         for (auto & elem : this->weaponSets_)
    299             elem.second->reload();
     298        for (auto& mapEntry : this->weaponSets_)
     299            mapEntry.second->reload();
    300300    }
    301301
  • code/branches/cpp11_v2/src/orxonox/worldentities/ControllableEntity.cc

    r10821 r10916  
    165165    {
    166166        unsigned int i = 0;
    167         for (const auto & elem : this->cameraPositions_)
     167        for (CameraPosition* cameraPosition : this->cameraPositions_)
    168168        {
    169169            if (i == index)
    170                 return (elem);
     170                return cameraPosition;
    171171            ++i;
    172172        }
     
    180180
    181181        unsigned int counter = 0;
    182         for (const auto & elem : this->cameraPositions_)
    183         {
    184             if ((elem) == this->currentCameraPosition_)
     182        for (CameraPosition* cameraPosition : this->cameraPositions_)
     183        {
     184            if (cameraPosition == this->currentCameraPosition_)
    185185                break;
    186186            counter++;
     
    477477        if (parent)
    478478        {
    479             for (auto & elem : this->cameraPositions_)
    480                 if ((elem)->getIsAbsolute())
    481                     parent->attach((elem));
     479            for (CameraPosition* cameraPosition : this->cameraPositions_)
     480                if (cameraPosition->getIsAbsolute())
     481                    parent->attach(cameraPosition);
    482482        }
    483483    }
  • code/branches/cpp11_v2/src/orxonox/worldentities/EffectContainer.cc

    r10821 r10916  
    8989    {
    9090        unsigned int i = 0;
    91         for (const auto & elem : this->effects_)
     91        for (WorldEntity* effect : this->effects_)
    9292            if (i == index)
    93                 return (elem);
     93                return effect;
    9494        return nullptr;
    9595    }
  • code/branches/cpp11_v2/src/orxonox/worldentities/WorldEntity.cc

    r10821 r10916  
    233233
    234234            // iterate over all children and change their activity as well
    235             for (const auto & elem : this->getAttachedObjects())
     235            for (WorldEntity* object : this->getAttachedObjects())
    236236            {
    237237                if(!this->isActive())
    238238                {
    239                     (elem)->bActiveMem_ = (elem)->isActive();
    240                     (elem)->setActive(this->isActive());
     239                    object->bActiveMem_ = object->isActive();
     240                    object->setActive(this->isActive());
    241241                }
    242242                else
    243243                {
    244                     (elem)->setActive((elem)->bActiveMem_);
     244                    object->setActive(object->bActiveMem_);
    245245                }
    246246            }
     
    259259        {
    260260            // iterate over all children and change their visibility as well
    261             for (const auto & elem : this->getAttachedObjects())
     261            for (WorldEntity* object : this->getAttachedObjects())
    262262            {
    263263                if(!this->isVisible())
    264264                {
    265                     (elem)->bVisibleMem_ = (elem)->isVisible();
    266                     (elem)->setVisible(this->isVisible());
     265                    object->bVisibleMem_ = object->isVisible();
     266                    object->setVisible(this->isVisible());
    267267                }
    268268                else
    269269                {
    270                     (elem)->setVisible((elem)->bVisibleMem_);
     270                    object->setVisible(object->bVisibleMem_);
    271271                }
    272272            }
     
    518518    {
    519519        unsigned int i = 0;
    520         for (const auto & elem : this->children_)
     520        for (WorldEntity* child : this->children_)
    521521        {
    522522            if (i == index)
    523                 return (elem);
     523                return child;
    524524            ++i;
    525525        }
     
    938938        // Recalculate mass
    939939        this->childrenMass_ = 0.0f;
    940         for (const auto & elem : this->children_)
    941             this->childrenMass_ += (elem)->getMass();
     940        for (WorldEntity* child : this->children_)
     941            this->childrenMass_ += child->getMass();
    942942        recalculateMassProps();
    943943        // Notify parent WE
  • code/branches/cpp11_v2/src/orxonox/worldentities/pawns/ModularSpaceShip.cc

    r10821 r10916  
    9999            }
    100100            // iterate through all attached parts
    101             for(auto & elem : this->partList_)
     101            for(ShipPart* part : this->partList_)
    102102            {
    103103                // if the name of the part matches the name of the object, add the object to that parts entitylist (unless it was already done).
    104                 if((elem->getName() == this->getAttachedObject(i)->getName()) && !elem->hasEntity(orxonox_cast<StaticEntity*>(this->getAttachedObject(i))))
     104                if((part->getName() == this->getAttachedObject(i)->getName()) && !part->hasEntity(orxonox_cast<StaticEntity*>(this->getAttachedObject(i))))
    105105                {
    106106                    // The Entity is added to the part's entityList_
    107                     elem->addEntity(orxonox_cast<StaticEntity*>(this->getAttachedObject(i)));
     107                    part->addEntity(orxonox_cast<StaticEntity*>(this->getAttachedObject(i)));
    108108                    // An entry in the partMap_ is created, assigning the part to the entity.
    109                     this->addPartEntityAssignment((StaticEntity*)(this->getAttachedObject(i)), elem);
     109                    this->addPartEntityAssignment((StaticEntity*)(this->getAttachedObject(i)), part);
    110110                }
    111111            }
     
    146146    ShipPart* ModularSpaceShip::getPartOfEntity(StaticEntity* entity) const
    147147    {
    148         for (const auto & elem : this->partMap_)
    149         {
    150             if (elem.first == entity)
    151                 return elem.second;
     148        for (const auto& mapEntry : this->partMap_)
     149        {
     150            if (mapEntry.first == entity)
     151                return mapEntry.second;
    152152        }
    153153        return nullptr;
     
    242242    ShipPart* ModularSpaceShip::getShipPartByName(std::string name)
    243243    {
    244         for(auto & elem : this->partList_)
    245         {
    246             if(orxonox_cast<ShipPart*>(elem)->getName() == name)
    247             {
    248                 return orxonox_cast<ShipPart*>(elem);
     244        for(ShipPart* part : this->partList_)
     245        {
     246            if(orxonox_cast<ShipPart*>(part)->getName() == name)
     247            {
     248                return orxonox_cast<ShipPart*>(part);
    249249            }
    250250        }
     
    256256    @brief
    257257        Check whether the SpaceShip has a particular Engine.
    258     @param engine
     258    @param search
    259259        A pointer to the Engine to be checked.
    260260    */
    261     bool ModularSpaceShip::hasShipPart(ShipPart* part) const
    262     {
    263         for(auto & elem : this->partList_)
    264         {
    265             if(elem == part)
     261    bool ModularSpaceShip::hasShipPart(ShipPart* search) const
     262    {
     263        for(ShipPart* part : this->partList_)
     264        {
     265            if(part == search)
    266266                return true;
    267267        }
  • code/branches/cpp11_v2/src/orxonox/worldentities/pawns/SpaceShip.cc

    r10821 r10916  
    158158
    159159        // Run the engines
    160         for(auto & elem : this->engineList_)
    161             (elem)->run(dt);
     160        for(Engine* engine : this->engineList_)
     161            engine->run(dt);
    162162
    163163        if (this->hasLocalController())
     
    313313    @brief
    314314        Check whether the SpaceShip has a particular Engine.
    315     @param engine
     315    @param search
    316316        A pointer to the Engine to be checked.
    317317    */
    318     bool SpaceShip::hasEngine(Engine* engine) const
    319     {
    320         for(auto & elem : this->engineList_)
    321         {
    322             if(elem == engine)
     318    bool SpaceShip::hasEngine(Engine* search) const
     319    {
     320        for(Engine* engine : this->engineList_)
     321        {
     322            if(engine == search)
    323323                return true;
    324324        }
     
    350350    Engine* SpaceShip::getEngineByName(const std::string& name)
    351351    {
    352         for(auto & elem : this->engineList_)
    353             if(elem->getName() == name)
    354                 return elem;
     352        for(Engine* engine : this->engineList_)
     353            if(engine->getName() == name)
     354                return engine;
    355355
    356356        orxout(internal_warning) << "Couldn't find Engine with name \"" << name << "\"." << endl;
     
    396396    void SpaceShip::addSpeedFactor(float factor)
    397397    {
    398         for(auto & elem : this->engineList_)
    399             elem->addSpeedMultiply(factor);
     398        for(Engine* engine : this->engineList_)
     399            engine->addSpeedMultiply(factor);
    400400    }
    401401
     
    408408    void SpaceShip::addSpeed(float speed)
    409409    {
    410         for(auto & elem : this->engineList_)
    411             elem->addSpeedAdd(speed);
     410        for(Engine* engine : this->engineList_)
     411            engine->addSpeedAdd(speed);
    412412    }
    413413
     
    436436    {
    437437        float speed=0;
    438         for(auto & elem : this->engineList_)
    439         {
    440             if(elem->getMaxSpeedFront() > speed)
    441                 speed = elem->getMaxSpeedFront();
     438        for(Engine* engine : this->engineList_)
     439        {
     440            if(engine->getMaxSpeedFront() > speed)
     441                speed = engine->getMaxSpeedFront();
    442442        }
    443443        return speed;
  • code/branches/cpp11_v2/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc

    r10821 r10916  
    8080
    8181        std::set<WorldEntity*> attachments = this->getAttachedObjects();
    82         for (const auto & attachment : attachments)
     82        for (WorldEntity* attachment : attachments)
    8383        {
    84             if ((attachment)->isA(Class(TeamColourable)))
     84            if (attachment->isA(Class(TeamColourable)))
    8585            {
    8686                TeamColourable* tc = orxonox_cast<TeamColourable*>(attachment);
Note: See TracChangeset for help on using the changeset viewer.