Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 31, 2006, 10:51:08 PM (18 years ago)
Author:
bensch
Message:

orxonox/branches/new_class_id: new_class ID working, adapdet many classes, and reinvented some of the ClassID stuff

Location:
branches/new_class_id/src/world_entities/projectiles
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/world_entities/projectiles/bomb.cc

    r8362 r9709  
    2525#include "debug.h"
    2626
    27 CREATE_FAST_FACTORY_STATIC(Bomb, CL_BOMB);
     27#include "class_id.h"
     28NewObjectListDefinitionID(Bomb, CL_BOMB);
     29CREATE_FAST_FACTORY_STATIC(Bomb);
    2830
    2931/**
     
    6769void Bomb::init()
    6870{
    69   this->setClassID(CL_BOMB, "Bomb");
     71  this->registerObject(this, Bomb::_objectList);
    7072
    7173
     
    173175}
    174176
     177
    175178void Bomb::deactivate()
    176179{
     
    182185void Bomb::detonate(float size)
    183186{
    184   ObjectManager::EntityList detonationList;
    185   ObjectManager::distanceFromObject(detonationList, *this, size, CL_NPC);
     187  /// FIXME
     188/*  ObjectManager::EntityList detonationList;
     189  ObjectManager::distanceFromObject(detonationList, *this, size, NPC::objectList());
    186190    while( !detonationList.empty() )
    187191    {
    188192      detonationList.front()->collidesWith(this, Vector(0,0,0));
    189193      detonationList.pop_front();
    190     }
     194    }*/
    191195}
  • branches/new_class_id/src/world_entities/projectiles/bomb.h

    r6622 r9709  
    1717class Bomb : public Projectile
    1818{
    19 
     19  NewObjectListDeclaration(Bomb);
    2020 public:
    2121  Bomb(const TiXmlElement* root = NULL);
  • branches/new_class_id/src/world_entities/projectiles/boomerang_projectile.cc

    r9235 r9709  
    2020
    2121#include "state.h"
    22 #include "class_list.h"
    2322
    2423#include "dot_emitter.h"
     
    2726#include "debug.h"
    2827
    29 CREATE_FAST_FACTORY_STATIC(BoomerangProjectile, CL_BOOMERANG_PROJECTILE);
     28#include "class_id.h"
     29NewObjectListDefinitionID(BoomerangProjectile, CL_BOOMERANG_PROJECTILE);
     30CREATE_FAST_FACTORY_STATIC(BoomerangProjectile);
    3031
    3132/**
     
    3435BoomerangProjectile::BoomerangProjectile () : Projectile()
    3536{
    36   this->setClassID(CL_BOOMERANG_PROJECTILE, "BoomerangProjectile");
     37  this->registerObject(this, BoomerangProjectile::_objectList);
    3738
    3839  this->loadModel("models/projectiles/orx-rocket.obj", 2.0);
     
    6061
    6162  /* this is normaly done by World.cc by deleting the ParticleEngine */
    62   if (BoomerangProjectile::trailParticles != NULL && ClassList::getList(CL_BOOMERANG_PROJECTILE)->size() <= 1)
    63   {
    64     if (ClassList::exists(BoomerangProjectile::trailParticles, CL_PARTICLE_SYSTEM))
     63  if (BoomerangProjectile::trailParticles != NULL && BoomerangProjectile::objectList().size() <= 1)
     64  {
     65    if (ParticleSystem::objectList().exists(BoomerangProjectile::trailParticles))
    6566      delete BoomerangProjectile::trailParticles;
    6667    BoomerangProjectile::trailParticles = NULL;
    6768  }
    68   if (BoomerangProjectile::explosionParticles != NULL && ClassList::getList(CL_BOOMERANG_PROJECTILE)->size() <= 1)
    69   {
    70     if (ClassList::exists(BoomerangProjectile::explosionParticles, CL_PARTICLE_SYSTEM))
     69  if (BoomerangProjectile::explosionParticles != NULL && BoomerangProjectile::objectList().size() <= 1)
     70  {
     71    if (ParticleSystem::objectList().exists(BoomerangProjectile::explosionParticles))
    7172      delete BoomerangProjectile::explosionParticles;
    7273    BoomerangProjectile::explosionParticles = NULL;
  • branches/new_class_id/src/world_entities/projectiles/boomerang_projectile.h

    r9235 r9709  
    1717class BoomerangProjectile : public Projectile
    1818{
     19  NewObjectListDeclaration(BoomerangProjectile);
    1920  public:
    2021    BoomerangProjectile ();
  • branches/new_class_id/src/world_entities/projectiles/guided_missile.cc

    r9298 r9709  
    1919
    2020#include "state.h"
    21 #include "class_list.h"
    2221
    2322#include "dot_emitter.h"
     
    2625#include "debug.h"
    2726
    28 CREATE_FAST_FACTORY_STATIC(GuidedMissile, CL_GUIDED_MISSILE);
     27#include "class_id.h"
     28NewObjectListDefinitionID(GuidedMissile, CL_GUIDED_MISSILE);
     29CREATE_FAST_FACTORY_STATIC(GuidedMissile);
    2930
    3031/**
     
    3334GuidedMissile::GuidedMissile () : Projectile()
    3435{
    35   this->setClassID(CL_GUIDED_MISSILE, "GuidedMissile");
     36  this->registerObject(this, GuidedMissile::_objectList);
    3637
    3738  this->loadModel("models/projectiles/orx-rocket.obj", 2.0);
     
    5960
    6061  /* this is normaly done by World.cc by deleting the ParticleEngine */
    61   if (GuidedMissile::trailParticles != NULL && ClassList::getList(CL_GUIDED_MISSILE)->size() <= 1)
    62   {
    63     if (ClassList::exists(GuidedMissile::trailParticles, CL_PARTICLE_SYSTEM))
     62  if (GuidedMissile::trailParticles != NULL && GuidedMissile::objectList().size() <= 1)
     63  {
     64    if (ParticleSystem::objectList().exists(GuidedMissile::trailParticles))
    6465      delete GuidedMissile::trailParticles;
    6566    GuidedMissile::trailParticles = NULL;
    6667  }
    67   if (GuidedMissile::explosionParticles != NULL && ClassList::getList(CL_GUIDED_MISSILE)->size() <= 1)
    68   {
    69     if (ClassList::exists(GuidedMissile::explosionParticles, CL_PARTICLE_SYSTEM))
     68  if (GuidedMissile::explosionParticles != NULL && GuidedMissile::objectList().size() <= 1)
     69  {
     70    if (ParticleSystem::objectList().exists(GuidedMissile::explosionParticles))
    7071      delete GuidedMissile::explosionParticles;
    7172    GuidedMissile::explosionParticles = NULL;
  • branches/new_class_id/src/world_entities/projectiles/guided_missile.h

    r9656 r9709  
    1616class GuidedMissile : public Projectile
    1717{
     18  NewObjectListDeclaration(GuidedMissile);
    1819  public:
    1920    GuidedMissile ();
  • branches/new_class_id/src/world_entities/projectiles/hyperblast.cc

    r9235 r9709  
    1919
    2020#include "state.h"
    21 #include "class_list.h"
    2221
    2322#include "box_emitter.h"
     
    2625#include "debug.h"
    2726
    28 CREATE_FAST_FACTORY_STATIC(Hyperblast, CL_HYPERBLAST);
     27#include "class_id.h"
     28NewObjectListDefinitionID(Hyperblast, CL_HYPERBLAST);
     29CREATE_FAST_FACTORY_STATIC(Hyperblast);
     30
    2931
    3032/**
     
    3335Hyperblast::Hyperblast () : Projectile()
    3436{
    35   this->setClassID(CL_HYPERBLAST, "Hyperblast");
     37  this->registerObject(this, Hyperblast::_objectList);
    3638
    3739  this->loadModel("models/projectiles/hyperblast.obj", 5);
     
    5557{
    5658  /* this is normaly done by World.cc by deleting the ParticleEngine */
    57   if (Hyperblast::explosionParticles != NULL && ClassList::getList(CL_HYPERBLAST)->size() <= 1)
     59  if (Hyperblast::explosionParticles != NULL && Hyperblast::objectList().size() <= 1)
    5860  {
    5961    Hyperblast::explosionParticles = NULL;
  • branches/new_class_id/src/world_entities/projectiles/hyperblast.h

    r9235 r9709  
    1717class Hyperblast : public Projectile
    1818{
     19  NewObjectListDeclaration(Hyperblast);
    1920  public:
    2021    Hyperblast ();
  • branches/new_class_id/src/world_entities/projectiles/laser.cc

    r9656 r9709  
    1919
    2020#include "state.h"
    21 #include "class_list.h"
    2221#include "model.h"
    2322
     
    2928
    3029
    31 
    32 CREATE_FAST_FACTORY_STATIC(Laser, CL_LASER);
     30#include "class_id.h"
     31NewObjectListDefinition(Laser);
     32CREATE_FAST_FACTORY_STATIC(Laser);
    3333
    3434/**
     
    3737Laser::Laser () : Projectile()
    3838{
    39   this->setClassID(CL_LASER, "Laser");
     39  this->registerObject(this, Laser::_objectList);
    4040
    4141  this->loadModel("models/projectiles/laser.obj");
     
    6161
    6262  /* this is normaly done by World.cc by deleting the ParticleEngine */
    63   if (Laser::explosionParticles != NULL && ClassList::getList(CL_LASER)->size() <= 1)
     63  if (Laser::explosionParticles != NULL && Laser::objectList().size() <= 1)
    6464  {
    6565    //if (ClassList::exists(Laser::explosionParticles, CL_PARTICLE_SYSTEM))
  • branches/new_class_id/src/world_entities/projectiles/laser.h

    r9235 r9709  
    1717class Laser : public Projectile
    1818{
     19  NewObjectListDeclaration(Laser);
    1920  public:
    2021    Laser ();
  • branches/new_class_id/src/world_entities/projectiles/projectile.h

    r9705 r9709  
    1111
    1212#include "world_entity.h"
    13 #include "fast_factory.h"
     13#include "loading/fast_factory.h"
    1414
    1515#include "sound_source.h"
  • branches/new_class_id/src/world_entities/projectiles/rail_projectile.cc

    r9406 r9709  
    1919
    2020#include "state.h"
    21 #include "class_list.h"
    2221#include "model.h"
    2322
     
    2928
    3029
    31 
    32 CREATE_FAST_FACTORY_STATIC(RailProjectile, CL_RAIL_PROJECTILE);
     30#include "class_id.h"
     31NewObjectListDefinitionID(RailProjectile, CL_RAIL_PROJECTILE);
     32CREATE_FAST_FACTORY_STATIC(RailProjectile);
    3333
    3434/**
     
    3737RailProjectile::RailProjectile () : Projectile()
    3838{
    39   this->setClassID(CL_RAIL_PROJECTILE, "RailProjectile");
     39  this->registerObject(this, RailProjectile::_objectList);
    4040
    4141  this->loadModel("models/projectiles/laser_projectile.obj", 100);
     
    6161
    6262  /* this is normaly done by World.cc by deleting the ParticleEngine */
    63   if (RailProjectile::explosionParticles != NULL && ClassList::getList(CL_RAIL_PROJECTILE)->size() <= 1)
     63  if (RailProjectile::explosionParticles != NULL && RailProjectile::objectList().size() <= 1)
    6464  {
    6565    //if (ClassList::exists(RailProjectile::explosionParticles, CL_PARTICLE_SYSTEM))
  • branches/new_class_id/src/world_entities/projectiles/rail_projectile.h

    r9235 r9709  
    1717class RailProjectile : public Projectile
    1818{
     19  NewObjectListDeclaration(RailProjectile);
    1920  public:
    2021    RailProjectile ();
  • branches/new_class_id/src/world_entities/projectiles/rocket.cc

    r9235 r9709  
    1919
    2020#include "state.h"
    21 #include "class_list.h"
    2221
    2322#include "dot_emitter.h"
     
    2625#include "debug.h"
    2726
    28 CREATE_FAST_FACTORY_STATIC(Rocket, CL_ROCKET);
     27#include "class_id.h"
     28NewObjectListDefinitionID(Rocket, CL_ROCKET);
     29CREATE_FAST_FACTORY_STATIC(Rocket);
    2930
    3031/**
     
    3334Rocket::Rocket () : Projectile()
    3435{
    35   this->setClassID(CL_ROCKET, "Rocket");
     36  this->registerObject(this, Rocket::_objectList);
    3637
    3738  this->loadModel("models/projectiles/orx-rocket.obj", .3);
     
    5556
    5657  /* this is normaly done by World.cc by deleting the ParticleEngine */
    57   if (Rocket::trailParticles != NULL && ClassList::getList(CL_ROCKET)->size() <= 1)
     58  if (Rocket::trailParticles != NULL && Rocket::objectList().size() <= 1)
    5859  {
    5960/*    if (ClassList::exists(Rocket::trailParticles, CL_PARTICLE_SYSTEM))
     
    6162    Rocket::trailParticles = NULL;
    6263  }
    63   if (Rocket::explosionParticles != NULL && ClassList::getList(CL_ROCKET)->size() <= 1)
     64  if (Rocket::explosionParticles != NULL && Rocket::objectList().size() <= 1)
    6465  {
    6566/*    if (ClassList::exists(Rocket::explosionParticles, CL_PARTICLE_SYSTEM))
  • branches/new_class_id/src/world_entities/projectiles/rocket.h

    r9235 r9709  
    99#include "projectile.h"
    1010
    11 class Vector;
    12 class Weapon;
    1311class SpriteParticles;
    1412class ParticleEmitter;
     
    1715class Rocket : public Projectile
    1816{
    19   public:
    20     Rocket ();
    21     virtual ~Rocket ();
     17  NewObjectListDeclaration(Rocket);
     18
     19public:
     20  Rocket ();
     21  virtual ~Rocket ();
    2222
    2323
    24     virtual void activate();
    25     virtual void deactivate();
     24  virtual void activate();
     25  virtual void deactivate();
    2626
    27     virtual void collidesWith(WorldEntity* entity, const Vector& location);
     27  virtual void collidesWith(WorldEntity* entity, const Vector& location);
    2828
    29     virtual void destroy (WorldEntity* killer);
     29  virtual void destroy (WorldEntity* killer);
    3030
    31     virtual void tick (float time);
    32     virtual void draw () const;
     31  virtual void tick (float time);
     32  virtual void draw () const;
    3333
    3434
    35   private:
    36     static FastFactory*               fastFactory;
    37     static SpriteParticles*           trailParticles;
    38     static SpriteParticles*           explosionParticles;
     35private:
     36  static FastFactory*               fastFactory;
     37  static SpriteParticles*           trailParticles;
     38  static SpriteParticles*           explosionParticles;
    3939
    40     ParticleEmitter*                  emitter;
     40  ParticleEmitter*                  emitter;
    4141
    4242
    43     WorldEntity* hitEntity; // FIXME TEMPORARY
     43  WorldEntity* hitEntity; // FIXME TEMPORARY
    4444
    4545};
  • branches/new_class_id/src/world_entities/projectiles/test_bullet.cc

    r9235 r9709  
    1919
    2020#include "state.h"
    21 #include "class_list.h"
    2221
    2322#include "dot_emitter.h"
     
    2524#include "debug.h"
    2625
    27 CREATE_FAST_FACTORY_STATIC(TestBullet, CL_TEST_BULLET);
     26#include "class_id.h"
     27NewObjectListDefinitionID(TestBullet, CL_TEST_BULLET);
     28CREATE_FAST_FACTORY_STATIC(TestBullet);
    2829
    2930/**
     
    3233TestBullet::TestBullet () : Projectile()
    3334{
    34   this->setClassID(CL_TEST_BULLET, "TestBullet");
     35  this->registerObject(this, TestBullet::_objectList);
    3536
    3637  this->loadModel("models/projectiles/orx-rocket.obj", .3);
     
    5455
    5556  /* this is normaly done by World.cc by deleting the ParticleEngine */
    56   if (TestBullet::trailParticles != NULL && ClassList::getList(CL_TEST_BULLET)->size() <= 1)
     57  if (TestBullet::trailParticles != NULL && TestBullet::objectList().size() <= 1)
    5758  {
    58     if (ClassList::exists(TestBullet::trailParticles, CL_PARTICLE_SYSTEM))
     59    if (ParticleSystem::objectList().exists(TestBullet::trailParticles))
    5960      delete TestBullet::trailParticles;
    6061    TestBullet::trailParticles = NULL;
    6162  }
    62   if (TestBullet::explosionParticles != NULL && ClassList::getList(CL_TEST_BULLET)->size() <= 1)
     63  if (TestBullet::explosionParticles != NULL && TestBullet::objectList().size() <= 1)
    6364  {
    64     if (ClassList::exists(TestBullet::explosionParticles, CL_PARTICLE_SYSTEM))
     65    if (ParticleSystem::objectList().exists(TestBullet::explosionParticles))
    6566      delete TestBullet::explosionParticles;
    6667    TestBullet::explosionParticles = NULL;
  • branches/new_class_id/src/world_entities/projectiles/test_bullet.h

    r9235 r9709  
    1717class TestBullet : public Projectile
    1818{
     19  NewObjectListDeclaration(TestBullet);
     20
    1921  public:
    2022    TestBullet ();
Note: See TracChangeset for help on using the changeset viewer.