Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 22, 2008, 5:25:01 AM (16 years ago)
Author:
landauf
Message:

added several new classes

Location:
code/branches/objecthierarchy/src/core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/core/BaseObject.cc

    r1989 r1993  
    3838#include "Level.h"
    3939#include "Template.h"
     40#include "util/String.h"
    4041
    4142namespace orxonox
     
    8788    const std::string& BaseObject::getLevelfile() const
    8889    {
    89         return this->level_->getFile();
     90        if (this->level_)
     91            return this->level_->getFile();
     92        else
     93            return blankString;
    9094    }
    9195
  • code/branches/objecthierarchy/src/core/Template.cc

    r1989 r1993  
    3333#include "core/XMLPort.h"
    3434#include "util/Debug.h"
     35#include "tinyxml/ticpp.h"
    3536
    3637namespace orxonox
     
    3839    CreateFactory(Template);
    3940
    40     Template::Template()
     41    Template::Template() : xmlelement_("")
    4142    {
    4243        RegisterObject(Template);
     
    5960        XMLPortParam(Template, "baseclass", setBaseclass, getBaseclass, xmlelement, mode);
    6061
    61         this->setXMLElement(*xmlelement.FirstChildElement(false));
     62        this->setXMLElement(*dynamic_cast<TiXmlElement*>(xmlelement.FirstChildElement(false)->GetTiXmlPointer()));
    6263    }
    6364
     
    7980    }
    8081
    81     const Element& Template::getXMLElement() const
     82    const TiXmlElement& Template::getXMLElement() const
    8283    {
    8384        if (this->bIsLink_)
     
    8990                {
    9091                    this->bIsReturningXMLElement_ = true;
    91                     const Element& element = temp->getXMLElement();
     92                    const TiXmlElement& element = temp->getXMLElement();
    9293                    this->bIsReturningXMLElement_ = false;
    9394                    return element;
     
    127128        COUT(4) << object->getLoaderIndentation() << " aplying Template \"" << this->getName() << "\"..." << std::endl;
    128129
    129         Element temp = this->getXMLElement();
     130        Element temp = ((TiXmlElement*)&this->getXMLElement());
    130131        object->XMLPort(temp, XMLPort::LoadObject);
    131132    }
  • code/branches/objecthierarchy/src/core/Template.h

    r1989 r1993  
    3535
    3636#include "BaseObject.h"
    37 #include "tinyxml/ticpp.h"
     37#include "tinyxml/tinyxml.h"
    3838
    3939namespace orxonox
     
    5353                { return this->link_; }
    5454
    55             inline void setXMLElement(const Element& xmlelement)
     55            inline void setXMLElement(const TiXmlElement& xmlelement)
    5656                { this->xmlelement_ = xmlelement; }
    57             const Element& getXMLElement() const;
     57            const TiXmlElement& getXMLElement() const;
    5858
    5959            void setBaseclass(const std::string& baseclass);
     
    7070
    7171        private:
    72             Element xmlelement_;
     72            TiXmlElement xmlelement_;
    7373            std::string link_;
    7474            std::string baseclass_;
Note: See TracChangeset for help on using the changeset viewer.