Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/core/BaseObject.cc @ 1061

Last change on this file since 1061 was 1056, checked in by landauf, 17 years ago

don't panic, no codechanges!
added a link to www.orxonox.net

File size: 2.4 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Fabian 'x3n' Landau
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30    @file
31    @brief Implementation of the BaseObject class.
32*/
33
34#include "util/tinyxml/tinyxml.h"
35
36#include "core/CoreIncludes.h"
37#include "BaseObject.h"
38#include "XMLPort.h"
39#include "Level.h"
40
41namespace orxonox
42{
43    CreateFactory(BaseObject);
44
45    /**
46        @brief Constructor: Registers the object in the BaseObject-list.
47    */
48    BaseObject::BaseObject()
49    {
50        RegisterRootObject(BaseObject);
51
52        this->bActive_ = true;
53        this->bVisible_ = true;
54        this->level_ = 0;
55        this->namespace_ = 0;
56    }
57
58    /**
59        @brief Destructor
60    */
61    BaseObject::~BaseObject()
62    {
63    }
64
65    /**
66        @brief load general xml paramters
67    */
68    void BaseObject::loadParams(TiXmlElement* xmlElem)
69    {
70        if (xmlElem->Attribute("name"))
71        {
72            this->setName(xmlElem->Attribute("name"));
73        }
74    }
75
76    /**
77        @brief XML loading and saving.
78        @param xmlelement The XML-element
79        @param loading Loading (true) or saving (false)
80        @return The XML-element
81    */
82    void BaseObject::XMLPort(Element& xmlelement, XMLPort::Mode mode)
83    {
84        XMLPortParam(BaseObject, "name", setName, getName, xmlelement, mode);
85    }
86
87    /**
88        @brief Returns the levelfile that loaded this object.
89        @return The levelfile
90    */
91    const std::string& BaseObject::getLevelfile() const
92    {
93        return this->level_->getFile();
94    }
95}
Note: See TracBrowser for help on using the repository browser.