Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4595 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jun 10, 2005, 11:22:00 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: better output

Location:
orxonox/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/defs/class_list.h

    r4594 r4595  
    1919    \brief list of orxonox classes
    2020
    21     this File is used to identify an Object with its class and also with its subclasses.
     21    this File is used to identify an Object with its class and also with its sub/super-classes.
    2222    this is also used by the ObjectManager to identify and load important classes
    2323*/
     
    3434 * inheritance is done in the following way: Classes are identified by
    3535 * a HEX-number eg: 0x12345678
    36  * The number has 8x16 entries.
     36 * The number has 8^4 entries.
    3737 * The first two: 1,2 superclass identifiers to
    3838 * The second three are for subclasses with inheritance
     
    6969  // lowest level classes
    7070  CL_MASK_LOWLEVEL_CLASS  =    0x00000fff,
     71
    7172  // singleton classes (range from 0x00000001 to 0x000000ff)
    7273  CL_MASK_SINGLETON       =    0x0000003f,
     
    7475  CL_NULL_PARENT          =    0x00000002,
    7576  CL_PILOT_PARENT         =    0x00000003,
    76 
    7777  CL_OBJECT_MANAGER       =    0x00000004,
    7878  CL_RESOURCE_MANAGER     =    0x00000005,
     
    9595
    9696
    97   // story entities (range from 0x00000101 to 0x000001ff)
     97  // StoryEntities (range from 0x00000101 to 0x000001ff)
    9898  CL_CAMPAIGN             =    0x00000101,
    9999  CL_WORLD                =    0x00000102,
    100100
    101   // world entities (range from 0x00000201 to 0x000005ff)
     101  // WorldEntities (range from 0x00000201 to 0x000005ff)
    102102  CL_CAMERA               =    0x00000201,
    103103  CL_CAMERA_TARGET        =    0x00000202,
     
    112112  CL_TEST_GUN             =    0x0000020a,
    113113
    114   CL_CHARACTER_ATTRIBUTES,
    115114
     115  CL_EVENT                =    0x00000a08,
     116  CL_KEY_MAPPER           =    0x00000a09,
    116117
    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,
    119130
    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
    145132  CL_COLLISION,
    146133  CL_BV_TREE,
     
    152139  CL_BOUNDING_SPHERE,
    153140
     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,
    154152  CL_NUMBER
    155153};
  • orxonox/trunk/src/lib/lang/base_object.cc

    r4594 r4595  
    1919#include "base_object.h"
    2020#include "load_param.h"
     21#include "compiler.h"
    2122
    2223using namespace std;
     
    113114   \returns true if it is, false otherwise
    114115*/
    115 bool BaseObject::isA (ClassID classID)
     116bool BaseObject::isA (ClassID classID) const
    116117{
    117118  // 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))
    119120  {
    120121    if( this->classID & classID)
     
    135136void BaseObject::whatIs(void) const
    136137{
    137   PRINT(0)("object %s: ", this->getName() );
     138  PRINT(0)("object %s of class %s: ", this->getName(), this->getClassName());
    138139  if (this->classID & CL_MASK_SUPER_CLASS)
    139140  {
    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");
    153155  }
    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  }
    155174}
  • orxonox/trunk/src/lib/lang/base_object.h

    r4592 r4595  
    3737  inline int getClassID(void) const { return this->classID; }
    3838
    39   bool isA (ClassID classID);
     39  bool isA (ClassID classID) const;
    4040  void whatIs(void) const;
    4141
Note: See TracChangeset for help on using the changeset viewer.