Changeset 496 for code/branches/FICN/src/orxonox/core/OrxonoxClass.h
- Timestamp:
- Dec 12, 2007, 10:37:30 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/core/OrxonoxClass.h
r480 r496 3 3 @brief Definition of the OrxonoxClass Class. 4 4 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. 7 7 */ 8 8 … … 15 15 #include "MetaObjectList.h" 16 16 17 #include "../../tinyxml/tinyxml.h"18 19 20 17 namespace orxonox 21 18 { 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. 23 20 /** 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. 25 22 OrxonoxClass is needed to create the class-hierarchy at startup and to store the Identifier and the MetaObjectList. 26 23 */ … … 30 27 OrxonoxClass(); 31 28 virtual ~OrxonoxClass(); 29 30 void setConfigValues() {}; 32 31 33 32 /** @returns the Identifier of the object */ … … 46 45 inline MetaObjectList& getMetaList() { return this->metaList_; } 47 46 47 48 /** @returns true if the objects class is of the given type or a derivative. */ 48 49 inline bool isA(const Identifier* identifier) 49 50 { return this->getIdentifier()->isA(identifier); } 51 /** @returns true if the objects class is exactly of the given type. */ 50 52 inline bool isDirectlyA(const Identifier* identifier) 51 53 { return this->getIdentifier()->isDirectlyA(identifier); } 54 /** @returns true if the objects class is a child of the given type. */ 52 55 inline bool isChildOf(const Identifier* identifier) 53 56 { return this->getIdentifier()->isChildOf(identifier); } 57 /** @returns true if the objects class is a parent of the given type. */ 54 58 inline bool isParentOf(const Identifier* identifier) 55 59 { return this->getIdentifier()->isParentOf(identifier); } 56 60 61 62 /** @returns true if the objects class is of the given type or a derivative. */ 57 63 inline bool isA(const SubclassIdentifier<class B>* identifier) 58 64 { return this->getIdentifier()->isA(identifier->getIdentifier()); } 65 /** @returns true if the objects class is exactly of the given type. */ 59 66 inline bool isDirectlyA(const SubclassIdentifier<class B>* identifier) 60 67 { return this->getIdentifier()->isDirectlyA(identifier->getIdentifier()); } 68 /** @returns true if the objects class is a child of the given type. */ 61 69 inline bool isChildOf(const SubclassIdentifier<class B>* identifier) 62 70 { return this->getIdentifier()->isChildOf(identifier->getIdentifier()); } 71 /** @returns true if the objects class is a parent of the given type. */ 63 72 inline bool isParentOf(const SubclassIdentifier<class B>* identifier) 64 73 { return this->getIdentifier()->isParentOf(identifier->getIdentifier()); } 65 74 75 76 /** @returns true if the objects class is of the given type or a derivative. */ 66 77 inline bool isA(const SubclassIdentifier<class B> identifier) 67 78 { return this->getIdentifier()->isA(identifier.getIdentifier()); } 79 /** @returns true if the objects class is exactly of the given type. */ 68 80 inline bool isDirectlyA(const SubclassIdentifier<class B> identifier) 69 81 { return this->getIdentifier()->isDirectlyA(identifier.getIdentifier()); } 82 /** @returns true if the objects class is a child of the given type. */ 70 83 inline bool isChildOf(const SubclassIdentifier<class B> identifier) 71 84 { return this->getIdentifier()->isChildOf(identifier.getIdentifier()); } 85 /** @returns true if the objects class is a parent of the given type. */ 72 86 inline bool isParentOf(const SubclassIdentifier<class B> identifier) 73 87 { return this->getIdentifier()->isParentOf(identifier.getIdentifier()); } 74 88 89 90 /** @returns true if the objects class is of the given type or a derivative. */ 75 91 inline bool isA(const OrxonoxClass* object) 76 92 { return this->getIdentifier()->isA(object->getIdentifier()); } 93 /** @returns true if the objects class is exactly of the given type. */ 77 94 inline bool isDirectlyA(const OrxonoxClass* object) 78 95 { return this->getIdentifier()->isDirectlyA(object->getIdentifier()); } 96 /** @returns true if the objects class is a child of the given type. */ 79 97 inline bool isChildOf(const OrxonoxClass* object) 80 98 { return this->getIdentifier()->isChildOf(object->getIdentifier()); } 99 /** @returns true if the objects class is a parent of the given type. */ 81 100 inline bool isParentOf(const OrxonoxClass* object) 82 101 { return this->getIdentifier()->isParentOf(object->getIdentifier()); } 83 102 84 103 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. */ 86 108 inline const std::string& getName() const { return this->name_; } 87 109 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. */ 89 114 inline const bool isActive() const { return this->bActive_; } 90 115 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. */ 92 120 inline const bool isVisible() const { return this->bVisible_; } 93 94 121 95 122 private: … … 98 125 MetaObjectList metaList_; //!< MetaObjectList, containing all ObjectLists and ObjectListElements the object is registered in 99 126 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 103 130 }; 104 131 }
Note: See TracChangeset
for help on using the changeset viewer.