Changeset 4592 in orxonox.OLD for orxonox/trunk/src/lib/lang
- Timestamp:
- Jun 10, 2005, 7:17:22 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/lang
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/lang/base_object.cc
r4591 r4592 78 78 void BaseObject::setClassID (long classID) 79 79 { 80 this->classID = classID;80 this->classID |= classID; 81 81 } 82 82 … … 91 91 } 92 92 93 94 /*95 \brief sets the class identifiers96 \param a number for the class from class_list.h enumeration97 \param the class name98 99 bool BaseObject::isA (char* className)100 {101 if( this->className == className)102 return false;103 return true;104 }105 */106 107 93 /** 108 94 \brief set the name of the Object 109 95 */ 110 void BaseObject::setName (const char* objectName)96 void BaseObject::setName (const char* objectName) 111 97 { 112 98 if (this->objectName) 113 99 delete []this->objectName; 114 100 if (objectName) 115 116 117 118 101 { 102 this->objectName = new char[strlen(objectName)+1]; 103 strcpy(this->objectName, objectName); 104 } 119 105 else 120 106 this->objectName = NULL; 121 107 } 108 109 110 /** 111 \brief checks if the class is a classID 112 \param classID the Identifier to check for 113 \returns true if it is, false otherwise 114 */ 115 bool BaseObject::isA (ClassID classID) 116 { 117 if( this->classID & classID) 118 return true; 119 return false; 120 } 121 122 /** 123 * @brief displays everything this class is 124 */ 125 void BaseObject::whatIs(void) const 126 { 127 PRINT(0)("object %s: ", this->getName() ); 128 if (this->classID & CL_MASK_SUPERCLASS) 129 { 130 PRINT(0)("is a derived Class from: \n"); 131 if (this->classID & CL_BASE_OBJECT) 132 PRINT(0)("BaseObject, "); 133 if (this->classID & CL_PARENT_NODE) 134 PRINT(0)("ParentNode, "); 135 if (this->classID & CL_WORLD_ENTITY) 136 PRINT(0)("WorldEntity, "); 137 if (this->classID & CL_PHYSICS_INTERFACE) 138 PRINT(0)("PhysicsInterface, "); 139 if (this->classID & CL_EVENT_LISTENER) 140 PRINT(0)("EventListener, "); 141 if (this->classID & CL_STORY_ENTITY) 142 PRINT(0)("StoryEntity, "); 143 } 144 printf("\n"); 145 } -
orxonox/trunk/src/lib/lang/base_object.h
r4591 r4592 37 37 inline int getClassID(void) const { return this->classID; } 38 38 39 // bool isA (char* className); 39 bool isA (ClassID classID); 40 void whatIs(void) const; 40 41 41 42 /** \returns if the object is finalized */
Note: See TracChangeset
for help on using the changeset viewer.