Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 12, 2007, 10:37:30 PM (16 years ago)
Author:
landauf
Message:

added files from objecthierarchy, changed includes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/core/OrxonoxClass.h

    r480 r496  
    33    @brief Definition of the OrxonoxClass Class.
    44
    5     All objects and interfaces of the game-logic are derived from OrxonoxClass.
    6     It stores the Identifier and the MetaObjectList and has all needed functions to create the class-hierarchy.
     5    All objects and interfaces of the game-logic (not the engine) are derived from OrxonoxClass.
     6    It stores the Identifier and the MetaObjectList and has all needed functions to create and use the class-hierarchy.
    77*/
    88
     
    1515#include "MetaObjectList.h"
    1616
    17 #include "../../tinyxml/tinyxml.h"
    18 
    19 
    2017namespace orxonox
    2118{
    22     //! The class all objects and interfaces of the game-logic are derived from.
     19    //! The class all objects and interfaces of the game-logic (not the engine) are derived from.
    2320    /**
    24         BaseObject and Interaces are derived with 'virtual public OrxonoxClass' from OrxonoxClass.
     21        The BaseObject and Interaces are derived with 'virtual public OrxonoxClass' from OrxonoxClass.
    2522        OrxonoxClass is needed to create the class-hierarchy at startup and to store the Identifier and the MetaObjectList.
    2623    */
     
    3027            OrxonoxClass();
    3128            virtual ~OrxonoxClass();
     29
     30            void setConfigValues() {};
    3231
    3332            /** @returns the Identifier of the object */
     
    4645            inline MetaObjectList& getMetaList() { return this->metaList_; }
    4746
     47
     48            /** @returns true if the objects class is of the given type or a derivative. */
    4849            inline bool isA(const Identifier* identifier)
    4950                { return this->getIdentifier()->isA(identifier); }
     51            /** @returns true if the objects class is exactly of the given type. */
    5052            inline bool isDirectlyA(const Identifier* identifier)
    5153                { return this->getIdentifier()->isDirectlyA(identifier); }
     54            /** @returns true if the objects class is a child of the given type. */
    5255            inline bool isChildOf(const Identifier* identifier)
    5356                { return this->getIdentifier()->isChildOf(identifier); }
     57            /** @returns true if the objects class is a parent of the given type. */
    5458            inline bool isParentOf(const Identifier* identifier)
    5559                { return this->getIdentifier()->isParentOf(identifier); }
    5660
     61
     62            /** @returns true if the objects class is of the given type or a derivative. */
    5763            inline bool isA(const SubclassIdentifier<class B>* identifier)
    5864                { return this->getIdentifier()->isA(identifier->getIdentifier()); }
     65            /** @returns true if the objects class is exactly of the given type. */
    5966            inline bool isDirectlyA(const SubclassIdentifier<class B>* identifier)
    6067                { return this->getIdentifier()->isDirectlyA(identifier->getIdentifier()); }
     68            /** @returns true if the objects class is a child of the given type. */
    6169            inline bool isChildOf(const SubclassIdentifier<class B>* identifier)
    6270                { return this->getIdentifier()->isChildOf(identifier->getIdentifier()); }
     71            /** @returns true if the objects class is a parent of the given type. */
    6372            inline bool isParentOf(const SubclassIdentifier<class B>* identifier)
    6473                { return this->getIdentifier()->isParentOf(identifier->getIdentifier()); }
    6574
     75
     76            /** @returns true if the objects class is of the given type or a derivative. */
    6677            inline bool isA(const SubclassIdentifier<class B> identifier)
    6778                { return this->getIdentifier()->isA(identifier.getIdentifier()); }
     79            /** @returns true if the objects class is exactly of the given type. */
    6880            inline bool isDirectlyA(const SubclassIdentifier<class B> identifier)
    6981                { return this->getIdentifier()->isDirectlyA(identifier.getIdentifier()); }
     82            /** @returns true if the objects class is a child of the given type. */
    7083            inline bool isChildOf(const SubclassIdentifier<class B> identifier)
    7184                { return this->getIdentifier()->isChildOf(identifier.getIdentifier()); }
     85            /** @returns true if the objects class is a parent of the given type. */
    7286            inline bool isParentOf(const SubclassIdentifier<class B> identifier)
    7387                { return this->getIdentifier()->isParentOf(identifier.getIdentifier()); }
    7488
     89
     90            /** @returns true if the objects class is of the given type or a derivative. */
    7591            inline bool isA(const OrxonoxClass* object)
    7692                { return this->getIdentifier()->isA(object->getIdentifier()); }
     93            /** @returns true if the objects class is exactly of the given type. */
    7794            inline bool isDirectlyA(const OrxonoxClass* object)
    7895                { return this->getIdentifier()->isDirectlyA(object->getIdentifier()); }
     96            /** @returns true if the objects class is a child of the given type. */
    7997            inline bool isChildOf(const OrxonoxClass* object)
    8098                { return this->getIdentifier()->isChildOf(object->getIdentifier()); }
     99            /** @returns true if the objects class is a parent of the given type. */
    81100            inline bool isParentOf(const OrxonoxClass* object)
    82101                { return this->getIdentifier()->isParentOf(object->getIdentifier()); }
    83102
    84103
    85             inline void setName(const std::string& name) { this->name_ = name; }
     104            /** @brief Sets the name of the object. @param name The name */
     105            inline virtual void setName(const std::string& name) { this->name_ = name; }
     106
     107            /** @returns the name of the object. */
    86108            inline const std::string& getName() const { return this->name_; }
    87109
    88             inline void setActive(bool bActive) { this->bActive_ = bActive; }
     110            /** @brief Sets the state of the objects activity. @param bActive True = active */
     111            inline virtual void setActive(bool bActive) { this->bActive_ = bActive; }
     112
     113            /** @returns the state of the objects activity. */
    89114            inline const bool isActive() const { return this->bActive_; }
    90115
    91             inline void setVisible(bool bVisible) { this->bVisible_ = bVisible; }
     116            /** @brief Sets the state of the objects visibility. @param bVisible True = visible */
     117            inline virtual void setVisible(bool bVisible) { this->bVisible_ = bVisible; }
     118
     119            /** @returns the state of the objects visibility. */
    92120            inline const bool isVisible() const { return this->bVisible_; }
    93 
    94121
    95122        private:
     
    98125            MetaObjectList metaList_;       //!< MetaObjectList, containing all ObjectLists and ObjectListElements the object is registered in
    99126
    100             std::string name_;
    101             bool bActive_;
    102             bool bVisible_;
     127            std::string name_;              //!< The name of the object
     128            bool bActive_;                  //!< True = the object is active
     129            bool bVisible_;                 //!< True = the object is visible
    103130    };
    104131}
Note: See TracChangeset for help on using the changeset viewer.