Changeset 871 for code/trunk/src/orxonox/core/BaseObject.h
- Timestamp:
- Mar 9, 2008, 4:44:36 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/core/BaseObject.h
r790 r871 1 /*! 1 /* 2 * ORXONOX - the hottest 3D action shooter ever to exist 3 * 4 * 5 * License notice: 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * Author: 22 * Fabian 'x3n' Landau 23 * Co-authors: 24 * ... 25 * 26 */ 27 28 /** 2 29 @file BaseObject.h 3 30 @brief Definition of the BaseObject class. … … 10 37 11 38 #include "CorePrereqs.h" 12 #include "util/ tinyxml/TinyXMLPrereqs.h"39 #include "util/XMLIncludes.h" 13 40 14 #include " CoreIncludes.h"41 #include "OrxonoxClass.h" 15 42 16 43 namespace orxonox … … 23 50 virtual ~BaseObject(); 24 51 virtual void loadParams(TiXmlElement* xmlElem); 52 virtual void XMLPort(Element& xmlelement, bool loading); 53 54 /** @brief Sets the name of the object. @param name The name */ 55 inline void setName(const std::string& name) { this->name_ = name; this->changedName(); } 56 /** @brief Returns the name of the object. @return The name */ 57 inline const std::string& getName() const { return this->name_; } 58 /** @brief This function gets called if the name of the object changes. */ 59 virtual void changedName() {} 60 61 /** @brief Sets the state of the objects activity. @param bActive True = active */ 62 inline void setActivity(bool bActive) { this->bActive_ = bActive; this->changedActivity(); } 63 /** @brief Returns the state of the objects activity. @return The state of the activity */ 64 inline const bool isActive() const { return this->bActive_; } 65 /** @brief This function gets called if the activity of the object changes. */ 66 virtual void changedActivity() {} 67 68 /** @brief Sets the state of the objects visibility. @param bVisible True = visible */ 69 inline void setVisibility(bool bVisible) { this->bVisible_ = bVisible; this->changedVisibility(); } 70 /** @brief Returns the state of the objects visibility. @return The state of the visibility */ 71 inline const bool isVisible() const { return this->bVisible_; } 72 /** @brief This function gets called if the visibility of the object changes. */ 73 virtual void changedVisibility() {} 74 75 /** @brief Sets a pointer to the level that loaded this object. @param level The pointer to the level */ 76 inline void setLevel(const Level* level) { this->level_ = level; } 77 /** @brief Returns a pointer to the level that loaded this object. @return The level */ 78 inline const Level* getLevel() const { return this->level_; } 79 const std::string& getLevelfile() const; 80 81 /** @brief Sets the indentation of the debug output in the Loader. @param indentation The indentation */ 82 inline void setLoaderIndentation(const std::string& indentation) { this->loaderIndentation_ = indentation; } 83 /** @brief Returns the indentation of the debug output in the Loader. @return The indentation */ 84 inline const std::string& getLoaderIndentation() const { return this->loaderIndentation_; } 85 86 private: 87 std::string name_; //!< The name of the object 88 bool bActive_; //!< True = the object is active 89 bool bVisible_; //!< True = the object is visible 90 const Level* level_; //!< The level that loaded this object 91 std::string loaderIndentation_; //!< Indentation of the debug output in the Loader 25 92 }; 26 ExportClass(BaseObject, Core);27 93 } 28 94
Note: See TracChangeset
for help on using the changeset viewer.