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/weapons
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/world_entities/weapons/aim.cc

    r9656 r9709  
    2929
    3030
     31NewObjectListDefinition(Aim);
    3132
    3233/**
     
    5960void Aim::init()
    6061{
    61   this->setClassID(CL_CROSSHAIR, "Aim");
     62  this->registerObject(this, Aim::_objectList);
    6263  this->setName("Aim");
    6364
     
    107108  ObjectManager::EntityList::iterator entity;
    108109  //printf("%d\n", this->targetGroup);
    109   for (entity = State::getObjectManager()->getObjectList(this->targetGroup).begin();
    110        entity != State::getObjectManager()->getObjectList(this->targetGroup).end();
     110  for (entity = State::getObjectManager()->getEntityList(this->targetGroup).begin();
     111       entity != State::getObjectManager()->getEntityList(this->targetGroup).end();
    111112       entity ++)
    112113  {
  • branches/new_class_id/src/world_entities/weapons/aim.h

    r9656 r9709  
    1919template<class T> class tAnimation;
    2020
     21
    2122//! An Aim for zooming in on Targets.
    2223/**
     
    2829class Aim : public PNode, public Element2D
    2930{
     31  NewObjectListDeclaration(Aim);
    3032
    3133public:
  • branches/new_class_id/src/world_entities/weapons/aiming_system.cc

    r9406 r9709  
    3030
    3131
     32NewObjectListDefinition(AimingSystem);
    3233
    3334/**
     
    5556void AimingSystem::init()
    5657{
    57   this->setClassID(CL_AIMING_SYSTEM, "AimingSystem");
     58  this->registerObject(this, AimingSystem::_objectList);
    5859  this->setName("AimingSystem");
    5960
     
    6364  // registering default reactions:
    6465  this->unsubscribeReaction(CREngine::CR_OBJECT_DAMAGE);
    65   this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, CL_WORLD_ENTITY);
     66  this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, WorldEntity::classID());
    6667
    6768  this->range = 1000.0f;
  • branches/new_class_id/src/world_entities/weapons/aiming_system.h

    r9235 r9709  
    2121class AimingSystem : public WorldEntity
    2222{
     23  NewObjectListDeclaration(AimingSystem);
    2324
    2425 public:
  • branches/new_class_id/src/world_entities/weapons/aiming_turret.cc

    r9656 r9709  
    2727#include "util/loading/factory.h"
    2828
    29 CREATE_FACTORY(AimingTurret, CL_AIMING_TURRET);
    30 
     29#include "class_id.h"
     30NewObjectListDefinitionID(AimingTurret, CL_AIMING_TURRET);
     31CREATE_FACTORY(AimingTurret);
    3132
    3233
     
    6465void AimingTurret::init()
    6566{
    66   this->setClassID(CL_AIMING_TURRET, "AimingTurret");
     67  this->registerObject(this, AimingTurret::_objectList);
    6768
    6869  Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
     
    8687
    8788  this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET);
    88   this->setProjectileType(CL_GUIDED_MISSILE);
     89  this->setProjectileTypeC("GuidedMissile");
    8990
    9091
  • branches/new_class_id/src/world_entities/weapons/aiming_turret.h

    r9656 r9709  
    1313class AimingTurret : public Weapon
    1414{
     15  NewObjectListDeclaration(AimingTurret);
     16
    1517public:
    1618  AimingTurret ();
  • branches/new_class_id/src/world_entities/weapons/boomerang_gun.cc

    r9235 r9709  
    2727#include "util/loading/factory.h"
    2828
    29 CREATE_FACTORY(BoomerangGun, CL_BOOMERANG_GUN);
     29#include "class_id.h"
     30NewObjectListDefinitionID(BoomerangGun, CL_BOOMERANG_GUN);
     31CREATE_FACTORY(BoomerangGun);
    3032
    3133
     
    6163void BoomerangGun::init()
    6264{
    63   this->setClassID(CL_BOOMERANG_GUN, "BoomerangGun");
     65  this->registerObject(this, BoomerangGun::_objectList);
    6466
    6567
     
    8587
    8688  this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET);
    87   this->setProjectileType(CL_BOOMERANG_PROJECTILE);
     89  this->setProjectileTypeC("BoomerangProjectile");
    8890
    8991  this->loadModel("models/guns/turret1.obj", 5.0);
  • branches/new_class_id/src/world_entities/weapons/boomerang_gun.h

    r9235 r9709  
    1111class BoomerangGun : public Weapon
    1212  {
     13    NewObjectListDeclaration(BoomerangGun);
    1314  public:
    1415    BoomerangGun ();
  • branches/new_class_id/src/world_entities/weapons/cannon.cc

    r9406 r9709  
    3232#include "animation3d.h"
    3333
    34 #include "fast_factory.h"
    35 
    36 
    37 
    38 
    39 CREATE_FACTORY(Cannon, CL_CANNON);
     34#include "loading/fast_factory.h"
     35
     36
     37
     38#include "class_id.h"
     39NewObjectListDefinitionID(Cannon, CL_CANNON);
     40CREATE_FACTORY(Cannon);
    4041
    4142/**
     
    6970void Cannon::init()
    7071{
    71   this->setClassID(CL_CANNON, "Cannon");
     72  this->registerObject(this, Cannon::_objectList);
    7273
    7374//  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
     
    8889
    8990  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_HEAVY);
    90   this->setProjectileType(CL_BOMB);
     91  this->setProjectileTypeC("Bomb");
    9192  this->prepareProjectiles(5);
    9293
  • branches/new_class_id/src/world_entities/weapons/cannon.h

    r8777 r9709  
    1212class Cannon : public Weapon
    1313  {
     14    NewObjectListDeclaration(Cannon);
    1415  public:
    1516    Cannon ();
  • branches/new_class_id/src/world_entities/weapons/fps_sniper_rifle.cc

    r9406 r9709  
    2929
    3030
    31 #include "fast_factory.h"
     31#include "loading/fast_factory.h"
    3232
    3333#include "fps_sniper_rifle.h"
     
    3939
    4040
    41 CREATE_FACTORY(FPSSniperRifle, CL_FPS_SNIPER_RIFLE);
     41#include "class_id.h"
     42NewObjectListDefinitionID(FPSSniperRifle, CL_FPS_SNIPER_RIFLE);
     43CREATE_FACTORY(FPSSniperRifle);
    4244
    4345/**
     
    7678void FPSSniperRifle::init()
    7779{
    78   this->setClassID(CL_FPS_SNIPER_RIFLE, "FPSSniperRifle");
     80  this->registerObject(this, FPSSniperRifle::_objectList);
    7981
    8082  this->loadModel("models/guns/fps_sniper_rifle.obj", 0.2);
     
    98100
    99101  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    100   this->setProjectileType(CL_LASER);
     102  this->setProjectileTypeC("Laser");
    101103  this->prepareProjectiles(20);
    102104
  • branches/new_class_id/src/world_entities/weapons/fps_sniper_rifle.h

    r9003 r9709  
    3939class FPSSniperRifle : public Weapon
    4040  {
     41    NewObjectListDeclaration(FPSSniperRifle);
     42
    4143  public:
    4244    FPSSniperRifle (int leftRight);
  • branches/new_class_id/src/world_entities/weapons/hyperblaster.cc

    r9406 r9709  
    3131#include "animation3d.h"
    3232
    33 #include "fast_factory.h"
     33#include "loading/fast_factory.h"
    3434
    3535
    3636
    37 
    38 CREATE_FACTORY(Hyperblaster, CL_HYPERBLASTER);
     37#include "class_id.h"
     38NewObjectListDefinitionID(Hyperblaster, CL_HYPERBLASTER);
     39CREATE_FACTORY(Hyperblaster);
    3940
    4041Hyperblaster::Hyperblaster(const TiXmlElement* root)
     
    5657void Hyperblaster::init()
    5758{
    58   this->setClassID(CL_HYPERBLASTER, "Hyperblaster");
     59  this->registerObject(this, Hyperblaster::_objectList);
    5960
    6061//  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
     
    7677
    7778  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_HEAVY);
    78   this->setProjectileType(CL_HYPERBLAST);
     79  this->setProjectileTypeC("Hyperblast");
    7980  this->prepareProjectiles(2);
    8081
  • branches/new_class_id/src/world_entities/weapons/hyperblaster.h

    r8777 r9709  
    1212class Hyperblaster : public Weapon
    1313  {
    14   public:
     14    NewObjectListDeclaration(Hyperblaster);
     15    public:
    1516    Hyperblaster (const TiXmlElement* root = NULL);
    1617    virtual ~Hyperblaster ();
  • branches/new_class_id/src/world_entities/weapons/laser_cannon.cc

    r9656 r9709  
    2929#include "animation3d.h"
    3030
    31 #include "fast_factory.h"
     31#include "loading/fast_factory.h"
    3232
    33 CREATE_FACTORY(LaserCannon, CL_LASER_CANNON);
    34 
     33#include "class_id.h"
     34NewObjectListDefinitionID(LaserCannon, CL_LASER_CANNON);
     35CREATE_FACTORY(LaserCannon);
    3536
    3637LaserCannon::LaserCannon(const TiXmlElement* root)
     
    5253void LaserCannon::init()
    5354{
    54   this->setClassID(CL_LASER_CANNON, "LaserCannon");
     55  this->registerObject(this, LaserCannon::_objectList);
    5556
    5657//  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/laser_cannon.obj", OBJ, RP_CAMPAIGN);
     
    7273
    7374  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    74   this->setProjectileType(CL_RAIL_PROJECTILE);
     75  this->setProjectileTypeC("RailProjectile");
    7576  this->prepareProjectiles(100);
    7677  this->setEmissionPoint(Vector(2.8,0,0) * 5.0);
  • branches/new_class_id/src/world_entities/weapons/laser_cannon.h

    r9235 r9709  
    2929class LaserCannon : public Weapon
    3030  {
    31   public:
     31    NewObjectListDeclaration(LaserCannon);
     32    public:
    3233    LaserCannon (const TiXmlElement* root = NULL);
    3334    virtual ~LaserCannon ();
  • branches/new_class_id/src/world_entities/weapons/targeting_turret.cc

    r9656 r9709  
    2626#include "util/loading/factory.h"
    2727
    28 CREATE_FACTORY(TargetingTurret, CL_TARGETING_TURRET);
     28#include "class_id.h"
     29NewObjectListDefinitionID(TargetingTurret, CL_TARGETING_TURRET);
     30CREATE_FACTORY(TargetingTurret);
    2931
    3032
     
    4850void TargetingTurret::init()
    4951{
    50   this->setClassID(CL_TARGETING_TURRET, "TargetingTurret");
     52  this->registerObject(this, TargetingTurret::_objectList);
    5153
    5254  Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
     
    7072
    7173  this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET);
    72   this->setProjectileType(CL_GUIDED_MISSILE);
     74  this->setProjectileTypeC("GuidedMissile");
    7375
    7476
  • branches/new_class_id/src/world_entities/weapons/targeting_turret.h

    r9656 r9709  
    1212class TargetingTurret : public Weapon
    1313{
     14  NewObjectListDeclaration(TargetingTurret);
    1415public:
    1516  TargetingTurret(const TiXmlElement* root = NULL);
  • branches/new_class_id/src/world_entities/weapons/test_gun.cc

    r9656 r9709  
    3131#include "animation3d.h"
    3232
    33 #include "fast_factory.h"
    34 
    35 CREATE_FACTORY(TestGun, CL_TEST_GUN);
    36 
     33#include "loading/fast_factory.h"
     34
     35#include "class_id.h"
     36NewObjectListDefinitionID(TestGun, CL_TEST_GUN);
     37CREATE_FACTORY(TestGun);
    3738/**
    3839 *  standard constructor
     
    109110void TestGun::init()
    110111{
    111   this->setClassID(CL_TEST_GUN, "TestGun");
    112 
     112  this->registerObject(this, TestGun::_objectList);
    113113//  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
    114114
     
    129129
    130130  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    131   this->setProjectileType(CL_LASER);
     131  this->setProjectileTypeC("Laser");
    132132  this->prepareProjectiles(100);
    133133
  • branches/new_class_id/src/world_entities/weapons/test_gun.h

    r8777 r9709  
    3737class TestGun : public Weapon
    3838  {
     39    NewObjectListDeclaration(TestGun);
    3940  public:
    4041    TestGun (int leftRight);
  • branches/new_class_id/src/world_entities/weapons/turret.cc

    r9406 r9709  
    2727#include "util/loading/factory.h"
    2828
    29 CREATE_FACTORY(Turret, CL_TURRET);
    30 
    31 
     29#include "class_id.h"
     30NewObjectListDefinitionID(Turret, CL_TURRET);
     31CREATE_FACTORY(Turret);
    3232
    3333/**
     
    6262void Turret::init()
    6363{
    64   this->setClassID(CL_TURRET, "Turret");
     64  this->registerObject(this, Turret::_objectList);
    6565
    6666
     
    8686
    8787  this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET);
    88   this->setProjectileType(CL_ROCKET);
     88  this->setProjectileTypeC("Rocket");
    8989
    9090  this->loadModel("models/guns/turret1.obj");
  • branches/new_class_id/src/world_entities/weapons/turret.h

    r8777 r9709  
    1111class Turret : public Weapon
    1212  {
     13    NewObjectListDeclaration(Turret);
    1314  public:
    1415    Turret ();
  • branches/new_class_id/src/world_entities/weapons/weapon.cc

    r9705 r9709  
    2121#include "weapon.h"
    2222
    23 #include "fast_factory.h"
     23#include "loading/fast_factory.h"
    2424#include "world_entities/projectiles/projectile.h"
    2525
Note: See TracChangeset for help on using the changeset viewer.