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
Files:
38 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/modules/docking/Dock.cc

    r10821 r10916  
    327327    const DockingEffect* Dock::getEffect(unsigned int i) const
    328328    {
    329         for (const auto & elem : this->effects_)
     329        for (DockingEffect* effect : this->effects_)
    330330        {
    331331            if(i == 0)
    332                return elem;
     332               return effect;
    333333            i--;
    334334        }
     
    346346    const DockingAnimation* Dock::getAnimation(unsigned int i) const
    347347    {
    348         for (const auto & elem : this->animations_)
     348        for (DockingAnimation* animation : this->animations_)
    349349        {
    350350            if(i == 0)
    351                return elem;
     351               return animation;
    352352            i--;
    353353        }
  • code/branches/cpp11_v2/src/modules/docking/DockingAnimation.cc

    r10821 r10916  
    5757        bool check = true;
    5858
    59         for (auto & animations_animation : animations)
     59        for (DockingAnimation* animation : animations)
    6060        {
    6161            if(dock)
    62                 check &= (animations_animation)->docking(player);
     62                check &= animation->docking(player);
    6363            else
    64                 check &= (animations_animation)->release(player);
     64                check &= animation->release(player);
    6565        }
    6666
  • code/branches/cpp11_v2/src/modules/docking/DockingEffect.cc

    r10821 r10916  
    5353        bool check = true;
    5454
    55         for (auto & effects_effect : effects)
     55        for (DockingEffect* effect : effects)
    5656        {
    5757            if (dock)
    58                 check &= (effects_effect)->docking(player);
     58                check &= effect->docking(player);
    5959            else
    60                 check &= (effects_effect)->release(player);
     60                check &= effect->release(player);
    6161        }
    6262
  • code/branches/cpp11_v2/src/modules/gametypes/RaceCheckPoint.cc

    r10821 r10916  
    146146    {
    147147        Vector3 checkpoints(-1,-1,-1); int count=0;
    148         for (const auto & elem : nextCheckpoints_)
     148        for (int nextCheckpoint : nextCheckpoints_)
    149149        {
    150150            switch (count)
    151151            {
    152                 case 0: checkpoints.x = static_cast<Ogre::Real>(elem); break;
    153                 case 1: checkpoints.y = static_cast<Ogre::Real>(elem); break;
    154                 case 2: checkpoints.z = static_cast<Ogre::Real>(elem); break;
     152                case 0: checkpoints.x = static_cast<Ogre::Real>(nextCheckpoint); break;
     153                case 1: checkpoints.y = static_cast<Ogre::Real>(nextCheckpoint); break;
     154                case 2: checkpoints.z = static_cast<Ogre::Real>(nextCheckpoint); break;
    155155            }
    156156            ++count;
  • code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceController.cc

    r10821 r10916  
    154154    {
    155155        std::map<RaceCheckPoint*, int> zaehler; // counts how many times the checkpoint was reached (for simulation)
    156         for (auto & allCheckpoint : allCheckpoints)
    157         {
    158             zaehler.insert(std::pair<RaceCheckPoint*, int>(allCheckpoint,0));
     156        for (RaceCheckPoint* checkpoint : allCheckpoints)
     157        {
     158            zaehler.insert(std::pair<RaceCheckPoint*, int>(checkpoint,0));
    159159        }
    160160        int maxWays = rekSimulationCheckpointsReached(currentCheckpoint, zaehler);
    161161
    162162        std::vector<RaceCheckPoint*> returnVec;
    163         for (auto & elem : zaehler)
    164         {
    165             if (elem.second == maxWays)
    166             {
    167                 returnVec.push_back(elem.first);
     163        for (auto& mapEntry : zaehler)
     164        {
     165            if (mapEntry.second == maxWays)
     166            {
     167                returnVec.push_back(mapEntry.first);
    168168            }
    169169        }
     
    226226
    227227        // find the next checkpoint with the minimal distance
    228         for (auto elem : raceCheckpoint->getNextCheckpoints())
    229         {
    230             RaceCheckPoint* nextRaceCheckPoint = findCheckpoint(elem);
     228        for (int checkpointIndex : raceCheckpoint->getNextCheckpoints())
     229        {
     230            RaceCheckPoint* nextRaceCheckPoint = findCheckpoint(checkpointIndex);
    231231            float distance = recCalculateDistance(nextRaceCheckPoint, this->getControllableEntity()->getPosition());
    232232
     
    289289    RaceCheckPoint* SpaceRaceController::findCheckpoint(int index) const
    290290    {
    291         for (auto & elem : this->checkpoints_)
    292             if (elem->getCheckpointIndex() == index)
    293                 return elem;
     291        for (RaceCheckPoint* checkpoint : this->checkpoints_)
     292            if (checkpoint->getCheckpointIndex() == index)
     293                return checkpoint;
    294294        return nullptr;
    295295    }
     
    414414        btScalar radiusObject;
    415415
    416         for (const auto & allObject : allObjects)
    417         {
    418             for (int everyShape=0; (allObject)->getAttachedCollisionShape(everyShape) != nullptr; everyShape++)
    419             {
    420                 btCollisionShape* currentShape = (allObject)->getAttachedCollisionShape(everyShape)->getCollisionShape();
     416        for (StaticEntity* object : allObjects)
     417        {
     418            for (int everyShape=0; object->getAttachedCollisionShape(everyShape) != nullptr; everyShape++)
     419            {
     420                btCollisionShape* currentShape = object->getAttachedCollisionShape(everyShape)->getCollisionShape();
    421421                if(currentShape == nullptr)
    422422                continue;
  • code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceManager.cc

    r10821 r10916  
    5454    SpaceRaceManager::~SpaceRaceManager()
    5555    {
    56         for (auto & elem : this->checkpoints_)
    57         elem->destroy();
     56        for (RaceCheckPoint* checkpoint : this->checkpoints_)
     57        checkpoint->destroy();
    5858    }
    5959
     
    7777        }
    7878
    79         for (auto & elem : players_)
     79        for (auto& mapEntry : players_)
    8080        {
    8181
    82             for (auto & _i : this->checkpoints_)
     82            for (RaceCheckPoint* checkpoint : this->checkpoints_)
    8383            {
    84                 if (_i->playerWasHere(elem.first)){
    85                 this->checkpointReached(_i, elem.first /*this->checkpoints_[i]->getPlayer()*/);
     84                if (checkpoint->playerWasHere(mapEntry.first)){
     85                this->checkpointReached(checkpoint, mapEntry.first /*this->checkpoints_[i]->getPlayer()*/);
    8686                }
    8787            }
     
    113113    RaceCheckPoint* SpaceRaceManager::findCheckpoint(int index) const
    114114    {
    115         for (auto & elem : this->checkpoints_)
    116         if (elem->getCheckpointIndex() == index)
    117         return elem;
     115        for (RaceCheckPoint* checkpoint : this->checkpoints_)
     116        if (checkpoint->getCheckpointIndex() == index)
     117        return checkpoint;
    118118        return nullptr;
    119119    }
     
    125125            // the player already visited an old checkpoint; see which checkpoints are possible now
    126126            const std::set<int>& possibleCheckpoints = oldCheckpoint->getNextCheckpoints();
    127             for (const auto & possibleCheckpoint : possibleCheckpoints)
     127            for (int possibleCheckpoint : possibleCheckpoints)
    128128            if (this->findCheckpoint(possibleCheckpoint) == newCheckpoint)
    129129            return true;
     
    179179        {
    180180            const std::set<int>& oldVisible = oldCheckpoint->getNextCheckpoints();
    181             for (const auto & elem : oldVisible)
    182             this->findCheckpoint(elem)->setRadarVisibility(false);
     181            for (int checkpointIndex : oldVisible)
     182            this->findCheckpoint(checkpointIndex)->setRadarVisibility(false);
    183183        }
    184184
     
    188188
    189189            const std::set<int>& newVisible = newCheckpoint->getNextCheckpoints();
    190             for (const auto & elem : newVisible)
    191             this->findCheckpoint(elem)->setRadarVisibility(true);
     190            for (int checkpointIndex : newVisible)
     191            this->findCheckpoint(checkpointIndex)->setRadarVisibility(true);
    192192        }
    193193    }
  • code/branches/cpp11_v2/src/modules/jump/Jump.cc

    r10821 r10916  
    633633
    634634
    635         for (auto & elem : matrix)
     635        for (int i = 0; i < numI; ++i)
    636636        {
    637637            for (int j = 0; j < numJ; ++j)
    638638            {
    639                 elem[j].type = PLATFORM_EMPTY;
    640                 elem[j].done = false;
     639                matrix[i][j].type = PLATFORM_EMPTY;
     640                matrix[i][j].done = false;
    641641            }
    642642        }
     
    795795
    796796        // Fill matrix with selected platform types
    797         for (auto & elem : matrix)
     797        for (int i = 0; i < numI; ++ i)
    798798        {
    799799            for (int j = 0; j < numJ; ++ j)
     
    801801                if (rand()%3 == 0)
    802802                {
    803                     elem[j].type = platformtype1;
     803                    matrix[i][j].type = platformtype1;
    804804                }
    805805                else
    806806                {
    807                     elem[j].type = platformtype2;
     807                    matrix[i][j].type = platformtype2;
    808808                }
    809                 elem[j].done = false;
     809                matrix[i][j].done = false;
    810810            }
    811811        }
  • code/branches/cpp11_v2/src/modules/mini4dgame/Mini4Dgame.cc

    r10821 r10916  
    155155    {
    156156        // first spawn human players to assign always the left bat to the player in singleplayer
    157         for (auto & elem : this->players_)
    158             if (elem.first->isHumanPlayer() && (elem.first->isReadyToSpawn() || this->bForceSpawn_))
    159                 this->spawnPlayer(elem.first);
     157        for (auto& mapEntry : this->players_)
     158            if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
     159                this->spawnPlayer(mapEntry.first);
    160160        // now spawn bots
    161         for (auto & elem : this->players_)
    162             if (!elem.first->isHumanPlayer() && (elem.first->isReadyToSpawn() || this->bForceSpawn_))
    163                 this->spawnPlayer(elem.first);
     161        for (auto& mapEntry : this->players_)
     162            if (!mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
     163                this->spawnPlayer(mapEntry.first);
    164164    }
    165165
  • code/branches/cpp11_v2/src/modules/notifications/NotificationManager.cc

    r10821 r10916  
    6969    {
    7070        // Destroys all Notifications.
    71         for(auto & elem : this->allNotificationsList_)
    72             elem.second->destroy();
     71        for(auto& mapEntry : this->allNotificationsList_)
     72            mapEntry.second->destroy();
    7373        this->allNotificationsList_.clear();
    7474
     
    152152        bool executed = false;
    153153        // Clear all NotificationQueues that have the input sender as target.
    154         for(auto & elem : this->queues_) // Iterate through all NotificationQueues.
    155         {
    156             const std::set<std::string>& set = elem.second->getTargetsSet();
     154        for(auto& mapEntry : this->queues_) // Iterate through all NotificationQueues.
     155        {
     156            const std::set<std::string>& set = mapEntry.second->getTargetsSet();
    157157            // If either the sender is 'all', the NotificationQueue has as target all or the NotificationQueue has the input sender as a target.
    158158            if(all || set.find(NotificationListener::ALL) != set.end() || set.find(sender) != set.end())
    159                 executed = elem.second->tidy() || executed;
     159                executed = mapEntry.second->tidy() || executed;
    160160        }
    161161
     
    187187
    188188        // Insert the Notification in all NotificationQueues that have its sender as target.
    189         for(auto & elem : this->queues_) // Iterate through all NotificationQueues.
    190         {
    191             const std::set<std::string>& set = elem.second->getTargetsSet();
     189        for(auto& mapEntry : this->queues_) // Iterate through all NotificationQueues.
     190        {
     191            const std::set<std::string>& set = mapEntry.second->getTargetsSet();
    192192            bool bAll = set.find(NotificationListener::ALL) != set.end();
    193193            // If either the Notification has as sender 'all', the NotificationQueue displays all Notifications or the NotificationQueue has the sender of the Notification as target.
     
    195195            {
    196196                if(!bAll)
    197                     this->notificationLists_[elem.second->getName()]->insert(std::pair<std::time_t, Notification*>(time, notification)); // Insert the Notification in the notifications list of the current NotificationQueue.
    198                 elem.second->update(notification, time); // Update the NotificationQueue.
     197                    this->notificationLists_[mapEntry.second->getName()]->insert(std::pair<std::time_t, Notification*>(time, notification)); // Insert the Notification in the notifications list of the current NotificationQueue.
     198                mapEntry.second->update(notification, time); // Update the NotificationQueue.
    199199            }
    200200        }
     
    345345
    346346        // Iterate through all Notifications to determine whether any of them should belong to the newly registered NotificationQueue.
    347         for(auto & elem : this->allNotificationsList_)
    348         {
    349             if(!bAll && set.find(elem.second->getSender()) != set.end()) // Checks whether the listener has the sender of the current Notification as target.
    350                 map->insert(std::pair<std::time_t, Notification*>(elem.first, elem.second));
     347        for(auto& mapEntry : this->allNotificationsList_)
     348        {
     349            if(!bAll && set.find(mapEntry.second->getSender()) != set.end()) // Checks whether the listener has the sender of the current Notification as target.
     350                map->insert(std::pair<std::time_t, Notification*>(mapEntry.first, mapEntry.second));
    351351        }
    352352
  • code/branches/cpp11_v2/src/modules/notifications/NotificationQueue.cc

    r10821 r10916  
    206206        {
    207207            // Add all Notifications that have been created after this NotificationQueue was created.
    208             for(auto & notification : *notifications)
     208            for(auto& mapEntry : *notifications)
    209209            {
    210                 if(notification.first >= this->creationTime_)
    211                     this->push(notification.second, notification.first);
     210                if(mapEntry.first >= this->creationTime_)
     211                    this->push(mapEntry.second, mapEntry.first);
    212212            }
    213213        }
     
    336336        this->ordering_.clear();
    337337        // Delete all NotificationContainers in the list.
    338         for(auto & elem : this->notifications_)
    339             delete elem;
     338        for(NotificationContainer* notification : this->notifications_)
     339            delete notification;
    340340
    341341        this->notifications_.clear();
     
    426426        bool first = true;
    427427        // Iterate through the set of targets.
    428         for(const auto & elem : this->targets_)
     428        for(const std::string& target : this->targets_)
    429429        {
    430430            if(!first)
     
    432432            else
    433433                first = false;
    434             stream << elem;
     434            stream << target;
    435435        }
    436436
  • code/branches/cpp11_v2/src/modules/objects/Attacher.cc

    r10821 r10916  
    6161        SUPER(Attacher, changedActivity);
    6262
    63         for (auto & elem : this->objects_)
    64             (elem)->setActive(this->isActive());
     63        for (WorldEntity* object : this->objects_)
     64            object->setActive(this->isActive());
    6565    }
    6666
     
    6969        SUPER(Attacher, changedVisibility);
    7070
    71         for (auto & elem : this->objects_)
    72             (elem)->setVisible(this->isVisible());
     71        for (WorldEntity* object : this->objects_)
     72            object->setVisible(this->isVisible());
    7373    }
    7474
     
    8383    {
    8484        unsigned int i = 0;
    85         for (const auto & elem : this->objects_)
     85        for (WorldEntity* object : this->objects_)
    8686        {
    8787            if (i == index)
    88                 return (elem);
     88                return object;
    8989
    9090            ++i;
  • code/branches/cpp11_v2/src/modules/objects/Script.cc

    r10821 r10916  
    196196            {
    197197                const std::map<unsigned int, PlayerInfo*> clients = PlayerManager::getInstance().getClients();
    198                 for(const auto & client : clients)
     198                for(const auto& mapEntry : clients)
    199199                {
    200                     callStaticNetworkFunction(&Script::executeHelper, client.first, this->getCode(), this->getMode(), this->getNeedsGraphics());
     200                    callStaticNetworkFunction(&Script::executeHelper, mapEntry.first, this->getCode(), this->getMode(), this->getNeedsGraphics());
    201201                    if(this->times_ != Script::INF) // Decrement the number of remaining executions.
    202202                    {
  • code/branches/cpp11_v2/src/modules/objects/SpaceBoundaries.cc

    r10821 r10916  
    5959            this->pawnsIn_.clear();
    6060
    61             for(auto & elem : this->billboards_)
     61            for(BillboardAdministration& billboard : this->billboards_)
    6262            {
    63                 if( elem.billy != nullptr)
    64                 {
    65                     delete elem.billy;
     63                if( billboard.billy != nullptr)
     64                {
     65                    delete billboard.billy;
    6666                }
    6767            }
     
    138138    void SpaceBoundaries::removeAllBillboards()
    139139    {
    140         for(auto & elem : this->billboards_)
    141         {
    142             elem.usedYet = false;
    143             elem.billy->setVisible(false);
     140        for(BillboardAdministration& billboard : this->billboards_)
     141        {
     142            billboard.usedYet = false;
     143            billboard.billy->setVisible(false);
    144144        }
    145145    }
     
    208208        float distance;
    209209        bool humanItem;
    210         for(auto currentPawn : pawnsIn_)
    211         {
    212            
     210        for(Pawn* currentPawn : pawnsIn_)
     211        {
    213212            if( currentPawn && currentPawn->getNode() )
    214213            {
  • code/branches/cpp11_v2/src/modules/objects/eventsystem/EventDispatcher.cc

    r10821 r10916  
    4545    {
    4646        if (this->isInitialized())
    47             for (auto & elem : this->targets_)
    48                 (elem)->destroy();
     47            for (BaseObject* target : this->targets_)
     48                target->destroy();
    4949    }
    5050
     
    6161    void EventDispatcher::processEvent(Event& event)
    6262    {
    63         for (auto & elem : this->targets_)
    64             (elem)->processEvent(event);
     63        for (BaseObject* target : this->targets_)
     64            target->processEvent(event);
    6565    }
    6666
     
    7373    {
    7474        unsigned int i = 0;
    75         for (const auto & elem : this->targets_)
     75        for (BaseObject* target : this->targets_)
    7676        {
    7777            if (i == index)
    78                 return (elem);
     78                return target;
    7979            ++i;
    8080        }
  • code/branches/cpp11_v2/src/modules/objects/eventsystem/EventFilter.cc

    r10821 r10916  
    9696    {
    9797        unsigned int i = 0;
    98         for (const auto & elem : this->sources_)
     98        for (BaseObject* source : this->sources_)
    9999        {
    100100            if (i == index)
    101                 return (elem);
     101                return source;
    102102            ++i;
    103103        }
     
    113113    {
    114114        unsigned int i = 0;
    115         for (const auto & elem : this->names_)
     115        for (EventName* name : this->names_)
    116116        {
    117117            if (i == index)
    118                 return (elem);
     118                return name;
    119119            ++i;
    120120        }
  • code/branches/cpp11_v2/src/modules/objects/triggers/DistanceMultiTrigger.cc

    r10821 r10916  
    158158            {
    159159               
    160                 const std::set<WorldEntity*> attached = entity->getAttachedObjects();
     160                const std::set<WorldEntity*> attachedObjects = entity->getAttachedObjects();
    161161                bool found = false;
    162                 for(const auto & elem : attached)
     162                for(WorldEntity* attachedObject : attachedObjects)
    163163                {
    164                     if((elem)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(elem)->getName() == this->targetName_)
     164                    if(attachedObject->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(attachedObject)->getName() == this->targetName_)
    165165                    {
    166166                        found = true;
  • code/branches/cpp11_v2/src/modules/objects/triggers/DistanceTrigger.cc

    r10821 r10916  
    180180            {
    181181
    182                 const std::set<WorldEntity*> attached = entity->getAttachedObjects();
     182                const std::set<WorldEntity*> attachedObjects = entity->getAttachedObjects();
    183183                bool found = false;
    184                 for(const auto & elem : attached)
     184                for(WorldEntity* attachedObject : attachedObjects)
    185185                {
    186                     if((elem)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(elem)->getName() == this->targetName_)
     186                    if(attachedObject->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(attachedObject)->getName() == this->targetName_)
    187187                    {
    188188                        found = true;
  • code/branches/cpp11_v2/src/modules/objects/triggers/MultiTrigger.cc

    r10821 r10916  
    504504    bool MultiTrigger::checkAnd(BaseObject* triggerer)
    505505    {
    506         for(auto trigger : this->children_)
    507         {
    508            
     506        for(TriggerBase* trigger : this->children_)
     507        {
    509508            if(trigger->isMultiTrigger())
    510509            {
     
    531530    bool MultiTrigger::checkOr(BaseObject* triggerer)
    532531    {
    533         for(auto trigger : this->children_)
    534         {
    535            
     532        for(TriggerBase* trigger : this->children_)
     533        {
    536534            if(trigger->isMultiTrigger())
    537535            {
     
    559557    {
    560558        bool triggered = false;
    561         for(auto trigger : this->children_)
    562         {
    563            
     559        for(TriggerBase* trigger : this->children_)
     560        {
    564561            if(triggered)
    565562            {
  • code/branches/cpp11_v2/src/modules/objects/triggers/Trigger.cc

    r10821 r10916  
    234234    {
    235235        // Iterate over all sub-triggers.
    236         for (const auto & elem : this->children_)
    237         {
    238             if (!(elem)->isActive())
     236        for (TriggerBase* child : this->children_)
     237        {
     238            if (!child->isActive())
    239239                return false;
    240240        }
     
    252252    {
    253253        // Iterate over all sub-triggers.
    254         for (const auto & elem : this->children_)
    255         {
    256             if ((elem)->isActive())
     254        for (TriggerBase* child : this->children_)
     255        {
     256            if (child->isActive())
    257257                return true;
    258258        }
     
    270270    {
    271271        bool test = false;
    272         for (const auto & elem : this->children_)
    273         {
    274             if (test && (elem)->isActive())
     272        for (TriggerBase* child : this->children_)
     273        {
     274            if (test && child->isActive())
    275275                return false;
    276             if ((elem)->isActive())
     276            if (child->isActive())
    277277                test = true;
    278278        }
  • code/branches/cpp11_v2/src/modules/overlays/hud/ChatOverlay.cc

    r10821 r10916  
    5858    ChatOverlay::~ChatOverlay()
    5959    {
    60         for (const auto & elem : this->timers_)
    61             delete (elem);
     60        for (Timer* timer : this->timers_)
     61            delete timer;
    6262    }
    6363
     
    9292        this->text_->setCaption("");
    9393
    94         for (auto & elem : this->messages_)
     94        for (const Ogre::DisplayString& message : this->messages_)
    9595        {
    96             this->text_->setCaption(this->text_->getCaption() + "\n" + (elem));
     96            this->text_->setCaption(this->text_->getCaption() + "\n" + message);
    9797        }
    9898    }
  • code/branches/cpp11_v2/src/modules/overlays/hud/HUDNavigation.cc

    r10821 r10916  
    131131        }
    132132        this->fontName_ = font;
    133         for (auto & elem : this->activeObjectList_)
    134         {
    135             if (elem.second.text_ != nullptr)
    136                 elem.second.text_->setFontName(this->fontName_);
     133        for (auto& mapEntry : this->activeObjectList_)
     134        {
     135            if (mapEntry.second.text_ != nullptr)
     136                mapEntry.second.text_->setFontName(this->fontName_);
    137137        }
    138138    }
     
    151151        }
    152152        this->textSize_ = size;
    153         for (auto & elem : this->activeObjectList_)
    154         {
    155             if (elem.second.text_)
    156                 elem.second.text_->setCharHeight(size);
     153        for (auto& mapEntry : this->activeObjectList_)
     154        {
     155            if (mapEntry.second.text_)
     156                mapEntry.second.text_->setCharHeight(size);
    157157        }
    158158    }
     
    186186        const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
    187187
    188         for (auto & elem : this->sortedObjectList_)
    189         elem.second = (int)((elem.first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f);
     188        for (std::pair<RadarViewable*, unsigned int>& pair : this->sortedObjectList_)
     189        pair.second = (int)((pair.first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f);
    190190
    191191        this->sortedObjectList_.sort(compareDistance);
     
    531531        float yScale = this->getActualSize().y;
    532532
    533         for (auto & elem : this->activeObjectList_)
    534         {
    535             if (elem.second.health_ != nullptr)
    536                 elem.second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
    537             if (elem.second.healthLevel_ != nullptr)
    538                 elem.second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);
    539             if (elem.second.panel_ != nullptr)
    540                 elem.second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
    541             if (elem.second.text_ != nullptr)
    542                 elem.second.text_->setCharHeight(this->textSize_ * yScale);
    543             if (elem.second.target_ != nullptr)
    544                 elem.second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale);
     533        for (auto& mapEntry : this->activeObjectList_)
     534        {
     535            if (mapEntry.second.health_ != nullptr)
     536                mapEntry.second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
     537            if (mapEntry.second.healthLevel_ != nullptr)
     538                mapEntry.second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);
     539            if (mapEntry.second.panel_ != nullptr)
     540                mapEntry.second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
     541            if (mapEntry.second.text_ != nullptr)
     542                mapEntry.second.text_->setCharHeight(this->textSize_ * yScale);
     543            if (mapEntry.second.target_ != nullptr)
     544                mapEntry.second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale);
    545545        }
    546546    }
     
    670670    {
    671671        const std::set<RadarViewable*>& respawnObjects = this->getOwner()->getScene()->getRadar()->getRadarObjects();
    672         for (const auto & respawnObject : respawnObjects)
    673         {
    674             if (!(respawnObject)->isHumanShip_)
     672        for (RadarViewable* respawnObject : respawnObjects)
     673        {
     674            if (!respawnObject->isHumanShip_)
    675675            this->addObject(respawnObject);
    676676        }
  • code/branches/cpp11_v2/src/modules/overlays/hud/HUDRadar.cc

    r10821 r10916  
    9292            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->map3DBack_);
    9393
    94             for (auto & elem : this->radarObjects_)
    95             {
    96                 Ogre::OverlayManager::getSingleton().destroyOverlayElement(elem.second);
     94            for (auto& mapEntry : this->radarObjects_)
     95            {
     96                Ogre::OverlayManager::getSingleton().destroyOverlayElement(mapEntry.second);
    9797            }
    9898        }
  • code/branches/cpp11_v2/src/modules/overlays/stats/Scoreboard.cc

    r10821 r10916  
    6060        SUPER(Scoreboard, changedVisibility);
    6161
    62         for (auto & elem : this->lines_)
    63             elem->changedVisibility();
     62        for (CreateLines* line : this->lines_)
     63            line->changedVisibility();
    6464    }
    6565
     
    9494
    9595        unsigned int index = 0;
    96         for (const auto & elem : playerList)
     96        for (const auto& mapEntry : playerList)
    9797        {
    98             this->lines_[index]->setPlayerName(multi_cast<std::string>(elem.first->getName()));
    99             this->lines_[index]->setScore(multi_cast<std::string>(elem.second.frags_));
    100             this->lines_[index]->setDeaths(multi_cast<std::string>(elem.second.killed_));
     98            this->lines_[index]->setPlayerName(multi_cast<std::string>(mapEntry.first->getName()));
     99            this->lines_[index]->setScore(multi_cast<std::string>(mapEntry.second.frags_));
     100            this->lines_[index]->setDeaths(multi_cast<std::string>(mapEntry.second.killed_));
    101101            index++;
    102102        }
  • code/branches/cpp11_v2/src/modules/pickup/PickupCollection.cc

    r10821 r10916  
    6868    {
    6969        // Destroy all Pickupables constructing this PickupCollection.
    70         for(auto & elem : this->pickups_)
    71         {
    72             (elem)->wasRemovedFromCollection();
    73             (elem)->destroy();
     70        for(CollectiblePickup* pickup : this->pickups_)
     71        {
     72            pickup->wasRemovedFromCollection();
     73            pickup->destroy();
    7474        }
    7575        this->pickups_.clear();
     
    9999        this->processingUsed_ = true;
    100100        // Change used for all Pickupables this PickupCollection consists of.
    101         for(auto & elem : this->pickups_)
    102             (elem)->setUsed(this->isUsed());
     101        for(CollectiblePickup* pickup : this->pickups_)
     102            pickup->setUsed(this->isUsed());
    103103
    104104        this->processingUsed_ = false;
     
    119119        size_t numPickupsEnabled = 0;
    120120        size_t numPickupsInUse = 0;
    121         for(auto & elem : this->pickups_)
    122         {
    123             if ((elem)->isEnabled())
     121        for(CollectiblePickup* pickup : this->pickups_)
     122        {
     123            if (pickup->isEnabled())
    124124                ++numPickupsEnabled;
    125             if ((elem)->isUsed())
     125            if (pickup->isUsed())
    126126                ++numPickupsInUse;
    127127        }
     
    146146
    147147        // Change the PickupCarrier for all Pickupables this PickupCollection consists of.
    148         for(auto & elem : this->pickups_)
     148        for(CollectiblePickup* pickup : this->pickups_)
    149149        {
    150150            if(this->getCarrier() == nullptr)
    151                 (elem)->setCarrier(nullptr);
     151                pickup->setCarrier(nullptr);
    152152            else
    153                 (elem)->setCarrier(this->getCarrier()->getTarget(elem));
     153                pickup->setCarrier(this->getCarrier()->getTarget(pickup));
    154154        }
    155155    }
     
    186186        // If at least all the enabled pickups of this PickupCollection are no longer picked up.
    187187        bool isOnePickupEnabledAndPickedUp = false;
    188         for(auto & elem : this->pickups_)
    189         {
    190             if ((elem)->isEnabled() && (elem)->isPickedUp())
     188        for(CollectiblePickup* pickup : this->pickups_)
     189        {
     190            if (pickup->isEnabled() && pickup->isPickedUp())
    191191            {
    192192                isOnePickupEnabledAndPickedUp = true;
     
    208208    bool PickupCollection::isTarget(const PickupCarrier* carrier) const
    209209    {
    210         for(const auto & elem : this->pickups_)
    211         {
    212             if(!carrier->isTarget(elem))
     210        for(CollectiblePickup* pickup : this->pickups_)
     211        {
     212            if(!carrier->isTarget(pickup))
    213213                return false;
    214214        }
  • code/branches/cpp11_v2/src/modules/pickup/PickupManager.cc

    r10821 r10916  
    9191
    9292        // Destroying all the PickupInventoryContainers that are still there.
    93         for(auto & elem : this->pickupInventoryContainers_)
    94             delete elem.second;
     93        for(auto& mapEntry : this->pickupInventoryContainers_)
     94            delete mapEntry.second;
    9595        this->pickupInventoryContainers_.clear();
    9696
  • code/branches/cpp11_v2/src/modules/pickup/items/MetaPickup.cc

    r10821 r10916  
    118118                std::set<Pickupable*> pickups = carrier->getPickups();
    119119                // Iterate over all Pickupables of the PickupCarrier.
    120                 for(auto pickup : pickups)
     120                for(Pickupable* pickup : pickups)
    121121                {
    122                    
    123122                    if(pickup == nullptr || pickup == this)
    124123                        continue;
  • 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
  • code/branches/cpp11_v2/src/modules/questsystem/GlobalQuest.cc

    r10821 r10916  
    9494
    9595        // Iterate through all players possessing this Quest.
    96         for(const auto & elem : players_)
    97             QuestEffect::invokeEffects(elem, this->getFailEffectList());
     96        for(PlayerInfo* questPlayer : players_)
     97            QuestEffect::invokeEffects(questPlayer, this->getFailEffectList());
    9898
    9999        return true;
     
    119119
    120120        // Iterate through all players possessing the Quest.
    121         for(const auto & elem : players_)
    122             QuestEffect::invokeEffects(elem, this->getCompleteEffectList());
     121        for(PlayerInfo* questPlayer : players_)
     122            QuestEffect::invokeEffects(questPlayer, this->getCompleteEffectList());
    123123
    124124        Quest::complete(player);
     
    242242    {
    243243        int i = index;
    244         for (const auto & elem : this->rewards_)
     244        for (QuestEffect* reward : this->rewards_)
    245245        {
    246246            if(i == 0)
    247                return elem;
     247               return reward;
    248248
    249249            i--;
  • code/branches/cpp11_v2/src/modules/questsystem/Quest.cc

    r10821 r10916  
    190190
    191191        // Iterate through all subquests.
    192         for (const auto & elem : this->subQuests_)
     192        for (Quest* quest : this->subQuests_)
    193193        {
    194194            if(i == 0) // We're counting down...
    195                return elem;
     195               return quest;
    196196
    197197            i--;
     
    214214
    215215        // Iterate through all QuestHints.
    216         for (const auto & elem : this->hints_)
     216        for (QuestHint* hint : this->hints_)
    217217        {
    218218            if(i == 0) // We're counting down...
    219                return elem;
     219               return hint;
    220220
    221221            i--;
     
    237237
    238238        // Iterate through all fail QuestEffects.
    239         for (const auto & elem : this->failEffects_)
     239        for (QuestEffect* effect : this->failEffects_)
    240240        {
    241241            if(i == 0) // We're counting down...
    242                return elem;
     242               return effect;
    243243
    244244            i--;
     
    260260
    261261        // Iterate through all complete QuestEffects.
    262         for (const auto & elem : this->completeEffects_)
     262        for (QuestEffect* effect : this->completeEffects_)
    263263        {
    264264            if(i == 0) // We're counting down...
    265                return elem;
     265               return effect;
    266266
    267267            i--;
  • code/branches/cpp11_v2/src/modules/questsystem/QuestEffect.cc

    r10821 r10916  
    7474        orxout(verbose, context::quests) << "Invoking QuestEffects on player: " << player << " ."  << endl;
    7575
    76         for (auto & effects_effect : effects)
    77             temp = temp && (effects_effect)->invoke(player);
     76        for (QuestEffect* effect : effects)
     77            temp = temp && effect->invoke(player);
    7878
    7979        return temp;
  • code/branches/cpp11_v2/src/modules/questsystem/QuestEffectBeacon.cc

    r10821 r10916  
    236236    {
    237237        int i = index;
    238         for (const auto & elem : this->effects_)
     238        for (QuestEffect* effect : this->effects_)
    239239        {
    240240            if(i == 0)
    241                return elem;
     241               return effect;
    242242
    243243            i--;
  • code/branches/cpp11_v2/src/modules/questsystem/QuestListener.cc

    r10821 r10916  
    9797    /* static */ void QuestListener::advertiseStatusChange(std::list<QuestListener*> & listeners, const std::string & status)
    9898    {
    99         for (auto listener : listeners) // Iterate through all QuestListeners
    100         {
    101            
     99        for (QuestListener* listener : listeners) // Iterate through all QuestListeners
     100        {
    102101            if(listener->getMode() == status || listener->getMode() == QuestListener::ALL) // Check whether the status change affects the give QuestListener.
    103102                listener->execute();
  • code/branches/cpp11_v2/src/modules/questsystem/QuestManager.cc

    r10821 r10916  
    235235    {
    236236        int numQuests = 0;
    237         for(auto & elem : this->questMap_)
    238         {
    239             if(elem.second->getParentQuest() == nullptr && !elem.second->isInactive(player))
     237        for(auto& mapEntry : this->questMap_)
     238        {
     239            if(mapEntry.second->getParentQuest() == nullptr && !mapEntry.second->isInactive(player))
    240240                numQuests++;
    241241        }
     
    255255    Quest* QuestManager::getRootQuest(PlayerInfo* player, int index)
    256256    {
    257         for(auto & elem : this->questMap_)
    258         {
    259             if(elem.second->getParentQuest() == nullptr && !elem.second->isInactive(player) && index-- == 0)
    260                 return elem.second;
     257        for(auto& mapEntry : this->questMap_)
     258        {
     259            if(mapEntry.second->getParentQuest() == nullptr && !mapEntry.second->isInactive(player) && index-- == 0)
     260                return mapEntry.second;
    261261        }
    262262        return nullptr;
     
    280280        std::list<Quest*> quests = quest->getSubQuestList();
    281281        int numQuests = 0;
    282         for(auto & quest : quests)
    283         {
    284             if(!(quest)->isInactive(player))
     282        for(Quest* subquest : quests)
     283        {
     284            if(!subquest->isInactive(player))
    285285                numQuests++;
    286286        }
     
    304304
    305305        std::list<Quest*> quests = quest->getSubQuestList();
    306         for(auto & quest : quests)
    307         {
    308             if(!(quest)->isInactive(player) && index-- == 0)
     306        for(Quest* subquest : quests)
     307        {
     308            if(!subquest->isInactive(player) && index-- == 0)
    309309                return quest;
    310310        }
     
    326326        std::list<QuestHint*> hints = quest->getHintsList();
    327327        int numHints = 0;
    328         for(auto & hint : hints)
    329         {
    330             if((hint)->isActive(player))
     328        for(QuestHint* hint : hints)
     329        {
     330            if(hint->isActive(player))
    331331                numHints++;
    332332        }
     
    349349    {
    350350        std::list<QuestHint*> hints = quest->getHintsList();
    351         for(auto & hint : hints)
    352         {
    353             if((hint)->isActive(player) && index-- == 0)
     351        for(QuestHint* hint : hints)
     352        {
     353            if(hint->isActive(player) && index-- == 0)
    354354                return hint;
    355355        }
  • code/branches/cpp11_v2/src/modules/questsystem/effects/AddReward.cc

    r10821 r10916  
    8484    {
    8585        int i = index;
    86         for (const auto & elem : this->rewards_)
     86        for (Rewardable* reward : this->rewards_)
    8787        {
    8888            if(i == 0)
    89                return elem;
     89               return reward;
    9090            i--;
    9191        }
     
    106106
    107107        bool temp = true;
    108         for (auto & elem : this->rewards_)
    109             temp = temp && (elem)->reward(player);
     108        for (Rewardable* reward : this->rewards_)
     109            temp = temp && reward->reward(player);
    110110
    111111        orxout(verbose, context::quests) << "Rewardable successfully added to player." << player << " ." << endl;
  • 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();
  • code/branches/cpp11_v2/src/modules/towerdefense/TowerDefense.cc

    r10821 r10916  
    183183            en1->lookAt(waypoints_.at(1)->getPosition() + offset_);
    184184
    185             for (auto & elem : waypoints_)
     185            for (TowerDefenseField* field : waypoints_)
    186186            {
    187187                orxonox::WeakPtr<MovableEntity> waypoint = new MovableEntity(this->center_->getContext());
    188                 waypoint->setPosition(elem->getPosition() + offset_);
     188                waypoint->setPosition(field->getPosition() + offset_);
    189189                controller->addWaypoint(waypoint);
    190190            }
Note: See TracChangeset for help on using the changeset viewer.