Changeset 4595 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Jun 10, 2005, 11:22:00 PM (20 years ago)
- Location:
- orxonox/trunk/src/lib/lang
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/lang/base_object.cc
r4594 r4595 19 19 #include "base_object.h" 20 20 #include "load_param.h" 21 #include "compiler.h" 21 22 22 23 using namespace std; … … 113 114 \returns true if it is, false otherwise 114 115 */ 115 bool BaseObject::isA (ClassID classID) 116 bool BaseObject::isA (ClassID classID) const 116 117 { 117 118 // if classID is a derivable object 118 if ( classID & CL_MASK_SUPER_CLASS || classID & CL_MASK_SUBSUPER_CLASS)119 if (likely(classID & CL_MASK_SUPER_CLASS || classID & CL_MASK_SUBSUPER_CLASS)) 119 120 { 120 121 if( this->classID & classID) … … 135 136 void BaseObject::whatIs(void) const 136 137 { 137 PRINT(0)("object %s : ", this->getName());138 PRINT(0)("object %s of class %s: ", this->getName(), this->getClassName()); 138 139 if (this->classID & CL_MASK_SUPER_CLASS) 139 140 { 140 PRINT(0)("is a derived Class from: \n"); 141 if (this->classID & CL_BASE_OBJECT) 142 PRINT(0)("BaseObject, "); 143 if (this->classID & CL_PARENT_NODE) 144 PRINT(0)("ParentNode, "); 145 if (this->classID & CL_WORLD_ENTITY) 146 PRINT(0)("WorldEntity, "); 147 if (this->classID & CL_PHYSICS_INTERFACE) 148 PRINT(0)("PhysicsInterface, "); 149 if (this->classID & CL_EVENT_LISTENER) 150 PRINT(0)("EventListener, "); 151 if (this->classID & CL_STORY_ENTITY) 152 PRINT(0)("StoryEntity, "); 141 PRINT(0)("is a derived from the following superclasses:"); 142 if (this->isA(CL_BASE_OBJECT)) 143 PRINT(0)(" =BaseObject="); 144 if (this->isA(CL_PARENT_NODE)) 145 PRINT(0)(" =PNode="); 146 if (this->isA(CL_WORLD_ENTITY)) 147 PRINT(0)(" =WorldEntity="); 148 if (this->isA(CL_PHYSICS_INTERFACE)) 149 PRINT(0)(" =PhysicsInterface="); 150 if (this->isA(CL_EVENT_LISTENER)) 151 PRINT(0)(" =EventListener="); 152 if (this->isA(CL_STORY_ENTITY)) 153 PRINT(0)(" =StoryEntity="); 154 PRINT(0)("\n"); 153 155 } 154 printf("\n"); 156 // subsuper-classes 157 if (this->classID & CL_MASK_SUBSUPER_CLASS) 158 { 159 PRINT(0)(" ->further derivations: "); 160 if (this->isA(CL_PLAYER)) 161 PRINT(0)(" -Player-"); 162 if (this->isA(CL_NPC)) 163 PRINT(0)(" -NPC-"); 164 if (this->isA(CL_POWER_UP)) 165 PRINT(0)(" -PowerUp-"); 166 if (this->isA(CL_FIELD)) 167 PRINT(0)(" -Field-"); 168 if (this->isA(CL_PROJECTILE)) 169 PRINT(0)(" -Projectile-"); 170 if (this->isA(CL_WEAPON)) 171 PRINT(0)(" -Weapon-"); 172 PRINT(0)("\n"); 173 } 155 174 } -
orxonox/trunk/src/lib/lang/base_object.h
r4592 r4595 37 37 inline int getClassID(void) const { return this->classID; } 38 38 39 bool isA (ClassID classID) ;39 bool isA (ClassID classID) const; 40 40 void whatIs(void) const; 41 41
Note: See TracChangeset
for help on using the changeset viewer.