Changeset 2010 for code/branches/objecthierarchy/src/orxonox/objects
- Timestamp:
- Oct 25, 2008, 5:13:35 PM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/orxonox/objects/infos
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/objects/infos/LevelInfo.cc
r2006 r2010 38 38 #include "core/ConsoleCommand.h" 39 39 #include "core/Loader.h" 40 #include "core/XMLFile.h" 40 41 #include "core/Template.h" 41 42 … … 152 153 XMLPortParam(LevelInfo, "ambientlight", setAmbientLight, getAmbientLight, xmlelement, mode).defaultValues(ColourValue(0.2, 0.2, 0.2, 1)); 153 154 154 this-> levelfile_ = this->getLevelfile();155 this->xmlfile_ = this->getFilename(); 155 156 } 156 157 157 158 void LevelInfo::registerVariables() 158 159 { 159 REGISTERSTRING(this-> levelfile_, network::direction::toclient, new network::NetworkCallback<LevelInfo>(this, &LevelInfo::applyLevel));160 REGISTERSTRING(this->name_, 161 REGISTERSTRING(this->description_, 162 REGISTERSTRING(this->skybox_, 163 REGISTERDATA(this->ambientLight_, network::direction::toclient, new network::NetworkCallback<LevelInfo>(this, &LevelInfo::applyAmbientLight));164 } 165 166 void LevelInfo::apply Level()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; 169 170 170 171 ClassTreeMask mask; … … 172 173 mask.include(Class(Template)); 173 174 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); 177 178 } 178 179 -
code/branches/objecthierarchy/src/orxonox/objects/infos/LevelInfo.h
r2006 r2010 80 80 virtual void clientDisconnected(unsigned int clientID); 81 81 82 void apply Level();82 void applyXMLFile(); 83 83 84 84 void applySkybox() … … 94 94 SubclassIdentifier<Gametype> gametypeIdentifier_; 95 95 Gametype* rootGametype_; 96 std::string levelfile_;96 std::string xmlfile_; 97 97 }; 98 98 }
Note: See TracChangeset
for help on using the changeset viewer.