Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 10, 2016, 1:54:11 PM (9 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/modules/docking/Dock.cc

    r10624 r11054  
    8787
    8888        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
    89         PlayerInfo* player = NULL;
     89        PlayerInfo* player = nullptr;
    9090
    9191        // Check whether it is a player trigger and extract pawn from it
    92         if(pTrigger != NULL)
     92        if(pTrigger != nullptr)
    9393        {
    9494            if(!pTrigger->isForPlayer()) {  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
     
    103103            return false;
    104104        }
    105         if(player == NULL)
     105        if(player == nullptr)
    106106        {
    107107            orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl;
     
    131131    {
    132132        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
    133         PlayerInfo* player = NULL;
     133        PlayerInfo* player = nullptr;
    134134
    135135        // Check whether it is a player trigger and extract pawn from it
    136         if(pTrigger != NULL)
     136        if(pTrigger != nullptr)
    137137        {
    138138            if(!pTrigger->isForPlayer()) {  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
     
    147147            return false;
    148148        }
    149         if(player == NULL)
     149        if(player == nullptr)
    150150        {
    151151            orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl;
     
    214214    {
    215215        PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
    216         for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
    217         {
    218             if(it->dock(player))
     216        for(Dock* dock : ObjectList<Dock>())
     217        {
     218            if(dock->dock(player))
    219219                break;
    220220        }
     
    224224    {
    225225        PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
    226         for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
    227         {
    228             if(it->undock(player))
     226        for(Dock* dock : ObjectList<Dock>())
     227        {
     228            if(dock->undock(player))
    229229                break;
    230230        }
     
    295295        int i = 0;
    296296        PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
    297         for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
    298         {
    299             if(it->candidates_.find(player) != it->candidates_.end())
     297        for(Dock* dock : ObjectList<Dock>())
     298        {
     299            if(dock->candidates_.find(player) != dock->candidates_.end())
    300300                i++;
    301301        }
     
    306306    {
    307307        PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
    308         for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
    309         {
    310             if(it->candidates_.find(player) != it->candidates_.end())
     308        for(Dock* dock : ObjectList<Dock>())
     309        {
     310            if(dock->candidates_.find(player) != dock->candidates_.end())
    311311            {
    312312                if(index == 0)
    313                     return *it;
     313                    return dock;
    314314                index--;
    315315            }
    316316        }
    317         return NULL;
     317        return nullptr;
    318318    }
    319319
     
    327327    const DockingEffect* Dock::getEffect(unsigned int i) const
    328328    {
    329         for (std::list<DockingEffect*>::const_iterator effect = this->effects_.begin(); effect != this->effects_.end(); ++effect)
     329        for (DockingEffect* effect : this->effects_)
    330330        {
    331331            if(i == 0)
    332                return *effect;
     332               return effect;
    333333            i--;
    334334        }
    335         return NULL;
     335        return nullptr;
    336336    }
    337337
     
    346346    const DockingAnimation* Dock::getAnimation(unsigned int i) const
    347347    {
    348         for (std::list<DockingAnimation*>::const_iterator animation = this->animations_.begin(); animation != this->animations_.end(); ++animation)
     348        for (DockingAnimation* animation : this->animations_)
    349349        {
    350350            if(i == 0)
    351                return *animation;
     351               return animation;
    352352            i--;
    353353        }
    354         return NULL;
     354        return nullptr;
    355355    }
    356356}
Note: See TracChangeset for help on using the changeset viewer.