Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/LevelManager.cc

    r11020 r11071  
    7878    {
    7979        // Delete all the LevelInfoItem objects because the LevelManager created them
    80         std::set<LevelInfoItem*, LevelInfoCompare>::iterator it = availableLevels_.begin();
    81         for (; it != availableLevels_.end(); ++it)
    82             (*it)->destroy();
     80        for (LevelInfoItem* info : availableLevels_)
     81            info->destroy();
    8382    }
    8483
     
    154153        Get the currently active Level.
    155154    @return
    156         Returns a pointer to the currently active level or NULL if there currently are no active Levels.
     155        Returns a pointer to the currently active level or nullptr if there currently are no active Levels.
    157156    */
    158157    Level* LevelManager::getActiveLevel()
     
    161160            return this->levels_.front();
    162161        else
    163             return 0;
     162            return nullptr;
    164163    }
    165164
     
    175174            this->levels_.front()->setActive(true);
    176175            // Make every player enter the newly activated level.
    177             for (std::map<unsigned int, PlayerInfo*>::const_iterator it = PlayerManager::getInstance().getClients().begin(); it != PlayerManager::getInstance().getClients().end(); ++it)
    178                 this->levels_.front()->playerEntered(it->second);
     176            for (const auto& mapEntry : PlayerManager::getInstance().getClients())
     177                this->levels_.front()->playerEntered(mapEntry.second);
    179178        }
    180179    }
     
    218217    {
    219218        if(index >= this->availableLevels_.size())
    220             return NULL;
     219            return nullptr;
    221220
    222221        // If this index directly follows the last we can optimize a lot.
     
    272271            if (it->find("old/") != 0)
    273272            {
    274                 LevelInfoItem* info = NULL;
     273                LevelInfoItem* info = nullptr;
    275274
    276275                // Load the LevelInfo object from the level file.
     
    279278
    280279                // Find the LevelInfo object we've just loaded (if there was one)
    281                 for(ObjectList<LevelInfo>::iterator item = ObjectList<LevelInfo>::begin(); item != ObjectList<LevelInfo>::end(); ++item)
    282                     if(item->getXMLFilename() == *it)
    283                         info = item->copy();
     280                for(LevelInfo* levelInfo : ObjectList<LevelInfo>())
     281                    if(levelInfo->getXMLFilename() == *it)
     282                        info = levelInfo->copy();
    284283
    285284                // We don't need the loaded stuff anymore
    286285                Loader::getInstance().unload(&file);
    287286
    288                 if(info == NULL)
     287                if(info == nullptr)
    289288                {
    290289                    // Create a default LevelInfoItem object that merely contains the name
Note: See TracChangeset for help on using the changeset viewer.