Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

made mapEntry const& wherever possible

Location:
code/branches/cpp11_v2/src/modules
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceController.cc

    r10916 r10917  
    161161
    162162        std::vector<RaceCheckPoint*> returnVec;
    163         for (auto& mapEntry : zaehler)
     163        for (const auto& mapEntry : zaehler)
    164164        {
    165165            if (mapEntry.second == maxWays)
  • code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceManager.cc

    r10916 r10917  
    7777        }
    7878
    79         for (auto& mapEntry : players_)
     79        for (const auto& mapEntry : players_)
    8080        {
    8181
  • code/branches/cpp11_v2/src/modules/mini4dgame/Mini4Dgame.cc

    r10916 r10917  
    155155    {
    156156        // first spawn human players to assign always the left bat to the player in singleplayer
    157         for (auto& mapEntry : this->players_)
     157        for (const auto& mapEntry : this->players_)
    158158            if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
    159159                this->spawnPlayer(mapEntry.first);
    160160        // now spawn bots
    161         for (auto& mapEntry : this->players_)
     161        for (const auto& mapEntry : this->players_)
    162162            if (!mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
    163163                this->spawnPlayer(mapEntry.first);
  • code/branches/cpp11_v2/src/modules/notifications/NotificationManager.cc

    r10916 r10917  
    6969    {
    7070        // Destroys all Notifications.
    71         for(auto& mapEntry : this->allNotificationsList_)
     71        for(const auto& mapEntry : this->allNotificationsList_)
    7272            mapEntry.second->destroy();
    7373        this->allNotificationsList_.clear();
     
    152152        bool executed = false;
    153153        // Clear all NotificationQueues that have the input sender as target.
    154         for(auto& mapEntry : this->queues_) // Iterate through all NotificationQueues.
     154        for(const auto& mapEntry : this->queues_) // Iterate through all NotificationQueues.
    155155        {
    156156            const std::set<std::string>& set = mapEntry.second->getTargetsSet();
     
    187187
    188188        // Insert the Notification in all NotificationQueues that have its sender as target.
    189         for(auto& mapEntry : this->queues_) // Iterate through all NotificationQueues.
     189        for(const auto& mapEntry : this->queues_) // Iterate through all NotificationQueues.
    190190        {
    191191            const std::set<std::string>& set = mapEntry.second->getTargetsSet();
     
    345345
    346346        // Iterate through all Notifications to determine whether any of them should belong to the newly registered NotificationQueue.
    347         for(auto& mapEntry : this->allNotificationsList_)
     347        for(const auto& mapEntry : this->allNotificationsList_)
    348348        {
    349349            if(!bAll && set.find(mapEntry.second->getSender()) != set.end()) // Checks whether the listener has the sender of the current Notification as target.
  • code/branches/cpp11_v2/src/modules/notifications/NotificationQueue.cc

    r10916 r10917  
    206206        {
    207207            // Add all Notifications that have been created after this NotificationQueue was created.
    208             for(auto& mapEntry : *notifications)
     208            for(const auto& mapEntry : *notifications)
    209209            {
    210210                if(mapEntry.first >= this->creationTime_)
  • code/branches/cpp11_v2/src/modules/overlays/hud/HUDNavigation.cc

    r10916 r10917  
    131131        }
    132132        this->fontName_ = font;
    133         for (auto& mapEntry : this->activeObjectList_)
     133        for (const auto& mapEntry : this->activeObjectList_)
    134134        {
    135135            if (mapEntry.second.text_ != nullptr)
     
    151151        }
    152152        this->textSize_ = size;
    153         for (auto& mapEntry : this->activeObjectList_)
     153        for (const auto& mapEntry : this->activeObjectList_)
    154154        {
    155155            if (mapEntry.second.text_)
     
    531531        float yScale = this->getActualSize().y;
    532532
    533         for (auto& mapEntry : this->activeObjectList_)
     533        for (const auto& mapEntry : this->activeObjectList_)
    534534        {
    535535            if (mapEntry.second.health_ != nullptr)
  • code/branches/cpp11_v2/src/modules/overlays/hud/HUDRadar.cc

    r10916 r10917  
    9292            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->map3DBack_);
    9393
    94             for (auto& mapEntry : this->radarObjects_)
     94            for (const auto& mapEntry : this->radarObjects_)
    9595            {
    9696                Ogre::OverlayManager::getSingleton().destroyOverlayElement(mapEntry.second);
  • code/branches/cpp11_v2/src/modules/pickup/PickupManager.cc

    r10916 r10917  
    9191
    9292        // Destroying all the PickupInventoryContainers that are still there.
    93         for(auto& mapEntry : this->pickupInventoryContainers_)
     93        for(const auto& mapEntry : this->pickupInventoryContainers_)
    9494            delete mapEntry.second;
    9595        this->pickupInventoryContainers_.clear();
  • code/branches/cpp11_v2/src/modules/pong/Pong.cc

    r10916 r10917  
    211211    {
    212212        // first spawn human players to assign always the left bat to the player in singleplayer
    213         for (auto& mapEntry : this->players_)
     213        for (const auto& mapEntry : this->players_)
    214214            if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
    215215                this->spawnPlayer(mapEntry.first);
    216216        // now spawn bots
    217         for (auto& mapEntry : this->players_)
     217        for (const auto& mapEntry : this->players_)
    218218            if (!mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
    219219                this->spawnPlayer(mapEntry.first);
  • code/branches/cpp11_v2/src/modules/questsystem/QuestManager.cc

    r10916 r10917  
    235235    {
    236236        int numQuests = 0;
    237         for(auto& mapEntry : this->questMap_)
     237        for(const auto& mapEntry : this->questMap_)
    238238        {
    239239            if(mapEntry.second->getParentQuest() == nullptr && !mapEntry.second->isInactive(player))
     
    255255    Quest* QuestManager::getRootQuest(PlayerInfo* player, int index)
    256256    {
    257         for(auto& mapEntry : this->questMap_)
     257        for(const auto& mapEntry : this->questMap_)
    258258        {
    259259            if(mapEntry.second->getParentQuest() == nullptr && !mapEntry.second->isInactive(player) && index-- == 0)
  • code/branches/cpp11_v2/src/modules/tetris/Tetris.cc

    r10916 r10917  
    341341    {
    342342        // Spawn a human player.
    343         for (auto& mapEntry : this->players_)
     343        for (const auto& mapEntry : this->players_)
    344344            if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
    345345                this->spawnPlayer(mapEntry.first);
Note: See TracChangeset for help on using the changeset viewer.