- Timestamp:
- Jun 10, 2005, 11:22:00 PM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/defs/class_list.h
r4594 r4595 19 19 \brief list of orxonox classes 20 20 21 this File is used to identify an Object with its class and also with its sub classes.21 this File is used to identify an Object with its class and also with its sub/super-classes. 22 22 this is also used by the ObjectManager to identify and load important classes 23 23 */ … … 34 34 * inheritance is done in the following way: Classes are identified by 35 35 * a HEX-number eg: 0x12345678 36 * The number has 8 x16entries.36 * The number has 8^4 entries. 37 37 * The first two: 1,2 superclass identifiers to 38 38 * The second three are for subclasses with inheritance … … 69 69 // lowest level classes 70 70 CL_MASK_LOWLEVEL_CLASS = 0x00000fff, 71 71 72 // singleton classes (range from 0x00000001 to 0x000000ff) 72 73 CL_MASK_SINGLETON = 0x0000003f, … … 74 75 CL_NULL_PARENT = 0x00000002, 75 76 CL_PILOT_PARENT = 0x00000003, 76 77 77 CL_OBJECT_MANAGER = 0x00000004, 78 78 CL_RESOURCE_MANAGER = 0x00000005, … … 95 95 96 96 97 // story entities (range from 0x00000101 to 0x000001ff)97 // StoryEntities (range from 0x00000101 to 0x000001ff) 98 98 CL_CAMPAIGN = 0x00000101, 99 99 CL_WORLD = 0x00000102, 100 100 101 // world entities (range from 0x00000201 to 0x000005ff)101 // WorldEntities (range from 0x00000201 to 0x000005ff) 102 102 CL_CAMERA = 0x00000201, 103 103 CL_CAMERA_TARGET = 0x00000202, … … 112 112 CL_TEST_GUN = 0x0000020a, 113 113 114 CL_CHARACTER_ATTRIBUTES,115 114 115 CL_EVENT = 0x00000a08, 116 CL_KEY_MAPPER = 0x00000a09, 116 117 117 CL_ANIMATION, 118 CL_ANIMATION3D, 118 // graphical stuff (range from 0x00000800 to 0x000009ff) 119 CL_TEXT = 0x00000801, 120 CL_MATERIAL = 0x00000802, 121 CL_MODEL = 0x00000803, //!< \todo make this a SUBCLASS maybe 122 CL_OBJMODEL = 0x00000804, 123 CL_PROMITIVE_MODEL = 0x00000805, 124 CL_MD2Model = 0x00000806, 125 CL_LIGHT = 0x00000807, 126 CL_PARTICLE_EMITTER = 0x00000808, 127 CL_PARTICLE_SYSTEM = 0x00000809, 128 // GL-menu 129 CL_GLMENU_IMAGE_SCREEN = 0x00000901, 119 130 120 CL_ARRAY, 121 CL_CURVE, 122 CL_VECTOR, 123 CL_FACTORY, 124 CL_INI_PARSER, 125 CL_LIST, 126 CL_SUBSTRING, 127 CL_LOAD_PARAM, 128 129 130 CL_EVENT, 131 CL_KEY_MAPPER, 132 133 CL_TEXT, 134 CL_GLMENU_IMAGE_SCREEN, 135 CL_LIGHT, 136 CL_MATERIAL, 137 CL_MD2Model, 138 CL_MODEL, 139 CL_OBJMODEL, 140 CL_PROMITIVE_MODEL, 141 142 CL_PARTICLE_EMITTER, 143 CL_PARTICLE_SYSTEM, 144 131 // Collision 145 132 CL_COLLISION, 146 133 CL_BV_TREE, … … 152 139 CL_BOUNDING_SPHERE, 153 140 141 // misc: (range from 0x00000a00 to 0x00000bff) 142 CL_ANIMATION = 0x00000a01, 143 // CL_ANIMATION3D = 0x00000a02, 144 CL_FACTORY = 0x00000a02, 145 CL_INI_PARSER = 0x00000a03, 146 CL_LIST = 0x00000a04, 147 CL_SUBSTRING = 0x00000a05, 148 CL_LOAD_PARAM = 0x00000a06, 149 CL_CURVE = 0x00000a07, 150 CL_VECTOR = 0x00000a08, 151 CL_CHARACTER_ATTRIBUTES = 0x00000a09, 154 152 CL_NUMBER 155 153 }; -
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.