Changeset 2155 for code/branches/objecthierarchy/src
- Timestamp:
- Nov 8, 2008, 5:13:18 PM (16 years ago)
- Location:
- code/branches/objecthierarchy/src
- Files:
-
- 1 added
- 4 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: -
code/branches/objecthierarchy/src/orxonox/objects/worldentities/pawns/Spectator.cc
r2112 r2155 203 203 { 204 204 if (this->getGametype()->isStartCountdownRunning()) 205 this->hudmode_ = 2 + 10* ceil(this->getGametype()->getStartCountdown());205 this->hudmode_ = 2 + 10*(int)ceil(this->getGametype()->getStartCountdown()); 206 206 else 207 207 this->hudmode_ = 3; -
code/branches/objecthierarchy/src/util/Math.h
r2114 r2155 39 39 #include <ostream> 40 40 #include <string> 41 #include <cmath> 41 42 #include <boost/static_assert.hpp> 42 43 … … 145 146 { 146 147 return x*x*x; 147 }148 149 /**150 @brief Rounds the value down.151 */152 template <typename T>153 inline int floor(T x)154 {155 return (int)(x);156 }157 158 /**159 @brief Rounds the value up.160 */161 template <typename T>162 inline int ceil(T x)163 {164 int temp = floor(x);165 return (temp != x) ? (temp + 1) : temp;166 148 } 167 149
Note: See TracChangeset
for help on using the changeset viewer.