Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 9, 2009, 5:15:14 PM (15 years ago)
Author:
landauf
Message:

list of remaining objects after a level unloading

Location:
code/branches/core5/src/orxonox/gamestates
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/orxonox/gamestates/GSLevel.cc

    r5910 r5922  
    150150    void GSLevel::loadLevel()
    151151    {
     152        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
     153            this->staticObjects_.insert(*it);
     154       
    152155        // call the loader
    153156        COUT(0) << "Loading level..." << std::endl;
     
    160163        Loader::unload(startFile_);
    161164        delete startFile_;
     165
     166        COUT(3) << "Unloaded level. Remaining objects:" << std::endl;
     167        unsigned int i = 0;
     168        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
     169        {
     170            std::set<BaseObject*>::const_iterator find = this->staticObjects_.find(*it);
     171            if (find == this->staticObjects_.end())
     172            {
     173                COUT(3) << ++i << ": " << it->getIdentifier()->getName() << " (" << *it << ")" << std::endl;
     174            }
     175        }
     176        COUT(3) << i << " objects remaining.";
     177        if (i == 0)
     178            COUT(3) << " Well done!" << std::endl;
     179        else
     180            COUT(3) << " Try harder!" << std::endl;
    162181    }
    163182}
  • code/branches/core5/src/orxonox/gamestates/GSLevel.h

    r5876 r5922  
    3333
    3434#include <string>
     35#include <set>
    3536#include "core/OrxonoxClass.h"
    3637#include "core/GameState.h"
     
    5859
    5960        XMLFile* startFile_;
     61        std::set<BaseObject*> staticObjects_;
    6062    };
    6163}
Note: See TracChangeset for help on using the changeset viewer.