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/pickup
Files:
3 edited

Legend:

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