Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9709 in orxonox.OLD for branches/new_class_id/src/world_entities


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
Files:
125 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/world_entities/bsp_entity.cc

    r9656 r9709  
    1818#include "util/loading/resource_manager.h"
    1919
    20 CREATE_FACTORY(BspEntity, CL_BSP_ENTITY);
     20#include "class_id.h"
     21NewObjectListDefinitionID(BspEntity, CL_BSP_ENTITY);
     22CREATE_FACTORY(BspEntity);
    2123
    2224
     
    5153void BspEntity::init()
    5254{
     55  this->registerObject(this, BspEntity::_objectList);
    5356
    5457  this->bspManager = NULL;
     
    6972  if ( File(ResourceManager::getFullName(name)).exists()  ) {
    7073
    71     this->setClassID(CL_BSP_ENTITY, "BspEntity");
    7274    this->bspManager = new BspManager(this);
    7375
  • branches/new_class_id/src/world_entities/character_attributes.cc

    r9406 r9709  
    11
    22
    3 /* 
     3/*
    44   orxonox - the future of 3D-vertical-scrollers
    55
     
    1818
    1919#include "character_attributes.h"
    20 #include "stdincl.h"
    21 
    22 
     20
     21
     22NewObjectListDefinition(CharacterAttributes);
    2323
    2424
     
    2727   @todo this constructor is not jet implemented - do it
    2828*/
    29 CharacterAttributes::CharacterAttributes () 
    30 {
    31    this->setClassID(CL_CHARACTER_ATTRIBUTES, "CharacterAttributes");
     29CharacterAttributes::CharacterAttributes ()
     30{
     31  this->registerObject(this, CharacterAttributes::_objectList);
    3232}
    3333
     
    3737
    3838*/
    39 CharacterAttributes::~CharacterAttributes () 
     39CharacterAttributes::~CharacterAttributes ()
    4040{
    4141}
     
    9797
    9898/**
    99  *  sets maximum health 
     99 *  sets maximum health
    100100 * @param health
    101101
     
    130130 *  adds shield strength
    131131 * @param strength
    132    
     132
    133133   there is currently no limit to shieldstrength
    134134 */
     
    290290/*=====================energy=====================*/
    291291/**
    292  *  sets the amount of energy 
     292 *  sets the amount of energy
    293293 * @param energy
    294294 */
     
    332332
    333333/**
    334  *  gets the amount of energy 
     334 *  gets the amount of energy
    335335 * @returns energy
    336336 */
     
    358358  return this->energyConsumption;
    359359}
    360  
     360
    361361
    362362/**
  • branches/new_class_id/src/world_entities/character_attributes.h

    r5039 r9709  
    1515*/
    1616class CharacterAttributes : public BaseObject {
     17    NewObjectListDeclaration(CharacterAttributes);
    1718
    1819 public:
  • branches/new_class_id/src/world_entities/creatures/fps_player.cc

    r9494 r9709  
    3232
    3333#include "aabb.h"
    34 
     34#include "bsp_entity.h"
    3535
    3636#include "key_mapper.h"
     
    4141
    4242
    43 
    44 CREATE_FACTORY(FPSPlayer, CL_FPS_PLAYER);
     43#include "class_id.h"
     44NewObjectListDefinitionID(FPSPlayer, CL_FPS_PLAYER);
     45CREATE_FACTORY(FPSPlayer);
    4546
    4647#include "script_class.h"
    47 CREATE_SCRIPTABLE_CLASS(FPSPlayer, CL_FPS_PLAYER,
     48CREATE_SCRIPTABLE_CLASS(FPSPlayer, FPSPlayer::classID(),
    4849                        addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
    4950                            ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))
     
    8586void FPSPlayer::init()
    8687{
    87   this->setClassID(CL_FPS_PLAYER, "FPSPlayer");
     88  this->registerObject(this, FPSPlayer::_objectList);
    8889
    8990  this->bLeft = false;
     
    166167
    167168    //subscribe to collision reaction
    168   this->subscribeReaction(CREngine::CR_PHYSICS_FULL_WALK, CL_BSP_ENTITY);
     169  this->subscribeReaction(CREngine::CR_PHYSICS_FULL_WALK, BspEntity::classID());
    169170
    170171  this->initWeapon = false;
  • branches/new_class_id/src/world_entities/creatures/fps_player.h

    r9235 r9709  
    1616class FPSPlayer : public Playable
    1717{
     18  NewObjectListDeclaration(FPSPlayer);
    1819
    1920  public:
  • branches/new_class_id/src/world_entities/creatures/md2_creature.cc

    r8724 r9709  
    3737#include "debug.h"
    3838
    39 CREATE_FACTORY(MD2Creature, CL_MD2_CREATURE);
     39#include "class_id.h"
     40NewObjectListDefinitionID(MD2Creature, CL_MD2_CREATURE);
     41CREATE_FACTORY(MD2Creature);
    4042
    4143/**
     
    8688  PRINTF(4)("MD2CREATURE INIT\n");
    8789  //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
    88   this->setClassID(CL_MD2_CREATURE, "MD2Creature");
     90  this->registerObject(this, MD2Creature::_objectList);
    8991
    9092  this->toList(OM_GROUP_01);
     
    9597  Weapon* wpLeft = new TestGun(1);
    9698  wpLeft->setName("testGun Left");
    97   Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate(CL_CANNON));
     99  Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate("Cannon"));
    98100
    99101  cannon->setName("BFG");
     
    112114  this->cameraConnNode.addChild(State::getCameraNode());
    113115  State::getCameraTargetNode()->setRelCoor(10,0,0);
    114  
     116
    115117
    116118
  • branches/new_class_id/src/world_entities/creatures/md2_creature.h

    r8724 r9709  
    1616class MD2Creature : public Playable
    1717{
     18  NewObjectListDeclaration(MD2Creature);
    1819
    1920  public:
  • branches/new_class_id/src/world_entities/effects/billboard.cc

    r9707 r9709  
    2727
    2828#include "class_id.h"
    29 CREATE_FACTORY(Billboard, CL_BILLBOARD);
    3029NewObjectListDefinitionID(Billboard, CL_BILLBOARD);
     30CREATE_FACTORY(Billboard);
    3131
    3232/**
  • branches/new_class_id/src/world_entities/effects/explosion.cc

    r9707 r9709  
    1818#include "explosion.h"
    1919
    20 #include "fast_factory.h"
     20#include "loading/fast_factory.h"
    2121
    2222#include "state.h"
     
    2828
    2929#include "class_id.h"
     30NewObjectListDefinitionID(Explosion, CL_EXPLOSION);
    3031CREATE_FAST_FACTORY_STATIC(Explosion);
    31 NewObjectListDefinitionID(Explosion, CL_EXPLOSION);
    3232
    3333/**
  • branches/new_class_id/src/world_entities/effects/lightning_bolt.cc

    r9406 r9709  
    2525
    2626
    27 
    28 CREATE_FACTORY(LightningBolt, CL_LIGHTNING_BOLT);
    29 
     27#include "class_id.h"
     28NewObjectListDefinitionID(LightningBolt, CL_LIGHTNING_BOLT);
     29CREATE_FACTORY(LightningBolt);
    3030
    3131/**
     
    3434LightningBolt::LightningBolt (const TiXmlElement* root)
    3535{
    36   this->setClassID(CL_LIGHTNING_BOLT, "LightningBolt");
     36  this->registerObject(this, LightningBolt::_objectList);
    3737
    3838  this->toList(OM_COMMON);
  • branches/new_class_id/src/world_entities/effects/lightning_bolt.h

    r7460 r9709  
    2121class LightningBolt : public WorldEntity
    2222{
     23  NewObjectListDeclaration(LightningBolt);
    2324  public:
    2425    LightningBolt(const TiXmlElement* root = NULL);
  • branches/new_class_id/src/world_entities/elements/image_entity.cc

    r9406 r9709  
    3030
    3131
    32 CREATE_FACTORY(ImageEntity, CL_IMAGE_ENTITY);
     32#include "class_id.h"
     33NewObjectListDefinitionID(ImageEntity, CL_IMAGE_ENTITY);
     34CREATE_FACTORY(ImageEntity);
    3335
    3436
     
    5961void ImageEntity::init()
    6062{
    61   this->setClassID(CL_IMAGE_ENTITY, "ImageEntity");
     63  this->registerObject(this, ImageEntity::_objectList);
    6264  this->setName("ImageEntity");
    6365
  • branches/new_class_id/src/world_entities/elements/image_entity.h

    r7751 r9709  
    2121//! A class that enables the
    2222class ImageEntity : public PNode, public Element2D {
     23  NewObjectListDeclaration(ImageEntity);
    2324
    2425 public:
  • branches/new_class_id/src/world_entities/elements/text_element.cc

    r9406 r9709  
    2727
    2828
    29 
    30 CREATE_FACTORY(TextElement, CL_TEXT_ELEMENT);
     29#include "class_id.h"
     30NewObjectListDefinitionID(TextElement, CL_TEXT_ELEMENT);
     31CREATE_FACTORY(TextElement);
    3132
    3233
     
    3637TextElement::TextElement (const TiXmlElement* root)
    3738{
    38   this->setClassID(CL_TEXT_ELEMENT, "TextElement");
     39  this->registerObject(this, TextElement::_objectList);
    3940  this->setName("TextElement");
    4041
  • branches/new_class_id/src/world_entities/elements/text_element.h

    r7221 r9709  
    2121//! A class that enables the
    2222class TextElement : public Text {
     23  NewObjectListDeclaration(TextElement);
    2324
    2425 public:
  • branches/new_class_id/src/world_entities/environment.cc

    r9406 r9709  
    2222#include "util/loading/resource_manager.h"
    2323
    24 #include "vector.h"
    2524#include "objModel.h"
    2625#include "obb_tree.h"
    2726#include "util/loading/factory.h"
    2827
    29 
    30 CREATE_FACTORY(Environment, CL_ENVIRONMENT);
     28#include "class_id.h"
     29NewObjectListDefinitionID(Environment, CL_ENVIRONMENT);
     30CREATE_FACTORY(Environment);
    3131
    3232/**
     
    6363void Environment::init()
    6464{
    65   this->setClassID(CL_ENVIRONMENT, "Environment");
     65  this->registerObject(this, Environment::_objectList);
    6666  this->toList(OM_ENVIRON);
    6767}
  • branches/new_class_id/src/world_entities/environment.h

    r6512 r9709  
    1616class Environment : public WorldEntity
    1717{
    18   friend class World;
     18  NewObjectListDeclaration(Environment);
    1919
    2020 public:
  • branches/new_class_id/src/world_entities/environments/building.cc

    r9406 r9709  
    2323
    2424
    25 
    26 CREATE_FACTORY(Building, CL_BUILDING);
     25#include "class_id.h"
     26NewObjectListDefinitionID(Building, CL_BUILDING);
     27CREATE_FACTORY(Building);
    2728
    2829/**
     
    3132Building::Building(const TiXmlElement* root)
    3233{
    33   this->setClassID(CL_BUILDING, "Building");
     34  this->registerObject(this, Building::_objectList);
    3435  this->toList(OM_ENVIRON_NOTICK);
    3536
  • branches/new_class_id/src/world_entities/environments/building.h

    r7041 r9709  
    1515class Building : public WorldEntity
    1616{
    17  public:
     17  NewObjectListDeclaration(Building);
     18  public:
    1819  Building(const TiXmlElement* root);
    1920
  • branches/new_class_id/src/world_entities/environments/mapped_water.cc

    r9406 r9709  
    2525#include "script_class.h"
    2626
    27 CREATE_FACTORY(MappedWater, CL_MAPPED_WATER);
     27#include "class_id.h"
     28NewObjectListDefinitionID(MappedWater, CL_MAPPED_WATER);
     29CREATE_FACTORY(MappedWater);
    2830
    2931SHELL_COMMAND(gui, MappedWater, toggleGui);
    3032SHELL_COMMAND(output, MappedWater, saveParams);
    3133
    32 CREATE_SCRIPTABLE_CLASS(MappedWater, CL_MAPPED_WATER,
     34CREATE_SCRIPTABLE_CLASS(MappedWater, MappedWater::classID(),
    3335                        addMethod("waterUV", ExecutorLua2<MappedWater, float, float>(&MappedWater::fadeWaterUV))
    3436                      ->addMethod("waterFlow", ExecutorLua2<MappedWater, float, float>(&MappedWater::fadeWaterFlow))
     
    4749MappedWater::MappedWater(const TiXmlElement* root)
    4850{
    49   this->setClassID(CL_MAPPED_WATER, "MappedWater");
     51  this->registerObject(this, MappedWater::_objectList);
    5052  this->toList(OM_ENVIRON);
    5153
  • branches/new_class_id/src/world_entities/environments/mapped_water.h

    r9021 r9709  
    3535class MappedWater : public WorldEntity
    3636{
     37  NewObjectListDeclaration(MappedWater);
    3738public:
    3839  MappedWater(const TiXmlElement* root = NULL);
  • branches/new_class_id/src/world_entities/environments/model_entity.cc

    r9656 r9709  
    2323
    2424
    25 
    26 CREATE_FACTORY(ModelEntity, CL_MODEL_ENTITY);
     25#include "class_id.h"
     26NewObjectListDefinitionID(ModelEntity, CL_MODEL_ENTITY);
     27CREATE_FACTORY(ModelEntity);
    2728
    2829/**
     
    3132ModelEntity::ModelEntity(const TiXmlElement* root)
    3233{
    33   this->setClassID(CL_MODEL_ENTITY, "ModelEntity");
     34  this->registerObject(this, ModelEntity::_objectList);
    3435  this->toList(OM_ENVIRON);
    3536
  • branches/new_class_id/src/world_entities/environments/model_entity.h

    r7048 r9709  
    1515class ModelEntity : public WorldEntity
    1616{
     17  NewObjectListDeclaration(ModelEntity);
    1718 public:
    1819  ModelEntity(const TiXmlElement* root);
  • branches/new_class_id/src/world_entities/environments/water.cc

    r9656 r9709  
    3333
    3434
    35 
    36 CREATE_FACTORY(Water, CL_WATER);
     35#include "class_id.h"
     36NewObjectListDefinitionID(Water, CL_WATER);
     37CREATE_FACTORY(Water);
    3738
    3839
    3940Water::Water(const TiXmlElement* root)
    4041{
    41   this->setClassID(CL_WATER, "Water");
     42  this->registerObject(this, Water::_objectList);
    4243  this->toList(OM_ENVIRON);
    4344
     
    217218void Water::tick(float dt)
    218219{
    219   ObjectManager::EntityList entityList = State::getObjectManager()->getObjectList(OM_GROUP_01_PROJ);
     220  ObjectManager::EntityList entityList = State::getObjectManager()->getEntityList(OM_GROUP_01_PROJ);
    220221  ObjectManager::EntityList::iterator entity = entityList.begin();
    221222  while (entity != entityList.end())
  • branches/new_class_id/src/world_entities/environments/water.h

    r7954 r9709  
    2222class Water : public WorldEntity
    2323{
    24  public:
     24  NewObjectListDeclaration(Water);
     25  public:
    2526   Water(const TiXmlElement* root = NULL);
    2627   virtual ~Water();
     
    3839   void draw() const;
    3940   void tick(float dt);
    40    
     41
    4142   virtual void varChangeHandler( std::list<int> & id );
    4243
     
    5253    Material        waterMaterial;
    5354    Shader*         waterShader;
    54    
     55
    5556    float           height;          //!< The hight of the Water
    5657    int             height_handle;   //!< Handle to notify about changes of height
  • branches/new_class_id/src/world_entities/movie_entity.cc

    r9406 r9709  
    2121
    2222
    23 
    24 CREATE_FACTORY(MovieEntity, CL_MOVIE_ENTITY);
     23#include "class_id.h"
     24NewObjectListDefinitionID(MovieEntity, CL_MOVIE_ENTITY);
     25CREATE_FACTORY(MovieEntity);
    2526
    2627/**
     
    2930MovieEntity::MovieEntity (const TiXmlElement* root)
    3031{
    31   this->setClassID(CL_MOVIE_ENTITY, "MovieEntity");
     32  this->registerObject(this, MovieEntity::_objectList);
    3233
    3334  media_container = new MediaContainer();
  • branches/new_class_id/src/world_entities/movie_entity.h

    r7221 r9709  
    1414class MovieEntity : public WorldEntity
    1515{
     16  NewObjectListDeclaration(MovieEntity);
    1617  private:
    1718    MediaContainer* media_container;
  • branches/new_class_id/src/world_entities/npcs/attractor_mine.cc

    r9235 r9709  
    3333#include "effects/explosion.h"
    3434
    35 CREATE_FACTORY(AttractorMine, CL_ATTRACTOR_MINE);
     35#include "class_id.h"
     36NewObjectListDefinitionID(AttractorMine, CL_ATTRACTOR_MINE);
     37CREATE_FACTORY(AttractorMine);
    3638#include "script_class.h"
    37 CREATE_SCRIPTABLE_CLASS(AttractorMine, CL_ATTRACTOR_MINE,
     39CREATE_SCRIPTABLE_CLASS(AttractorMine, AttractorMine::classID(),
    3840                        addMethod("setName", ExecutorLua1<BaseObject,const std::string&>(&BaseObject::setName))
    3941                       //Coordinates
     
    5052    : NPC(NULL)
    5153{
    52   this->setClassID(CL_ATTRACTOR_MINE, "AttractorMine");
     54  this->registerObject(this, AttractorMine::_objectList);
    5355
    5456  this->toList(OM_GROUP_02);
  • branches/new_class_id/src/world_entities/npcs/attractor_mine.h

    r9235 r9709  
    99
    1010class AttractorMine : public NPC {
     11  NewObjectListDeclaration(AttractorMine);
    1112
    1213 public:
  • branches/new_class_id/src/world_entities/npcs/door.cc

    r9406 r9709  
    2525
    2626#include "door.h"
    27 #include "class_list.h"
    2827
    29 
    30 
    31 
    32 
    33 CREATE_FACTORY(Door, CL_DOOR);
     28#include "class_id.h"
     29NewObjectListDefinitionID(Door, CL_DOOR);
     30CREATE_FACTORY(Door);
    3431
    3532
     
    4744Door::Door(const TiXmlElement* root)
    4845{
    49 
    50   this->setClassID(CL_DOOR, "Door");
     46  this->registerObject(this, Door::_objectList);
    5147  this->scale = 1.0f;
    5248  this->actionRadius = 1.0;
     
    152148
    153149
    154 
     150#include "playable.h"
     151#include "generic_npc.h"
    155152/**
    156153 * checks if the door is open
     
    159156{
    160157
    161   std::list<BaseObject*>::const_iterator it;
    162   const std::list<BaseObject*>* list = ClassList::getList(CL_PLAYABLE);
    163158  WorldEntity* entity;
    164159  float distance;
    165160
    166   if( list == NULL)
    167     return false;
    168 
     161  for (NewObjectList<Playable>::const_iterator it = Playable::objectList().begin();
     162       it != Playable::objectList().end();
     163       ++it)
    169164  // for all players
    170   for( it = list->begin(); it != list->end(); it++)
    171165  {
    172     entity = dynamic_cast<WorldEntity*>(*it);
     166    entity = (*it);
    173167
    174168    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
     
    178172
    179173
    180   list = ClassList::getList(CL_GENERIC_NPC);
    181   if( list == NULL)
    182     return false;
    183   for( it = list->begin(); it != list->end(); it++)
     174
     175  for (NewObjectList<GenericNPC>::const_iterator it = GenericNPC::objectList().begin();
     176       it != GenericNPC::objectList().end();
     177       ++it)
    184178  {
    185     entity = dynamic_cast<WorldEntity*>(*it);
     179    entity = (*it);
    186180
    187181    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
  • branches/new_class_id/src/world_entities/npcs/door.h

    r9110 r9709  
    2121class Door : public WorldEntity
    2222{
     23  NewObjectListDeclaration(Door);
     24
    2325  public:
    2426    Door(const TiXmlElement* root = NULL);
  • branches/new_class_id/src/world_entities/npcs/gate.cc

    r9406 r9709  
    2525
    2626#include "gate.h"
    27 #include "class_list.h"
    28 
    2927#include "effects/explosion.h"
    3028
     
    3331
    3432
    35 
    36 CREATE_FACTORY(Gate, CL_GATE);
     33#include "class_id.h"
     34NewObjectListDefinitionID(Gate, CL_GATE);
     35CREATE_FACTORY(Gate);
    3736
    3837
    3938#include "script_class.h"
    40 CREATE_SCRIPTABLE_CLASS(Gate, CL_GATE,
     39CREATE_SCRIPTABLE_CLASS(Gate, Gate::classID(),
    4140                            addMethod("hide", ExecutorLua0<WorldEntity>(&WorldEntity::hide))
    4241                            ->addMethod("unhide", ExecutorLua0<WorldEntity>(&WorldEntity::unhide))
    43                             ->addMethod("destroy", ExecutorLua0<Gate>(&Gate::destroy))   
     42                            ->addMethod("destroy", ExecutorLua0<Gate>(&Gate::destroy))
    4443                            ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
    4544                            ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))
     
    4948
    5049
     50
    5151//! list of all different animations a std md2model supports
    5252sAnim Gate::animationList[3] =
     
    6262Gate::Gate(const TiXmlElement* root)
    6363{
    64 
    65   this->setClassID(CL_GATE, "Gate");
     64  this->registerObject(this, Gate::_objectList);
    6665  this->scale = 1.0f;
    6766  this->actionRadius = 1.0;
     
    165164void Gate::close()
    166165{
    167  
     166
    168167  if( this->destroyed)
    169168    return;
    170  
     169
    171170  this->setAnimation(GATE_CLOSE, MD2_ANIM_ONCE);
    172171  this->bOpen = false;
     
    178177  if( this->destroyed)
    179178    return;
    180  
     179
    181180  this->setAnimation(GATE_DIE, MD2_ANIM_ONCE);
    182181
    183182  Explosion::explode(this, Vector(this->getScaling()/160,this->getScaling()/160,this->getScaling()/160));
    184  
    185  
     183
     184
    186185  this->destroyed = true;
    187186}
    188187
     188#include "playable.h"
     189#include "generic_npc.h"
    189190
    190191/**
     
    195196
    196197  std::list<BaseObject*>::const_iterator it;
    197   const std::list<BaseObject*>* list = ClassList::getList(CL_PLAYABLE);
    198198  WorldEntity* entity;
    199199  float distance;
    200200
    201   if( list == NULL)
    202     return false;
    203 
    204201  // for all players
    205   for( it = list->begin(); it != list->end(); it++)
    206   {
    207     entity = dynamic_cast<WorldEntity*>(*it);
     202  for (NewObjectList<Playable>::const_iterator it = Playable::objectList().begin();
     203       it != Playable::objectList().end();
     204       ++it)
     205  {
     206    entity = (*it);
    208207
    209208    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
     
    213212
    214213
    215   list = ClassList::getList(CL_GENERIC_NPC);
    216   if( list == NULL)
    217     return false;
    218   for( it = list->begin(); it != list->end(); it++)
    219   {
    220     entity = dynamic_cast<WorldEntity*>(*it);
     214  for (NewObjectList<GenericNPC>::const_iterator it = GenericNPC::objectList().begin();
     215       it != GenericNPC::objectList().end();
     216       ++it)
     217  {
     218    entity = (*it);
    221219
    222220    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
  • branches/new_class_id/src/world_entities/npcs/gate.h

    r9298 r9709  
    2222class Gate : public WorldEntity
    2323{
     24  NewObjectListDeclaration(Gate);
     25
    2426  public:
    2527    Gate(const TiXmlElement* root = NULL);
  • branches/new_class_id/src/world_entities/npcs/generic_npc.cc

    r9235 r9709  
    3030#include "loading/resource_manager.h"
    3131
    32 
    33 CREATE_FACTORY(GenericNPC, CL_GENERIC_NPC);
     32#include "bsp_entity.h"
     33
     34#include "class_id.h"
     35NewObjectListDefinitionID(GenericNPC, CL_GENERIC_NPC);
     36CREATE_FACTORY(GenericNPC);
    3437
    3538#include "script_class.h"
    36 CREATE_SCRIPTABLE_CLASS(GenericNPC, CL_GENERIC_NPC,
     39CREATE_SCRIPTABLE_CLASS(GenericNPC, GenericNPC::classID(),
    3740                        // Move
    3841                        addMethod("walkTo", ExecutorLua3<GenericNPC,float,float,float>(&GenericNPC::walkTo))
     
    8184void GenericNPC::init()
    8285{
    83   this->setClassID(CL_GENERIC_NPC, "GenericNPC");
     86  this->registerObject(this, GenericNPC::_objectList);
    8487
    8588  this->toList(OM_GROUP_00);
     
    9295
    9396  // collision reaction registration
    94    this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY);
     97  this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, BspEntity::classID());
    9598}
    9699
  • branches/new_class_id/src/world_entities/npcs/generic_npc.h

    r9235 r9709  
    2525class GenericNPC : public NPC
    2626{
     27  NewObjectListDeclaration(GenericNPC);
    2728
    2829
  • branches/new_class_id/src/world_entities/npcs/ground_turret.cc

    r9707 r9709  
    2929#include "effects/explosion.h"
    3030
     31#include "class_id.h"
    3132
    32 CREATE_FACTORY(GroundTurret, CL_GROUND_TURRET);
    33 
    34 
     33NewObjectListDefinitionID(GroundTurret, CL_GROUND_TURRET);
     34CREATE_FACTORY(GroundTurret);
    3535
    3636
     
    6262void GroundTurret::init()
    6363{
    64   this->setClassID(CL_GROUND_TURRET, "GroundTurret");
     64  this->registerObject(this, GroundTurret::_objectList);
    6565  this->loadModel("models/ground_turret_#.obj", 5);
    6666  this->left = NULL;
  • branches/new_class_id/src/world_entities/npcs/ground_turret.h

    r9656 r9709  
    1414class GroundTurret : public NPC
    1515{
     16  NewObjectListDeclaration(GroundTurret);
    1617
    1718public:
  • branches/new_class_id/src/world_entities/npcs/network_turret.cc

    r9656 r9709  
    3131#include "weapons/aiming_turret.h"
    3232
    33 CREATE_FACTORY(NetworkTurret, CL_NETWORK_TURRET);
    34 
    35 
     33#include "class_id.h"
     34NewObjectListDefinitionID(NetworkTurret, CL_NETWORK_TURRET);
     35CREATE_FACTORY(NetworkTurret);
    3636
    3737
     
    6262void NetworkTurret::init()
    6363{
    64   this->setClassID(CL_NETWORK_TURRET, "NetworkTurret");
     64  this->registerObject(this, NetworkTurret::_objectList);
    6565  this->loadModel("models/ground_turret_#.obj", 5);
    6666
     
    111111  ObjectManager::EntityList::iterator entity;
    112112  Vector diffVec;
    113   for (entity = State::getObjectManager()->getObjectList((OM_LIST)this->targetGroup).begin();
    114        entity != State::getObjectManager()->getObjectList((OM_LIST)this->targetGroup).end();
     113  for (entity = State::getObjectManager()->getEntityList((OM_LIST)this->targetGroup).begin();
     114       entity != State::getObjectManager()->getEntityList((OM_LIST)this->targetGroup).end();
    115115       entity ++)
    116116  {
  • branches/new_class_id/src/world_entities/npcs/network_turret.h

    r9656 r9709  
    1414class NetworkTurret : public NPC
    1515{
    16 
     16  NewObjectListDeclaration(NetworkTurret);
    1717public:
    1818  NetworkTurret(const TiXmlElement* root = NULL);
  • branches/new_class_id/src/world_entities/npcs/npc_test.cc

    r9707 r9709  
    3131
    3232#include "class_id.h"
    33 CREATE_FACTORY(NPC2, CL_NPC_TEST2);
    3433NewObjectListDefinitionID(NPC2, CL_NPC_TEST2);
     34CREATE_FACTORY(NPC2);
    3535
    3636NPC2::NPC2(const TiXmlElement* root)
  • branches/new_class_id/src/world_entities/npcs/repair_station.cc

    r9406 r9709  
    2525
    2626#include "repair_station.h"
    27 #include "class_list.h"
    2827
    29 
    30 
    31 
    32 
    33 CREATE_FACTORY(RepairStation, CL_DOOR);
     28#include "class_id.h"
     29NewObjectListDefinitionID(RepairStation, CL_DOOR +1 );
     30CREATE_FACTORY(RepairStation);
    3431
    3532
     
    6764RepairStation::RepairStation(const TiXmlElement* root)
    6865{
    69 
    70   this->setClassID(CL_DOOR, "RepairStation");
     66  this->registerObject(this, RepairStation::_objectList);
    7167  this->scale = 1.0f;
    7268
  • branches/new_class_id/src/world_entities/npcs/repair_station.h

    r9003 r9709  
    2727class RepairStation : public WorldEntity
    2828{
     29  NewObjectListDeclaration(RepairStation);
    2930  public:
    3031    RepairStation ();
  • branches/new_class_id/src/world_entities/npcs/space_turret.cc

    r9656 r9709  
    2929#include "effects/explosion.h"
    3030
    31 CREATE_FACTORY(SpaceTurret, CL_SPACE_TURRET);
     31#include "class_id.h"
     32NewObjectListDefinitionID(SpaceTurret, CL_SPACE_TURRET);
     33CREATE_FACTORY(SpaceTurret);
    3234
    3335/**
     
    5961void SpaceTurret::init()
    6062{
    61   this->setClassID(CL_SPACE_TURRET, "SpaceTurret");
     63  this->registerObject(this, SpaceTurret::_objectList);
    6264  this->loadModel("models/ground_turret_#.obj", 7.5);
    6365  this->loadModel("models/comet.obj", 1.0f, 3);
  • branches/new_class_id/src/world_entities/npcs/space_turret.h

    r9656 r9709  
    1818class SpaceTurret : public NPC
    1919{
     20  NewObjectListDeclaration(SpaceTurret);
    2021
    2122public:
  • branches/new_class_id/src/world_entities/planet.cc

    r9406 r9709  
    3232
    3333
    34 
    35 CREATE_FACTORY(Planet, CL_PLANET);
    36 
     34#include "class_id.h"
     35NewObjectListDefinitionID(Planet, CL_PLANET);
     36CREATE_FACTORY(Planet);
    3737
    3838
     
    4242Planet::Planet(const TiXmlElement* root)
    4343{
    44   this->setClassID(CL_PLANET, "Planet");
     44  this->registerObject(this, Planet::_objectList);
    4545  this->toList(OM_GROUP_01);
    4646
  • branches/new_class_id/src/world_entities/planet.h

    r7221 r9709  
    1616class Planet : public WorldEntity
    1717{
     18  NewObjectListDeclaration(Planet);
     19
    1820 public:
    1921  Planet(const TiXmlElement* root);
  • branches/new_class_id/src/world_entities/power_ups/laser_power_up.cc

    r9406 r9709  
    2424
    2525
    26 
    27 CREATE_FACTORY(LaserPowerUp, CL_LASER_POWER_UP);
     26#include "class_id.h"
     27NewObjectListDefinitionID(LaserPowerUp, CL_LASER_POWER_UP);
     28CREATE_FACTORY(LaserPowerUp);
    2829
    2930LaserPowerUp::LaserPowerUp () : PowerUp(0.0, 1.0, 0.0)
     
    4950void LaserPowerUp::init()
    5051{
    51   this->setClassID(CL_LASER_POWER_UP, "LaserPowerUp");
     52  this->registerObject(this, LaserPowerUp::_objectList);
    5253  this->loadModel("models/guns/test_gun.obj", 2.0);
    5354
  • branches/new_class_id/src/world_entities/power_ups/laser_power_up.h

    r7954 r9709  
    1313
    1414class LaserPowerUp : public PowerUp {
     15  NewObjectListDeclaration(LaserPowerUp);
    1516
    1617 public:
  • branches/new_class_id/src/world_entities/power_ups/param_power_up.cc

    r9705 r9709  
    2828
    2929#include "class_id.h"
    30 CREATE_FACTORY(ParamPowerUp, CL_PARAM_POWER_UP);
    3130NewObjectListDefinitionID(ParamPowerUp, CL_PARAM_POWER_UP);
     31CREATE_FACTORY(ParamPowerUp);
    3232
    3333const char* ParamPowerUp::paramTypes[] = {
  • branches/new_class_id/src/world_entities/power_ups/turret_power_up.cc

    r9406 r9709  
    2424
    2525
    26 
    27 CREATE_FACTORY(TurretPowerUp, CL_TURRET_POWER_UP);
     26#include "class_id.h"
     27NewObjectListDefinitionID(TurretPowerUp, CL_TURRET_POWER_UP);
     28CREATE_FACTORY(TurretPowerUp);
    2829
    2930TurretPowerUp::TurretPowerUp(const TiXmlElement* root) : PowerUp(0.0, 1.0, 0.0)
     
    4546void TurretPowerUp::init()
    4647{
    47   this->setClassID(CL_TURRET_POWER_UP, "TurretPowerUp");
     48  this->registerObject(this, TurretPowerUp::_objectList);
    4849  this->loadModel("models/guns/turret1.obj", 2.0);
    4950
  • branches/new_class_id/src/world_entities/power_ups/turret_power_up.h

    r7954 r9709  
    1313
    1414class TurretPowerUp : public PowerUp {
     15  NewObjectListDeclaration(TurretPowerUp);
    1516
    1617 public:
  • branches/new_class_id/src/world_entities/power_ups/weapon_power_up.cc

    r9705 r9709  
    2828
    2929#include "class_id.h"
    30 CREATE_FACTORY(WeaponPowerUp, CL_WEAPON_POWER_UP);
    3130NewObjectListDefinitionID(WeaponPowerUp, CL_WEAPON_POWER_UP);
     31CREATE_FACTORY(WeaponPowerUp);
    3232
    3333WeaponPowerUp::WeaponPowerUp(const TiXmlElement* root) : PowerUp(1.0, 1.0, 0.0)
     
    8888{
    8989  this->weapon = dynamic_cast<Weapon*>((weaponXML == NULL)
    90       ? Factory::fabricate(static_cast<ClassID>(this->weapon->getLeafClassID()))
     90      ? Factory::fabricate((this->weapon->getClassID()))
    9191      : Factory::fabricate((const TiXmlElement*)this->getXmlElem()->FirstChildElement("weapon")));
    9292  this->model = this->weapon->getModel(0);
  • 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 ();
  • branches/new_class_id/src/world_entities/recorder.cc

    r9406 r9709  
    2222
    2323
    24 
    25 CREATE_FACTORY(Recorder, CL_RECORDER);
     24#include "class_id.h"
     25NewObjectListDefinitionID(Recorder, CL_RECORDER);
     26CREATE_FACTORY(Recorder);
    2627
    2728
    2829Recorder::Recorder (const TiXmlElement* root)
    2930{
    30   this->setClassID(CL_RECORDER, "Recorder");
     31  this->registerObject(this, Recorder::_objectList);
    3132
    3233  // initialize libavcodec, and register all codecs and formats
  • branches/new_class_id/src/world_entities/recorder.h

    r7221 r9709  
    2020class Recorder : public WorldEntity
    2121{
     22  NewObjectListDeclaration(Recorder);
    2223  public:
    2324    Recorder (const TiXmlElement* root = NULL);
  • branches/new_class_id/src/world_entities/satellite.cc

    r9406 r9709  
    2121
    2222#include "objModel.h"
    23 #include "vector.h"
    2423
    2524
    2625
     26
     27NewObjectListDefinition(Satellite);
    2728
    2829/**
     
    3132Satellite::Satellite (Vector axis, float speed)
    3233{
    33   this->setClassID(CL_SATELLITE, "Satellite");
     34  this->registerObject(this, Satellite::_objectList);
    3435
    3536  this->loadModel("cube");
  • branches/new_class_id/src/world_entities/satellite.h

    r7193 r9709  
    1919class Satellite : public WorldEntity
    2020{
    21   friend class World;
     21  NewObjectListDeclaration(Satellite);
    2222
    2323 public:
  • branches/new_class_id/src/world_entities/script_trigger.cc

    r9656 r9709  
    1616
    1717#include "script_trigger.h"
    18 #include "class_list.h"
    1918#include "script.h"
    2019
    2120#include "state.h"
    2221
    23 
    24 CREATE_SCRIPTABLE_CLASS(ScriptTrigger, CL_SCRIPT_TRIGGER,
     22NewObjectListDefinition(ScriptTrigger);
     23
     24CREATE_SCRIPTABLE_CLASS(ScriptTrigger, ScriptTrigger::classID(),
    2525            // Coordinates
    2626             addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
     
    4949 */
    5050ScriptTrigger::ScriptTrigger(const TiXmlElement* root)
    51 { 
    52   this->setClassID(CL_SCRIPT_TRIGGER, "ScriptTrigger");
     51{
     52  this->registerObject(this, ScriptTrigger::_objectList);
    5353  this->toList(OM_COMMON);
    5454
     
    139139void ScriptTrigger::setTarget(const std::string& target)
    140140{
    141   BaseObject* targetEntity = ClassList::getObject(target, CL_WORLD_ENTITY);
    142 
     141
     142  WorldEntity* targetEntity = WorldEntity::objectList().getObject(target);
    143143  if (targetEntity != NULL)
    144144  {
    145     this->setTarget(dynamic_cast<WorldEntity*>(targetEntity));
     145    this->setTarget(targetEntity);
    146146  }
    147147  else
     
    157157void ScriptTrigger::setTriggerParent(const std::string& parent)
    158158{
    159   BaseObject* parentEntity = ClassList::getObject(parent, CL_WORLD_ENTITY);
     159  WorldEntity* parentEntity = WorldEntity::objectList().getObject(parent);
    160160
    161161  if (parentEntity != NULL)
    162162  {
    163     this->setParent(dynamic_cast<WorldEntity*>(parentEntity));
     163    this->setParent(parentEntity);
    164164    this->setParentMode(PNODE_MOVEMENT);
    165165  }
  • branches/new_class_id/src/world_entities/script_trigger.h

    r9298 r9709  
    1818class ScriptTrigger : public WorldEntity
    1919{
     20  NewObjectListDeclaration(ScriptTrigger);
    2021  public:
    2122    ScriptTrigger(const TiXmlElement* root = NULL);
  • branches/new_class_id/src/world_entities/skybox.cc

    r9656 r9709  
    3131
    3232
    33 
    34 CREATE_FACTORY(SkyBox, CL_SKYBOX);
     33#include "class_id.h"
     34NewObjectListDefinitionID(SkyBox, CL_SKYBOX);
     35CREATE_FACTORY(SkyBox);
    3536
    3637/**
     
    7273void SkyBox::preInit()
    7374{
    74   this->setClassID(CL_SKYBOX, "SkyBox");
     75  this->registerObject(this, SkyBox::_objectList);
    7576  this->toList(OM_BACKGROUND);
    7677  this->toReflectionList();
  • branches/new_class_id/src/world_entities/skybox.h

    r8619 r9709  
    2727class SkyBox : public WorldEntity
    2828{
    29  public:
     29  NewObjectListDeclaration(SkyBox);
     30public:
    3031  SkyBox(const std::string& fileName = "");
    3132  SkyBox(const TiXmlElement* root);
  • branches/new_class_id/src/world_entities/skydome.cc

    r9406 r9709  
    3030
    3131
     32NewObjectListDefinition(Skydome);
    3233
    3334/**
     
    4445  PRINTF(0)("Skydome init\n");
    4546
    46   this->setClassID(CL_SKYDOME, "Skydome");
     47  this->registerObject(this, Skydome::_objectList);
    4748  this->toList(OM_BACKGROUND);
    4849  this->toReflectionList();
     
    119120  glEnd();
    120121
    121   WorldEntity::draw(); 
     122  WorldEntity::draw();
    122123
    123124  glPopMatrix();
  • branches/new_class_id/src/world_entities/skydome.h

    r9006 r9709  
    2121class Skydome : public WorldEntity
    2222{
     23  NewObjectListDeclaration(Skydome);
    2324public:
    2425  Skydome();
     
    3132  void generateSkyPlane(int divisions, float planetRadius, float atmosphereRadius,
    3233                        float hTile, float vTile);
    33  
     34
    3435  void setShader(Shader* shader);
    3536  void setTexture(GLuint texture);
    36  
     37
    3738  void activate();
    3839  void deactivate();
    3940
    4041private:
    41  
     42
    4243  typedef struct VertexInfo
    4344  {
     
    4849
    4950  bool activateDome;
    50  
     51
    5152  VertexInfo *planeVertices;
    5253  int numPlaneVertices;
     
    5960  VertexInfo *vertices;
    6061  int numVertices;
    61  
     62
    6263  GLuint texture;
    6364  Shader* shader;
  • branches/new_class_id/src/world_entities/skysphere.cc

    r9406 r9709  
    2727
    2828#include "skysphere.h"
    29 #include "stdincl.h"
    3029
    3130#include "material.h"
     
    3332
    3433
    35 
     34NewObjectListDefinition(Skysphere);
    3635
    3736/**
     
    4140Skysphere::Skysphere(char* fileName)
    4241{
    43   this->setClassID(CL_SKYSPHERE, "SkySphere");
     42  this->registerObject(this, Skysphere::_objectList);
    4443  this->toList(OM_BACKGROUND);
    4544  if (fileName == NULL)
  • branches/new_class_id/src/world_entities/skysphere.h

    r7076 r9709  
    2424class Skysphere : public WorldEntity
    2525{
     26  NewObjectListDeclaration(Skysphere);
    2627
    2728 public:
  • branches/new_class_id/src/world_entities/space_ships/collision_probe.cc

    r9406 r9709  
    2424
    2525
     26#include "class_id.h"
     27NewObjectListDefinitionID(CollisionProbe, CL_COLLISION_PROBE);
    2628
    27 
    28 CREATE_FACTORY(CollisionProbe, CL_COLLISION_PROBE);
     29CREATE_FACTORY(CollisionProbe);
    2930
    3031
     
    5657void CollisionProbe::init()
    5758{
    58   this->setClassID(CL_COLLISION_PROBE, "CollisionProbe");
     59  this->registerObject(this, CollisionProbe::_objectList);
    5960
    6061  bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
  • branches/new_class_id/src/world_entities/space_ships/collision_probe.h

    r8490 r9709  
    1313class CollisionProbe : public Playable
    1414{
     15  NewObjectListDeclaration(CollisionProbe);
    1516
    1617  public:
  • branches/new_class_id/src/world_entities/space_ships/cruizer.cc

    r9235 r9709  
    3434#include "debug.h"
    3535
    36 CREATE_FACTORY(Cruizer, CL_CRUIZER);
     36#include "class_id.h"
     37NewObjectListDefinitionID(Cruizer, CL_CRUIZER);
     38CREATE_FACTORY(Cruizer);
    3739
    3840/**
     
    8991{
    9092  //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
    91   this->setClassID(CL_CRUIZER, "Cruizer");
     93  this->registerObject(this, Cruizer::_objectList);
    9294
    9395  this->setSupportedPlaymodes(Playable::Full3D);
  • branches/new_class_id/src/world_entities/space_ships/cruizer.h

    r9061 r9709  
    1616class Cruizer : public Playable
    1717{
     18  NewObjectListDeclaration(Cruizer);
    1819  public:
    1920    Cruizer(const std::string& fileName);
  • branches/new_class_id/src/world_entities/space_ships/helicopter.cc

    r9235 r9709  
    3434#include "debug.h"
    3535
    36 CREATE_FACTORY(Helicopter, CL_HELICOPTER);
     36#include "class_id.h"
     37NewObjectListDefinitionID(Helicopter, CL_HELICOPTER);
     38CREATE_FACTORY(Helicopter);
    3739#include "script_class.h"
    38 CREATE_SCRIPTABLE_CLASS(Helicopter, CL_HELICOPTER,
     40CREATE_SCRIPTABLE_CLASS(Helicopter, Helicopter::classID(),
    3941                        addMethod("moveUp", ExecutorLua1<Helicopter,bool>(&Helicopter::moveUp))
    4042                            ->addMethod("moveDown", ExecutorLua1<Helicopter,bool>(&Helicopter::moveDown))
     
    4648                       );
    4749
     50
    4851/**
    4952 *  creates the controlable Helicopter
     
    100103  Weapon* wpLeft = new TestGun(1);
    101104  wpLeft->setName("testGun Left");
    102   Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate(CL_CANNON));
     105  Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate("Cannon"));
    103106
    104107  cannon->setName("BFG");
     
    126129  this->chopperBuffer = NULL;
    127130
    128   this->setClassID(CL_HELICOPTER, "Helicopter");
     131  this->registerObject(this, Helicopter::_objectList);
    129132  PRINTF(4)("HELICOPTER INIT\n");
    130133
  • branches/new_class_id/src/world_entities/space_ships/helicopter.h

    r9235 r9709  
    1717class Helicopter : public Playable
    1818{
     19  NewObjectListDeclaration(Helicopter);
    1920
    2021  public:
  • branches/new_class_id/src/world_entities/space_ships/hover.cc

    r9656 r9709  
    3434#include "debug.h"
    3535
    36 CREATE_FACTORY(Hover, CL_HOVER);
     36#include "class_id.h"
     37NewObjectListDefinitionID(Hover, CL_HOVER);
     38CREATE_FACTORY(Hover);
    3739
    3840#include "script_class.h"
    39 CREATE_SCRIPTABLE_CLASS(Hover, CL_HOVER,
     41CREATE_SCRIPTABLE_CLASS(Hover, Hover::classID(),
    4042                        addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer))
    4143                        //Coordinates
     
    98100  Weapon* wpLeft = new TestGun(1);
    99101  wpLeft->setName("testGun Left");
    100   Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate(CL_HYPERBLASTER));
     102  Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate("Hyperblaster"));
    101103
    102104  cannon->setName("BFG");
     
    123125
    124126  //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
    125   this->setClassID(CL_HOVER, "Hover");
     127  this->registerObject(this, Hover::_objectList);
    126128  this->toReflectionList();
    127129
  • branches/new_class_id/src/world_entities/space_ships/hover.h

    r9235 r9709  
    1515class Hover : public Playable
    1616{
     17  NewObjectListDeclaration(Hover);
    1718  public:
    1819
  • branches/new_class_id/src/world_entities/space_ships/space_ship.cc

    r9656 r9709  
    5353
    5454
    55 
    56 CREATE_FACTORY(SpaceShip, CL_SPACE_SHIP);
     55#include "class_id.h"
     56NewObjectListDefinitionID(SpaceShip, CL_SPACE_SHIP);
     57CREATE_FACTORY(SpaceShip);
     58
    5759#include "script_class.h"
    58 CREATE_SCRIPTABLE_CLASS(SpaceShip, CL_SPACE_SHIP,
     60CREATE_SCRIPTABLE_CLASS(SpaceShip, SpaceShip::classID(),
    5961                        addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer))
    6062                        ->addMethod("fire", ExecutorLua1<Playable, bool>(&Playable::fire))
     
    117119{
    118120//  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
    119   this->setClassID(CL_SPACE_SHIP, "SpaceShip");
     121  this->registerObject(this, SpaceShip::_objectList);
    120122
    121123  PRINTF(4)("SPACESHIP INIT\n");
  • branches/new_class_id/src/world_entities/space_ships/space_ship.h

    r9235 r9709  
    1919class SpaceShip : public Playable
    2020{
     21  NewObjectListDeclaration(SpaceShip);
    2122
    2223  public:
     
    3637    virtual void postSpawn();
    3738    virtual void leftWorld();
    38    
     39
    3940    virtual void destroy(WorldEntity* killer);
    4041    virtual void respawn();
  • branches/new_class_id/src/world_entities/space_ships/spacecraft_2d.cc

    r9406 r9709  
    3838
    3939
    40 CREATE_FACTORY(Spacecraft2D, CL_SPACECRAFT_2D);
    41 
    42 
    43 CREATE_SCRIPTABLE_CLASS(Spacecraft2D, CL_SPACECRAFT_2D,
     40#include "class_id.h"
     41NewObjectListDefinitionID(Spacecraft2D, CL_SPACECRAFT_2D);
     42CREATE_FACTORY(Spacecraft2D);
     43
     44CREATE_SCRIPTABLE_CLASS(Spacecraft2D, Spacecraft2D::classID(),
    4445                        addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer))
    4546                        //Coordinates
     
    5253
    5354
     55
    5456/**
    5557 * @brief loads a Spacecraft2D information from a specified file.
     
    8587
    8688  //weapons:
    87   Weapon* wpRight = dynamic_cast<Weapon*>(Factory::fabricate(CL_LASER_CANNON));
     89  Weapon* wpRight = dynamic_cast<Weapon*>(Factory::fabricate("LaserCannon"));
    8890  wpRight->setName("Cannon_Right");
    89   Weapon* wpLeft = dynamic_cast<Weapon*>(Factory::fabricate(CL_LASER_CANNON));
     91  Weapon* wpLeft = dynamic_cast<Weapon*>(Factory::fabricate("LaserCannon"));
    9092  wpLeft->setName("Cannon_Left");
    9193
    92   Weapon* turretLeft = dynamic_cast<Weapon*>(Factory::fabricate(CL_BOOMERANG_GUN));
     94  Weapon* turretLeft = dynamic_cast<Weapon*>(Factory::fabricate("BoomerangGun"));
    9395  wpRight->setName("Turret_Left");
    94   Weapon* turretRight = dynamic_cast<Weapon*>(Factory::fabricate(CL_BOOMERANG_GUN));
     96  Weapon* turretRight = dynamic_cast<Weapon*>(Factory::fabricate("BoomerangGun"));
    9597  wpLeft->setName("Turret_Right");
    9698
     
    125127{
    126128  //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
    127   this->setClassID(CL_SPACECRAFT_2D, "Spacecraft2D");
     129  this->registerObject(this, Spacecraft2D::_objectList);
    128130
    129131  this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal );
  • branches/new_class_id/src/world_entities/space_ships/spacecraft_2d.h

    r9235 r9709  
    1616class Spacecraft2D : public Playable
    1717{
     18  NewObjectListDeclaration(Spacecraft2D);
    1819  public:
    1920    Spacecraft2D(const std::string& fileName);
  • branches/new_class_id/src/world_entities/space_ships/turbine_hover.cc

    r9656 r9709  
    3434#include "debug.h"
    3535
    36 CREATE_FACTORY(TurbineHover, CL_TURBINE_HOVER);
     36#include "class_id.h"
     37NewObjectListDefinitionID(TurbineHover, CL_TURBINE_HOVER);
     38CREATE_FACTORY(TurbineHover);
    3739
    3840/**
     
    101103{
    102104  //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
    103   this->setClassID(CL_TURBINE_HOVER, "TurbineHover");
     105  this->registerObject(this, TurbineHover::_objectList);
    104106
    105107  this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal | Playable::Vertical);
  • branches/new_class_id/src/world_entities/space_ships/turbine_hover.h

    r9656 r9709  
    1818class TurbineHover : public Playable
    1919{
    20   public:
    21     TurbineHover(const std::string& fileName);
    22     TurbineHover(const TiXmlElement* root = NULL);
    23     virtual ~TurbineHover();
     20  NewObjectListDeclaration(TurbineHover);
     21public:
     22  TurbineHover(const std::string& fileName);
     23  TurbineHover(const TiXmlElement* root = NULL);
     24  virtual ~TurbineHover();
    2425
    25     void setBoostColor(const Color& color);
     26  void setBoostColor(const Color& color);
    2627
    27     virtual void loadParams(const TiXmlElement* root);
    28     virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f);
    29     virtual void enter();
    30     virtual void leave();
     28  virtual void loadParams(const TiXmlElement* root);
     29  virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f);
     30  virtual void enter();
     31  virtual void leave();
    3132
    32     virtual void setTeam(int teamID);
     33  virtual void setTeam(int teamID);
    3334
    34     virtual void postSpawn();
    35     virtual void leftWorld();
    36     virtual void respawn();
     35  virtual void postSpawn();
     36  virtual void leftWorld();
     37  virtual void respawn();
    3738
    38     virtual void collidesWith(WorldEntity* entity, const Vector& location);
    39     virtual void tick(float dt);
    40     virtual void draw() const;
     39  virtual void collidesWith(WorldEntity* entity, const Vector& location);
     40  virtual void tick(float dt);
     41  virtual void draw() const;
    4142
    42     virtual void process(const Event &event);
     43  virtual void process(const Event &event);
    4344
    44   private:
    45     void init();
    46     void movement(float dt);
     45private:
     46  void init();
     47  void movement(float dt);
    4748
    48   private:
    49     bool                  bForward;           //!< forward button pressed.
    50     bool                  bBackward;          //!< backward button pressed.
    51     bool                  bLeft;              //!< left button pressed.
    52     bool                  bRight;             //!< right button pressed.
    53     bool                  bAscend;            //!< ascend button pressed.
    54     bool                  bDescend;           //!< descend button presses.
     49private:
     50  bool                  bForward;           //!< forward button pressed.
     51  bool                  bBackward;          //!< backward button pressed.
     52  bool                  bLeft;              //!< left button pressed.
     53  bool                  bRight;             //!< right button pressed.
     54  bool                  bAscend;            //!< ascend button pressed.
     55  bool                  bDescend;           //!< descend button presses.
    5556
    56     int                   yInvert;
    57     float                 mouseSensitivity;   //!< the mouse sensitivity
     57  int                   yInvert;
     58  float                 mouseSensitivity;   //!< the mouse sensitivity
    5859
    59     PNode                 wingNodeLeft;
    60     PNode                 wingNodeRight;
    61     PNode                 rotorNodeLeft;
    62     PNode                 rotorNodeRight;
     60  PNode                 wingNodeLeft;
     61  PNode                 wingNodeRight;
     62  PNode                 rotorNodeLeft;
     63  PNode                 rotorNodeRight;
    6364
    64     PNode                 cameraNode;
    65     float                 cameraLook;
    66     float                 rotation;
     65  PNode                 cameraNode;
     66  float                 cameraLook;
     67  float                 rotation;
    6768
    68    // Vector                velocity;           //!< the velocity of the TurbineHover.
    69     Quaternion            direction;          //!< the direction of the TurbineHover.
    70     float                 travelSpeed;        //!< the current speed of the Hove (to make soft movement)
    71     float                 acceleration;       //!< the acceleration of the TurbineHover.
    72     float                 airFriction;        //!< AirFriction.
     69  // Vector                velocity;           //!< the velocity of the TurbineHover.
     70  Quaternion            direction;          //!< the direction of the TurbineHover.
     71  float                 travelSpeed;        //!< the current speed of the Hove (to make soft movement)
     72  float                 acceleration;       //!< the acceleration of the TurbineHover.
     73  float                 airFriction;        //!< AirFriction.
    7374
    74     float                 rotorSpeed;         //!< the speed of the rotor.
    75     float                 rotorCycle;         //!< The Cycle the rotor is in.
     75  float                 rotorSpeed;         //!< the speed of the rotor.
     76  float                 rotorCycle;         //!< The Cycle the rotor is in.
    7677
    77     float                 airViscosity;
     78  float                 airViscosity;
    7879
    79     ParticleEmitter*      burstEmitter[2];
    80     ParticleSystem*       burstSystem;
     80  ParticleEmitter*      burstEmitter[2];
     81  ParticleSystem*       burstSystem;
    8182};
    8283
  • branches/new_class_id/src/world_entities/spawning_point.cc

    r9706 r9709  
    3434
    3535#include "class_id.h"
    36 CREATE_FACTORY( SpawningPoint, CL_SPAWNING_POINT );
    3736NewObjectListDefinitionID(SpawningPoint, CL_SPAWNING_POINT);
     37CREATE_FACTORY( SpawningPoint);
    3838/**
    3939 *  constructor
  • branches/new_class_id/src/world_entities/spectator.cc

    r9406 r9709  
    2222#include "shared_network_data.h"
    2323
    24 CREATE_FACTORY(Spectator, CL_SPECTATOR);
    25 
    26 
    27 
     24#include "class_id.h"
     25NewObjectListDefinitionID(Spectator, CL_SPECTATOR);
     26CREATE_FACTORY(Spectator);
    2827
    2928
     
    5857{
    5958//  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
    60   this->setClassID(CL_SPECTATOR, "Spectator");
     59  this->registerObject(this, Spectator::_objectList);
    6160
    6261  this->getWeaponManager().changeWeaponConfig(1);
     
    8988  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    9089
    91  
     90
    9291  registerVar( new SynchronizeableBool( &bLeft, &bLeft, "bLeft", PERMISSION_OWNER ) );
    9392  registerVar( new SynchronizeableBool( &bRight, &bRight, "bRight", PERMISSION_OWNER ) );
     
    161160{
    162161  Playable::tick( time );
    163  
     162
    164163  if( ( xMouse != 0 || yMouse != 0 ) && this->getOwner() == SharedNetworkData::getInstance()->getHostID() )
    165164  {
    166165    xMouse *= time / 10;
    167166    yMouse *= time / 10;
    168    
     167
    169168    angleX -= xMouse;
    170169    angleY -= yMouse;
    171    
     170
    172171    if ( angleY > 2.05 )
    173172      angleY = 2.05;
    174    
     173
    175174    if ( angleY < -1.15 )
    176175      angleY = -1.15;
    177    
     176
    178177    this->mouseDir = Quaternion( angleX, Vector( 0, 1, 0 ) ) * Quaternion( angleY, Vector( 0, 0, 1 ) );
    179    
     178
    180179    xMouse = yMouse = 0;
    181180  }
    182  
     181
    183182  this->setAbsDir( this->mouseDir );
    184  
     183
    185184  Vector velocity;
    186  
     185
    187186  if ( this->bForward )
    188187  {
    189188    velocity += this->getAbsDirX();
    190189  }
    191  
     190
    192191  if ( this->bBackward )
    193192  {
    194193    velocity -= this->getAbsDirX();
    195194  }
    196  
     195
    197196  if ( this->bRight )
    198197  {
    199198    velocity += this->getAbsDirZ();
    200199  }
    201  
     200
    202201  if ( this->bLeft )
    203202  {
    204203    velocity -= this->getAbsDirZ();
    205204  }
    206  
     205
    207206  velocity *= 100;
    208  
     207
    209208  this->shiftCoor( velocity*time );
    210209}
  • branches/new_class_id/src/world_entities/spectator.h

    r8228 r9709  
    1111class Spectator : public Playable
    1212{
     13  NewObjectListDeclaration(Spectator);
    1314
    1415  public:
     
    3738    bool                  bForward;
    3839    bool                  bBackward;
    39    
     40
    4041    float                 xMouse;             //!< mouse moved in x-Direction
    4142    float                 yMouse;             //!< mouse moved in y-Direction
  • branches/new_class_id/src/world_entities/terrain.cc

    r9406 r9709  
    3434
    3535
    36 
    37 CREATE_FACTORY(Terrain, CL_TERRAIN);
     36#include "class_id.h"
     37NewObjectListDefinitionID(Terrain, CL_TERRAIN);
     38CREATE_FACTORY(Terrain);
    3839
    3940/**
     
    8990{
    9091  if (objectList)
    91     glDeleteLists(this->objectList, 1);
     92    glDeleteLists(this->modelList, 1);
    9293  if( this->ssp)
    9394    delete ssp;
     
    104105void Terrain::init()
    105106{
    106   this->setClassID(CL_TERRAIN, "Terrain");
     107  this->registerObject(this, Terrain::_objectList);
    107108  this->toList(OM_ENVIRON_NOTICK);
    108109  this->toReflectionList();
    109110
    110   this->objectList = 0;
     111  this->modelList = 0;
    111112  this->ssp = NULL;
    112113  this->vegetation = NULL;
     
    207208
    208209  if (this->objectList)
    209     glCallList(this->objectList);
     210    glCallList(this->modelList);
    210211  else if (this->getModel())
    211212    this->getModel()->draw();
     
    256257  if (debugTerrain == TERRAIN_DAVE)
    257258  {
    258     objectList = glGenLists(1);
    259     glNewList (objectList, GL_COMPILE);
     259    modelList = glGenLists(1);
     260    glNewList (modelList, GL_COMPILE);
    260261
    261262    glColor3f(1.0,0,0);
  • branches/new_class_id/src/world_entities/terrain.h

    r7954 r9709  
    1212
    1313#include "world_entity.h"
    14 #include "vector.h"
    1514
    1615// FORWARD DECLARATION
     
    2625class Terrain : public WorldEntity
    2726{
     27  NewObjectListDeclaration(Terrain);
    2828
    2929 public:
     
    5252 private:
    5353   Model*              vegetation;
    54    int                 objectList;
     54   int                 modelList;
    5555
    5656   HeightMap*          heightMap;
  • branches/new_class_id/src/world_entities/test_entity.cc

    r9406 r9709  
    3535
    3636
    37 
    38 CREATE_FACTORY(TestEntity, CL_TEST_ENTITY);
     37#include "class_id.h"
     38NewObjectListDefinition(TestEntity);
     39CREATE_FACTORY(TestEntity);
    3940
    4041#include "script_class.h"
    41 CREATE_SCRIPTABLE_CLASS(TestEntity, CL_TEST_ENTITY,
     42CREATE_SCRIPTABLE_CLASS(TestEntity, TestEntity::classID(),
    4243                            addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
    4344                            ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))
    4445                            ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))
    4546                            ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))
    46                            
     47
    4748                       );
    4849
     
    7576void TestEntity::init()
    7677{
    77   this->setClassID(CL_TEST_ENTITY, "TestEntity");
     78  this->registerObject(this, TestEntity::_objectList);
    7879  this->toList(OM_GROUP_00);
    7980
  • branches/new_class_id/src/world_entities/test_entity.h

    r9235 r9709  
    1515class TestEntity : public WorldEntity, public PhysicsInterface
    1616{
     17  NewObjectListDeclaration(TestEntity);
    1718 public:
    1819  TestEntity ();
  • 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.