Changeset 2171 for code/trunk/src/core/BaseObject.h
- Timestamp:
- Nov 10, 2008, 12:05:03 AM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/objecthierarchy merged: 2111-2115,2123,2132-2134,2143-2144,2153-2158,2160-2169
- Property svn:mergeinfo changed
-
code/trunk/src/core/BaseObject.h
r2087 r2171 28 28 29 29 /** 30 @file BaseObject.h30 @file 31 31 @brief Definition of the BaseObject class. 32 32 … … 45 45 #include "XMLIncludes.h" 46 46 #include "Event.h" 47 #include "util/mbool.h" 47 48 48 49 namespace orxonox … … 72 73 73 74 /** @brief Sets the state of the objects activity. @param bActive True = active */ 74 inline void setActive(bool bActive) { this->bActive_ = bActive; this->changedActivity(); } 75 inline void setActive(bool bActive) 76 { 77 if (this->bActive_ != bActive) 78 { 79 this->bActive_ = bActive; 80 this->changedActivity(); 81 } 82 } 75 83 /** @brief Returns the state of the objects activity. @return The state of the activity */ 76 inline boolisActive() const { return this->bActive_; }84 inline const mbool& isActive() const { return this->bActive_; } 77 85 /** @brief This function gets called if the activity of the object changes. */ 78 86 virtual void changedActivity() {} 79 87 80 88 /** @brief Sets the state of the objects visibility. @param bVisible True = visible */ 81 inline void setVisible(bool bVisible) { this->bVisible_ = bVisible; this->changedVisibility(); } 89 inline void setVisible(bool bVisible) 90 { 91 if (this->bVisible_ != bVisible) 92 { 93 this->bVisible_ = bVisible; 94 this->changedVisibility(); 95 } 96 } 82 97 /** @brief Returns the state of the objects visibility. @return The state of the visibility */ 83 inline boolisVisible() const { return this->bVisible_; }98 inline const mbool& isVisible() const { return this->bVisible_; } 84 99 /** @brief This function gets called if the visibility of the object changes. */ 85 100 virtual void changedVisibility() {} … … 138 153 std::string name_; //!< The name of the object 139 154 std::string oldName_; //!< The old name of the object 140 bool bActive_;//!< True = the object is active141 bool bVisible_;//!< True = the object is visible155 mbool bActive_; //!< True = the object is active 156 mbool bVisible_; //!< True = the object is visible 142 157 143 158 private:
Note: See TracChangeset
for help on using the changeset viewer.