Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4594 in orxonox.OLD


Ignore:
Timestamp:
Jun 10, 2005, 7:52:04 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: isA should work now

Location:
orxonox/trunk/src
Files:
2 edited

Legend:

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

    r4592 r4594  
    4646{
    4747  // superclasses
    48   CL_MASK_SUPERCLASS      =    0xff000000,
     48  CL_MASK_SUPER_CLASS     =    0xff000000,
    4949  CL_BASE_OBJECT          =    0x01000000,
    5050
     
    5959
    6060  // subsuper-classes
    61   CL_MASK_SUBCLASS        =    0x00fff000,
     61  CL_MASK_SUBSUPER_CLASS  =    0x00fff000,
    6262  CL_PLAYER               =    0x00001000,
    6363  CL_NPC                  =    0x00002000,
  • orxonox/trunk/src/lib/lang/base_object.cc

    r4592 r4594  
    115115bool BaseObject::isA (ClassID classID)
    116116{
    117   if( this->classID & classID)
    118     return true;
     117  // if classID is a derivable object
     118  if (classID & CL_MASK_SUPER_CLASS || classID & CL_MASK_SUBSUPER_CLASS)
     119  {
     120    if( this->classID & classID)
     121      return true;
     122  }
     123  // if classID is a LOWLEVEL-class
     124  else
     125  {
     126    if ((this->classID & CL_MASK_LOWLEVEL_CLASS) == classID)
     127      return true;
     128  }
    119129  return false;
    120130}
     
    126136{
    127137  PRINT(0)("object %s: ", this->getName() );
    128   if (this->classID & CL_MASK_SUPERCLASS)
     138  if (this->classID & CL_MASK_SUPER_CLASS)
    129139  {
    130140    PRINT(0)("is a derived Class from: \n");
Note: See TracChangeset for help on using the changeset viewer.