Changeset 1993 for code/branches/objecthierarchy/src/core
- Timestamp:
- Oct 22, 2008, 5:25:01 AM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/core/BaseObject.cc
r1989 r1993 38 38 #include "Level.h" 39 39 #include "Template.h" 40 #include "util/String.h" 40 41 41 42 namespace orxonox … … 87 88 const std::string& BaseObject::getLevelfile() const 88 89 { 89 return this->level_->getFile(); 90 if (this->level_) 91 return this->level_->getFile(); 92 else 93 return blankString; 90 94 } 91 95 -
code/branches/objecthierarchy/src/core/Template.cc
r1989 r1993 33 33 #include "core/XMLPort.h" 34 34 #include "util/Debug.h" 35 #include "tinyxml/ticpp.h" 35 36 36 37 namespace orxonox … … 38 39 CreateFactory(Template); 39 40 40 Template::Template() 41 Template::Template() : xmlelement_("") 41 42 { 42 43 RegisterObject(Template); … … 59 60 XMLPortParam(Template, "baseclass", setBaseclass, getBaseclass, xmlelement, mode); 60 61 61 this->setXMLElement(* xmlelement.FirstChildElement(false));62 this->setXMLElement(*dynamic_cast<TiXmlElement*>(xmlelement.FirstChildElement(false)->GetTiXmlPointer())); 62 63 } 63 64 … … 79 80 } 80 81 81 const Element& Template::getXMLElement() const82 const TiXmlElement& Template::getXMLElement() const 82 83 { 83 84 if (this->bIsLink_) … … 89 90 { 90 91 this->bIsReturningXMLElement_ = true; 91 const Element& element = temp->getXMLElement();92 const TiXmlElement& element = temp->getXMLElement(); 92 93 this->bIsReturningXMLElement_ = false; 93 94 return element; … … 127 128 COUT(4) << object->getLoaderIndentation() << " aplying Template \"" << this->getName() << "\"..." << std::endl; 128 129 129 Element temp = this->getXMLElement();130 Element temp = ((TiXmlElement*)&this->getXMLElement()); 130 131 object->XMLPort(temp, XMLPort::LoadObject); 131 132 } -
code/branches/objecthierarchy/src/core/Template.h
r1989 r1993 35 35 36 36 #include "BaseObject.h" 37 #include "tinyxml/ti cpp.h"37 #include "tinyxml/tinyxml.h" 38 38 39 39 namespace orxonox … … 53 53 { return this->link_; } 54 54 55 inline void setXMLElement(const Element& xmlelement)55 inline void setXMLElement(const TiXmlElement& xmlelement) 56 56 { this->xmlelement_ = xmlelement; } 57 const Element& getXMLElement() const;57 const TiXmlElement& getXMLElement() const; 58 58 59 59 void setBaseclass(const std::string& baseclass); … … 70 70 71 71 private: 72 Element xmlelement_;72 TiXmlElement xmlelement_; 73 73 std::string link_; 74 74 std::string baseclass_;
Note: See TracChangeset
for help on using the changeset viewer.