Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4320 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
May 27, 2005, 1:13:42 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: now string name of a class works parallel to the int id representation and is only used for documentation purposes

Location:
orxonox/trunk/src
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/glmenu/glmenu_imagescreen.cc

    r4318 r4320  
    8888void GLMenuImageScreen::init ()
    8989{
    90   this->setClassID(CL_GLMENU_IMAGE_SCREEN);
     90  this->setClassID(CL_GLMENU_IMAGE_SCREEN, "GLMenuImageScreen");
    9191
    9292  // Select Our VU Meter Background Texture
  • orxonox/trunk/src/lib/coord/helper_parent.cc

    r4318 r4320  
    3030HelperParent::HelperParent ()
    3131{
    32    this->setClassID(CL_HELPER_PARENT);
     32   this->setClassID(CL_HELPER_PARENT, "HelperParent");
    3333}
    3434
  • orxonox/trunk/src/lib/graphics/graphics_engine.cc

    r4318 r4320  
    3434  this->minFPS = 9999;
    3535  this->maxFPS = 0;
    36   this->setClassID(CL_GRAPHICS_ENGINE);
     36  this->setClassID(CL_GRAPHICS_ENGINE, "GraphicsEngine");
    3737
    3838  this->fullscreen = false;
  • orxonox/trunk/src/lib/graphics/light.cc

    r4318 r4320  
    3434Light::Light(int lightNumber)
    3535{
    36   this->setClassID(CL_LIGHT);
     36  this->setClassID(CL_LIGHT, "Light");
    3737  char tmpName[7];
    3838  sprintf(tmpName, "Light%d", lightNumber);
     
    205205LightManager::LightManager ()
    206206{
    207   this->setClassID(CL_LIGHT_MANAGER);
     207  this->setClassID(CL_LIGHT_MANAGER, "LightManager");
    208208
    209209  glEnable (GL_LIGHTING);
  • orxonox/trunk/src/lib/graphics/particles/particle_emitter.cc

    r4318 r4320  
    3030                  float velocity)
    3131{
    32    this->setClassID(CL_PARTICLE_EMITTER);
     32   this->setClassID(CL_PARTICLE_EMITTER, "ParticleEmitter");
    3333   this->direction = direction;
    3434   this->setSpread(angle);
  • orxonox/trunk/src/lib/graphics/particles/particle_engine.cc

    r4318 r4320  
    3030ParticleEngine::ParticleEngine ()
    3131{
    32    this->setClassID(CL_PARTICLE_ENGINE);
     32   this->setClassID(CL_PARTICLE_ENGINE, "ParticleEngine");
    3333
    3434   this->systemList = new tList<ParticleSystem>;
  • orxonox/trunk/src/lib/graphics/particles/particle_system.cc

    r4318 r4320  
    3434ParticleSystem::ParticleSystem (unsigned int maxCount, PARTICLE_TYPE type)
    3535{
    36    this->setClassID(CL_PARTICLE_SYSTEM);
     36   this->setClassID(CL_PARTICLE_SYSTEM, "ParticleSystem");
    3737   this->material = NULL;
    3838   this->name = NULL;
  • orxonox/trunk/src/lib/graphics/text_engine.cc

    r4318 r4320  
    5151Text::Text(Font* font, int type)
    5252{
    53   this->setClassID(CL_TEXT);
     53  this->setClassID(CL_TEXT, "Text");
    5454
    5555  // initialize this Text
     
    802802TextEngine::TextEngine ()
    803803{
    804    this->setClassID(CL_TEXT_ENGINE);
     804   this->setClassID(CL_TEXT_ENGINE, "TextEngine");
    805805   this->enableFonts();
    806806
  • orxonox/trunk/src/lib/lang/base_object.cc

    r4318 r4320  
    4242}
    4343
     44void BaseObject::setClassID(int id, const char* className)
     45{
     46  this->id = id;
     47  this->className = className;
     48}
     49
    4450
    4551void BaseObject::setClassID (int id)
     
    4854}
    4955
     56void BaseObject::setClassName(const char* className)
     57{
     58  this->className = className;
     59}
    5060
    5161
  • orxonox/trunk/src/lib/lang/base_object.h

    r4318 r4320  
    1717  virtual ~BaseObject ();
    1818
    19   //void setClassName (const char* className);
    2019  void setClassID(int id);
     20  void setClassName(const char* className);
     21  void setClassID(int id, const char* className);
    2122
    22   inline const char* getClassName(void) const { return "";};
     23  inline const char* getClassName(void) const { return this->className;};
    2324  inline int getClassID(void) const { return this->id; }
    2425  bool isA (char* className);
  • orxonox/trunk/src/proto/proto_class.cc

    r3955 r4320  
    2727ProtoClass::ProtoClass ()
    2828{
    29    this->setClassName ("ProtoClass");
     29   this->setClassID(CL_PROTO_ID, "ProtoClass");
     30
     31   /* If you make a new class, what is most probably the case when you write this file
     32      don't forget to:
     33       1. Add the new file new_class.cc to the ./src/Makefile.am
     34       2. Add the class identifier to ./src/class_list.h eg. CL_NEW_CLASS
     35
     36      Advanced Topics:
     37      - if you want to let your object be managed via the ObjectManager make sure to read
     38        the object_manager.h header comments. You will use this most certanly only if you
     39        make many objects of your class, like a weapon bullet.
     40   */
    3041}
    3142
  • orxonox/trunk/src/proto/proto_singleton.cc

    r3655 r4320  
    2626ProtoSingleton::ProtoSingleton ()
    2727{
    28    this->setClassName ("ProtoSingleton");
     28   this->setClassName("ProtoSingleton");
     29   this->setClassID(CL_PROTO_ID, "ProtoSingleton");
    2930
     31   /* If you make a new class, what is most probably the case when you write this file
     32      don't forget to:
     33       1. Add the new file new_class.cc to the ./src/Makefile.am
     34       2. Add the class identifier to ./src/class_list.h eg. CL_NEW_CLASS
     35
     36      Advanced Topics:
     37      - if you want to let your object be managed via the ObjectManager make sure to read
     38        the object_manager.h header comments. You will use this most certanly only if you
     39        make many objects of your class, like a weapon bullet.
     40   */
    3041}
    3142
  • orxonox/trunk/src/story_entities/world.cc

    r4318 r4320  
    196196void World::constuctorInit(char* name, int worldID)
    197197{
    198   this->setClassID(CL_WORLD);
     198  this->setClassID(CL_WORLD, "World");
    199199
    200200  //this->worldName = name;
  • orxonox/trunk/src/util/animation/animation_player.cc

    r4318 r4320  
    2828AnimationPlayer::AnimationPlayer ()
    2929{
    30    this->setClassID(CL_ANIMATION_PLAYER);
     30   this->setClassID(CL_ANIMATION_PLAYER, "AnimationPlayer");
    3131
    3232   this->animationList = new tList<Animation>();
  • orxonox/trunk/src/util/garbage_collector.cc

    r4318 r4320  
    3838GarbageCollector::GarbageCollector ()
    3939{
    40    this->setClassID(CL_GARBAGE_COLLECTOR);
     40   this->setClassID(CL_GARBAGE_COLLECTOR, "GarbageCollector");
    4141   this->time = 0;
    4242   this->delay = 1.5f; /* clean up all 5.0 seconds */
  • orxonox/trunk/src/util/object_manager.cc

    r4318 r4320  
    2929ObjectManager::ObjectManager ()
    3030{
    31   this->setClassID(CL_OBJECT_MANAGER);
     31  this->setClassID(CL_OBJECT_MANAGER, "ObjectManager");
    3232 
    3333  this->managedObjectList = new tList<BaseObject>*[CL_NUMBER];
  • orxonox/trunk/src/util/resource_manager.cc

    r4318 r4320  
    3838ResourceManager::ResourceManager ()
    3939{
    40    this->setClassID(CL_RESOURCE_MANAGER);
     40   this->setClassID(CL_RESOURCE_MANAGER, "ResourceManager");
    4141   this->dataDir = NULL;
    4242   this->setDataDir("./");
  • orxonox/trunk/src/util/track/track_manager.cc

    r4318 r4320  
    370370TrackManager::TrackManager(void)
    371371{
    372   this->setClassID(CL_TRACK_MANAGER);
    373  
     372  this->setClassID(CL_TRACK_MANAGER, "TrackManager");
    374373 
    375374  TrackManager::singletonRef = this; // do this because otherwise the TrackNode cannot get The instance of the TrackManager
  • orxonox/trunk/src/util/track/track_node.cc

    r4318 r4320  
    3232TrackNode::TrackNode ()
    3333{
    34   this->setClassID(CL_TRACK_NODE);
     34  this->setClassID(CL_TRACK_NODE, "TrackNode");
    3535  this->setName("TrackNode"); /* absolete but still used... */
    3636
  • orxonox/trunk/src/world_entities/camera.cc

    r4318 r4320  
    3333Camera::Camera(void)
    3434{
    35   this->setClassID(CL_CAMERA);
     35  this->setClassID(CL_CAMERA, "Camera");
    3636  this->target = new CameraTarget();
    3737
     
    190190CameraTarget::CameraTarget()
    191191{
    192   this->setClassID(CL_CAMERA_TARGET);
     192  this->setClassID(CL_CAMERA_TARGET, "CameraTarget");
    193193  this->setMode(PNODE_MOVEMENT);
    194194}
  • orxonox/trunk/src/world_entities/character_attributes.cc

    r4318 r4320  
    2929CharacterAttributes::CharacterAttributes ()
    3030{
    31    this->setClassID(CL_CHARACTER_ATTRIBUTES);
     31   this->setClassID(CL_CHARACTER_ATTRIBUTES, "CharacterAttributes");
    3232}
    3333
  • orxonox/trunk/src/world_entities/satellite.cc

    r4318 r4320  
    3131Satellite::Satellite (Vector axis, float speed)
    3232{
    33   this->setClassID(CL_SATELLITE);
     33  this->setClassID(CL_SATELLITE, "Satellite");
    3434  this->model = (Model*) ResourceManager::getInstance()->load("cube", RP_LEVEL);
    3535  this->speed = speed;
  • orxonox/trunk/src/world_entities/skybox.cc

    r4318 r4320  
    6262void SkyBox::preInit(void)
    6363{
    64   this->setClassID(CL_SKYBOX);
     64  this->setClassID(CL_SKYBOX, "SkyBox");
    6565  this->skyModel = NULL;
    6666  this->material = new Material*[6];
  • orxonox/trunk/src/world_entities/terrain.cc

    r4318 r4320  
    7777void Terrain::init(void)
    7878{
    79   this->setClassID(CL_TERRAIN);
     79  this->setClassID(CL_TERRAIN, "Terrain");
    8080  this->objectList = 0;
    8181}
  • orxonox/trunk/src/world_entities/test_entity.cc

    r4276 r4320  
    2828TestEntity::TestEntity () : WorldEntity()
    2929
     30  this->setClassID(CL_TEST_ENTITY, "TestEntity");
    3031  this->md2Model = new MD2Model();
    3132  this->md2Model->loadModel(ResourceManager::getFullName("models/tris.md2"));
  • orxonox/trunk/src/world_entities/test_gun.cc

    r4311 r4320  
    4545  :  Weapon (parent, coordinate, direction)
    4646{
     47  this->setClassID(CL_TEST_GUN, "TestGun");
    4748  this->model = (Model*)ResourceManager::getInstance()->load("models/test_gun.obj", OBJ, RP_CAMPAIGN);
    4849  this->idleTime = 0.2f;
  • orxonox/trunk/src/world_entities/world_entity.cc

    r4318 r4320  
    3030WorldEntity::WorldEntity(const TiXmlElement* root)
    3131{
    32   this->setClassID(CL_WORLD_ENTITY);
     32  this->setClassID(CL_WORLD_ENTITY, "WorldEntity");
    3333  this->model = NULL;
    3434
Note: See TracChangeset for help on using the changeset viewer.