Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2015, 11:22:03 PM (8 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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            }
Note: See TracChangeset for help on using the changeset viewer.