Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 25, 2008, 5:13:35 PM (16 years ago)
Author:
landauf
Message:

renamed Level to XMLFile

Location:
code/branches/objecthierarchy/src/orxonox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/orxonox/gamestates/GSDedicated.cc

    r2003 r2010  
    3535#include "core/CommandLine.h"
    3636#include "core/Loader.h"
     37#include "core/XMLFile.h"
    3738#include "core/Core.h"
    3839#include "network/Server.h"
     
    4849        , server_(0)
    4950        , sceneManager_(0)
    50         , startLevel_(0)
     51        , startFile_(0)
    5152    {
    5253    }
     
    7475        // call the loader
    7576        COUT(0) << "Loading level..." << std::endl;
    76         startLevel_ = new Level(Settings::getDataPath() + "levels/sample.oxw");
    77         Loader::open(startLevel_);
     77        startFile_ = new XMLFile(Settings::getDataPath() + "levels/sample.oxw");
     78        Loader::open(startFile_);
    7879
    7980        server_->open();
     
    8990        // TODO: Remove and destroy console command
    9091
    91         Loader::unload(startLevel_);
    92         delete this->startLevel_;
     92        Loader::unload(startFile_);
     93        delete this->startFile_;
    9394
    9495        this->server_->close();
  • code/branches/objecthierarchy/src/orxonox/gamestates/GSDedicated.h

    r1755 r2010  
    5656        network::Server*      server_;
    5757        Ogre::SceneManager*   sceneManager_;
    58         Level*                startLevel_;       //!< current hard coded default level
     58        XMLFile*              startFile_;        //!< current hard coded default level
    5959    };
    6060}
  • code/branches/objecthierarchy/src/orxonox/gamestates/GSLevel.cc

    r2006 r2010  
    3636#include "core/input/KeyBinder.h"
    3737#include "core/Loader.h"
     38#include "core/XMLFile.h"
    3839#include "core/CommandExecutor.h"
    3940#include "core/ConsoleCommand.h"
     
    5657        , inputState_(0)
    5758        , radar_(0)
    58         , startLevel_(0)
     59        , startFile_(0)
    5960    {
    6061        RegisterObject(GSLevel);
     
    154155        // call the loader
    155156        COUT(0) << "Loading level..." << std::endl;
    156         startLevel_ = new Level(Settings::getDataPath() + "levels/sample2.oxw");
    157         Loader::open(startLevel_);
     157        startFile_ = new XMLFile(Settings::getDataPath() + "levels/sample2.oxw");
     158        Loader::open(startFile_);
    158159    }
    159160
    160161    void GSLevel::unloadLevel()
    161162    {
    162         Loader::unload(startLevel_);
    163         delete this->startLevel_;
     163        Loader::unload(startFile_);
     164        delete this->startFile_;
    164165    }
    165166
  • code/branches/objecthierarchy/src/orxonox/gamestates/GSLevel.h

    r2006 r2010  
    6868        SimpleInputState*     inputState_;
    6969        Radar*                radar_;            //!< represents the Radar (not the HUD part)
    70         Level*                startLevel_;       //!< current hard coded default level
     70        XMLFile*              startFile_;        //!< current hard coded default level
    7171
    7272        // config values
  • code/branches/objecthierarchy/src/orxonox/objects/infos/LevelInfo.cc

    r2006 r2010  
    3838#include "core/ConsoleCommand.h"
    3939#include "core/Loader.h"
     40#include "core/XMLFile.h"
    4041#include "core/Template.h"
    4142
     
    152153        XMLPortParam(LevelInfo, "ambientlight", setAmbientLight, getAmbientLight, xmlelement, mode).defaultValues(ColourValue(0.2, 0.2, 0.2, 1));
    153154
    154         this->levelfile_ = this->getLevelfile();
     155        this->xmlfile_ = this->getFilename();
    155156    }
    156157
    157158    void LevelInfo::registerVariables()
    158159    {
    159         REGISTERSTRING(this->levelfile_,    network::direction::toclient, new network::NetworkCallback<LevelInfo>(this, &LevelInfo::applyLevel));
    160         REGISTERSTRING(this->name_,         network::direction::toclient, new network::NetworkCallback<LevelInfo>(this, &LevelInfo::changedName));
    161         REGISTERSTRING(this->description_,  network::direction::toclient);
    162         REGISTERSTRING(this->skybox_,       network::direction::toclient, new network::NetworkCallback<LevelInfo>(this, &LevelInfo::applySkybox));
    163         REGISTERDATA(this->ambientLight_, network::direction::toclient, new network::NetworkCallback<LevelInfo>(this, &LevelInfo::applyAmbientLight));
    164     }
    165 
    166     void LevelInfo::applyLevel()
    167     {
    168         COUT(0) << "Loading level \"" << this->levelfile_ << "\"..." << std::endl;
     160        REGISTERSTRING(this->xmlfile_,     network::direction::toclient, new network::NetworkCallback<LevelInfo>(this, &LevelInfo::applyXMLFile));
     161        REGISTERSTRING(this->name_,        network::direction::toclient, new network::NetworkCallback<LevelInfo>(this, &LevelInfo::changedName));
     162        REGISTERSTRING(this->description_, network::direction::toclient);
     163        REGISTERSTRING(this->skybox_,      network::direction::toclient, new network::NetworkCallback<LevelInfo>(this, &LevelInfo::applySkybox));
     164        REGISTERDATA(this->ambientLight_,  network::direction::toclient, new network::NetworkCallback<LevelInfo>(this, &LevelInfo::applyAmbientLight));
     165    }
     166
     167    void LevelInfo::applyXMLFile()
     168    {
     169        COUT(0) << "Loading level \"" << this->xmlfile_ << "\"..." << std::endl;
    169170
    170171        ClassTreeMask mask;
     
    172173        mask.include(Class(Template));
    173174
    174         Level* level = new Level(Settings::getDataPath() + this->levelfile_, mask);
    175 
    176         Loader::open(level);
     175        XMLFile* file = new XMLFile(Settings::getDataPath() + this->xmlfile_, mask);
     176
     177        Loader::open(file);
    177178    }
    178179
  • code/branches/objecthierarchy/src/orxonox/objects/infos/LevelInfo.h

    r2006 r2010  
    8080            virtual void clientDisconnected(unsigned int clientID);
    8181
    82             void applyLevel();
     82            void applyXMLFile();
    8383
    8484            void applySkybox()
     
    9494            SubclassIdentifier<Gametype> gametypeIdentifier_;
    9595            Gametype* rootGametype_;
    96             std::string levelfile_;
     96            std::string xmlfile_;
    9797    };
    9898}
Note: See TracChangeset for help on using the changeset viewer.