Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 23, 2009, 8:04:51 PM (15 years ago)
Author:
rgrieder
Message:

Moved GUIManager::getLevelList to LevelManager because the GUIManager has nothing to do with levels.
I also had to change the way the information flows: Instead of operation on the Lua state, you tell the LevelManager to compile the list and then get the elements one by one.
The reason for this change is simple: There is no way to know from which LuaState the call came (without making an ugly hack in Tolua itself).

Location:
code/branches/resource/src/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/resource/src/core/Loader.cc

    r3196 r3339  
    3030
    3131#include <tinyxml/ticpp.h>
    32 #include <boost/filesystem.hpp>
    3332
    3433#include "util/Debug.h"
    3534#include "util/Exception.h"
    3635#include "BaseObject.h"
    37 #include "Core.h"
    3836#include "Iterator.h"
    3937#include "ObjectList.h"
     
    210208        return Loader::load(file, mask);
    211209    }
    212 
    213     std::vector<std::string> Loader::getLevelList()
    214     {
    215         std::vector<std::string> levelList;
    216 
    217         boost::filesystem::directory_iterator file(Core::getMediaPathString() + "levels");
    218         boost::filesystem::directory_iterator end;
    219 
    220         while (file != end)
    221         {
    222             if (!boost::filesystem::is_directory(*file) && file->string()[file->string().length()-1] != '~')
    223             {
    224                 std::string filename = file->path().leaf();
    225                 if (filename.length() > 4)
    226                     levelList.push_back(filename.substr(0,filename.length()-4));
    227             }
    228             ++file;
    229         }
    230         return levelList;
    231     }
    232210}
  • code/branches/resource/src/core/Loader.h

    r3196 r3339  
    5656
    5757            static ClassTreeMask currentMask_s;
    58             static std::vector<std::string> getLevelList();
    5958
    6059        private:
Note: See TracChangeset for help on using the changeset viewer.