Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 10, 2016, 1:54:11 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v2 into cpp11_v3

Location:
code/branches/cpp11_v3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/orxonox/items/MultiStateEngine.cc

    r9939 r11054  
    6767        else
    6868        {
    69             this->defEngineSndBoost_ = 0;
    70             this->defEngineSndNormal_ = 0;
    71             this->lua_ = 0;
     69            this->defEngineSndBoost_ = nullptr;
     70            this->defEngineSndNormal_ = nullptr;
     71            this->lua_ = nullptr;
    7272        }
    7373        this->state_ = 0;
     
    8585            {
    8686                // We have no ship, so the effects are not attached and won't be destroyed automatically
    87                 for (std::vector<EffectContainer*>::const_iterator it = this->effectContainers_.begin(); it != this->effectContainers_.end(); ++it)
    88                     for (std::vector<WorldEntity*>::const_iterator it2 = (*it)->getEffectsBegin(); it2 != (*it)->getEffectsBegin(); ++it2)
    89                         (*it2)->destroy();
     87                for (EffectContainer* container : this->effectContainers_)
     88                    for (std::vector<WorldEntity*>::const_iterator it = container->getEffectsBegin(); it != container->getEffectsBegin(); ++it)
     89                        (*it)->destroy();
    9090                if (this->defEngineSndNormal_)
    9191                    this->defEngineSndNormal_->destroy();
     
    178178
    179179                // Update all effect conditions
    180                 for (std::vector<EffectContainer*>::const_iterator it = this->effectContainers_.begin(); it != this->effectContainers_.end(); ++it)
    181                     (*it)->updateCondition();
     180                for (EffectContainer* container : this->effectContainers_)
     181                    container->updateCondition();
    182182            }
    183183        }
     
    198198            this->getShip()->attach(defEngineSndBoost_);
    199199
    200         for (std::vector<EffectContainer*>::const_iterator it = this->effectContainers_.begin(); it != this->effectContainers_.end(); ++it)
    201             for (std::vector<WorldEntity*>::const_iterator it2 = (*it)->getEffectsBegin(); it2 != (*it)->getEffectsEnd(); ++it2)
    202                 this->getShip()->attach(*it2);
     200        for (EffectContainer* container : this->effectContainers_)
     201            for (std::vector<WorldEntity*>::const_iterator it = container->getEffectsBegin(); it != container->getEffectsEnd(); ++it)
     202                this->getShip()->attach(*it);
    203203    }
    204204
    205205    void MultiStateEngine::addEffectContainer(EffectContainer* effect)
    206206    {
    207         if (effect == NULL)
     207        if (effect == nullptr)
    208208            return;
    209209        effect->setLuaState(this->lua_, 'f' + multi_cast<std::string>(this->effectContainers_.size()));
     
    219219    {
    220220        unsigned int i = 0;
    221         for (std::vector<EffectContainer*>::const_iterator it = this->effectContainers_.begin(); it != this->effectContainers_.end(); ++it)
     221        for (EffectContainer* effectContainer : this->effectContainers_)
    222222        {
    223223            if (i == index)
    224                 return (*it);
    225         }
    226         return NULL;
     224                return effectContainer;
     225            i++;
     226        }
     227        return nullptr;
    227228    }
    228229
Note: See TracChangeset for help on using the changeset viewer.