Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 10, 2008, 12:05:03 AM (15 years ago)
Author:
landauf
Message:

merged revisions 2111-2170 from objecthierarchy branch back to trunk.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/core/BaseObject.h

    r2087 r2171  
    2828
    2929/**
    30     @file BaseObject.h
     30    @file
    3131    @brief Definition of the BaseObject class.
    3232
     
    4545#include "XMLIncludes.h"
    4646#include "Event.h"
     47#include "util/mbool.h"
    4748
    4849namespace orxonox
     
    7273
    7374            /** @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            }
    7583            /** @brief Returns the state of the objects activity. @return The state of the activity */
    76             inline bool isActive() const { return this->bActive_; }
     84            inline const mbool& isActive() const { return this->bActive_; }
    7785            /** @brief This function gets called if the activity of the object changes. */
    7886            virtual void changedActivity() {}
    7987
    8088            /** @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            }
    8297            /** @brief Returns the state of the objects visibility. @return The state of the visibility */
    83             inline bool isVisible() const { return this->bVisible_; }
     98            inline const mbool& isVisible() const { return this->bVisible_; }
    8499            /** @brief This function gets called if the visibility of the object changes. */
    85100            virtual void changedVisibility() {}
     
    138153            std::string name_;                          //!< The name of the object
    139154            std::string oldName_;                       //!< The old name of the object
    140             bool bActive_;                              //!< True = the object is active
    141             bool bVisible_;                             //!< True = the object is visible
     155            mbool bActive_;                             //!< True = the object is active
     156            mbool bVisible_;                            //!< True = the object is visible
    142157
    143158        private:
Note: See TracChangeset for help on using the changeset viewer.