Changeset 2155 for code/branches/objecthierarchy/src/core
- Timestamp:
- Nov 8, 2008, 5:13:18 PM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/core/BaseObject.cc
r2074 r2155 41 41 #include "Template.h" 42 42 #include "util/String.h" 43 #include "util/mbool.h" 43 44 44 45 namespace orxonox -
code/branches/objecthierarchy/src/core/BaseObject.h
r2144 r2155 45 45 #include "XMLIncludes.h" 46 46 #include "Event.h" 47 #include "util/mbool.h" 47 48 48 49 namespace orxonox … … 73 74 /** @brief Sets the state of the objects activity. @param bActive True = active */ 74 75 inline void setActive(bool bActive) 75 { 76 bool bTemp = this->bActive_;77 this->bActive_ = bActive;78 if ( bTemp != bActive )76 { 77 if (this->bActive_ != bActive) 78 { 79 this->bActive_ = bActive; 79 80 this->changedActivity(); 81 } 80 82 } 81 83 /** @brief Returns the state of the objects activity. @return The state of the activity */ 82 inline boolisActive() const { return this->bActive_; }84 inline const mbool& isActive() const { return this->bActive_; } 83 85 /** @brief This function gets called if the activity of the object changes. */ 84 86 virtual void changedActivity() {} 85 87 86 88 /** @brief Sets the state of the objects visibility. @param bVisible True = visible */ 87 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 } 88 97 /** @brief Returns the state of the objects visibility. @return The state of the visibility */ 89 inline boolisVisible() const { return this->bVisible_; }98 inline const mbool& isVisible() const { return this->bVisible_; } 90 99 /** @brief This function gets called if the visibility of the object changes. */ 91 100 virtual void changedVisibility() {} … … 144 153 std::string name_; //!< The name of the object 145 154 std::string oldName_; //!< The old name of the object 146 bool bActive_;//!< True = the object is active147 bool bVisible_;//!< True = the object is visible155 mbool bActive_; //!< True = the object is active 156 mbool bVisible_; //!< True = the object is visible 148 157 149 158 private:
Note: See TracChangeset
for help on using the changeset viewer.