Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9709 in orxonox.OLD for branches


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
Files:
193 edited
2 moved

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/defs/class_id.h

    r9656 r9709  
    224224  CL_FPS_SNIPER_RIFLE           =    0x000003a7,
    225225  CL_FPS_LASER_RIFLE            =    0x000003a8,
    226   CL_BOOMERANG_GUN              =    0x00000309,
     226  CL_BOOMERANG_GUN              =    0x000003a9,
    227227
    228228  // Projectiles
     
    237237  CL_GUIDED_MISSILE             =    0x000003e8,
    238238  CL_HYPERBLAST                 =    0x000003e9,
    239   CL_BOOMERANG_PROJECTILE       =    0x0000030a,
     239  CL_BOOMERANG_PROJECTILE       =    0x000003ea,
    240240
    241241  // NPC's
     
    253253
    254254  CL_IMAGE_ENTITY               =    0x00000513,
    255   CL_IMAGE_PLANE                =    0x00000514,
     255  CL_IMAGE_PLANE                =    0x00000518,
    256256  CL_MODEL_ENTITY               =    0x00000515,
    257257  CL_TEXT_ELEMENT               =    0x00000516, /// TODO MOVE
  • branches/new_class_id/src/lib/BuildLibs.am

    r9668 r9709  
    11
    22libORXlibs_a_LIBRARIES_ = \
    3                 $(LIB_PREFIX)/util/libORXlibutil.a \
    4                 $(LIB_PREFIX)/shell/libORXshell.a \
    53                $(LIB_PREFIX)/event/libORXevent.a \
    64                $(LIB_PREFIX)/gui/qt/libORXqtgui.a \
    75                $(LIB_PREFIX)/gui/gl/libORXglgui.a \
    86                $(LIB_PREFIX)/gui/libORXbasegui.a \
    9                 $(LIB_PREFIX)/script_engine/libORXscript.a \
    10                 $(LIB_PREFIX)/graphics/importer/libORXimporter.a \
    117                $(LIB_PREFIX)/graphics/libORXgraphics.a \
    12                 $(LIB_PREFIX)/graphics/importer/libtc.a \
    13                 $(LIB_PREFIX)/sound/libORXsound.a \
    148                $(LIB_PREFIX)/particles/libORXparticles.a \
    159                $(LIB_PREFIX)/collision_detection/libORXcd.a \
     
    2317                $(LIB_PREFIX)/physics/libORXphysics.a \
    2418                $(LIB_PREFIX)/gui/gl/libORXglgui.a \
     19                \
     20                $(LIB_PREFIX)/util/libORXlibutil.a \
     21                \
     22                $(LIB_PREFIX)/graphics/importer/libORXimporter.a \
     23                $(LIB_PREFIX)/graphics/importer/libtc.a \
     24                $(LIB_PREFIX)/sound/libORXsound.a \
    2525                $(LIB_PREFIX)/shell/libORXshell.a \
    26                 $(LIB_PREFIX)/math/libORXmath.a \
     26                $(LIB_PREFIX)/script_engine/libORXscript.a \
     27                $(LIB_PREFIX)/util/libORXexecutor.a \
    2728                $(LIB_PREFIX)/util/libORXlibutil.a \
    2829                $(LIB_PREFIX)/lang/libORXlang.a \
    29                 $(LIB_PREFIX)/libORXlibs.a
     30                $(LIB_PREFIX)/libORXlibs.a \
     31                $(LIB_PREFIX)/math/libORXmath.a
  • branches/new_class_id/src/lib/Makefile.am

    r9705 r9709  
    1616                data/data_tank.h
    1717
    18 SUBDIRS =
    19 #       . \
     18SUBDIRS = \
     19        . \
    2020        math \
    2121        lang \
  • branches/new_class_id/src/lib/coord/p_node.cc

    r9691 r9709  
    2929#include "color.h"
    3030
     31
     32NewObjectListDefinition(PNode);
    3133/**
    3234 * @brief standard constructor
  • branches/new_class_id/src/lib/graphics/effects/cloud_effect.cc

    r9686 r9709  
    4040float     CloudEffect::fadeTime;
    4141
     42NewObjectListDefinitionID(CloudEffect, CL_CLOUD_EFFECT);
    4243
    4344
     
    5657
    5758
    58 CREATE_FACTORY(CloudEffect, CL_CLOUD_EFFECT);
    59 NewObjectListDefinitionID(CloudEffect, CL_CLOUD_EFFECT);
     59CREATE_FACTORY(CloudEffect);
    6060
    6161CloudEffect::CloudEffect(const TiXmlElement* root) {
  • branches/new_class_id/src/lib/graphics/effects/fog_effect.cc

    r9686 r9709  
    2222#include "cloud_effect.h"
    2323
     24NewObjectListDefinition(FogEffect);
    2425// Define shell commands
    2526//SHELL_COMMAND(activate, FogEffect, activateFog);
     
    3738                       );
    3839
    39 CREATE_FACTORY(FogEffect, CL_FOG_EFFECT);
    40 NewObjectListDefinition(FogEffect);
     40CREATE_FACTORY(FogEffect);
    4141
    4242/**
  • branches/new_class_id/src/lib/graphics/effects/lense_flare.cc

    r9686 r9709  
    3535#include "class_id.h"
    3636
    37 CREATE_FACTORY(LenseFlare, CL_LENSE_FLARE);
    3837NewObjectListDefinitionID(LenseFlare, CL_LENSE_FLARE);
     38CREATE_FACTORY(LenseFlare);
    3939
    4040/**
  • branches/new_class_id/src/lib/graphics/effects/lightning_effect.cc

    r9686 r9709  
    2929#include "class_id.h"
    3030
     31NewObjectListDefinitionID(LightningEffect, CL_LIGHTNING_EFFECT);
     32
    3133SHELL_COMMAND(activate, LightningEffect, activateLightning);
    3234SHELL_COMMAND(deactivate, LightningEffect, deactivateLightning);
     
    3739                       );
    3840
    39 CREATE_FACTORY(LightningEffect, CL_LIGHTNING_EFFECT);
    40 NewObjectListDefinitionID(LightningEffect, CL_LIGHTNING_EFFECT);
     41CREATE_FACTORY(LightningEffect);
    4142
    4243LightningEffect::LightningEffect(const TiXmlElement* root) {
  • branches/new_class_id/src/lib/graphics/effects/rain_effect.cc

    r9686 r9709  
    3333#include "class_id.h"
    3434
     35NewObjectListDefinitionID(RainEffect, CL_RAIN_EFFECT);
     36
    3537// Define shell commands
    3638//SHELL_COMMAND(activate, RainEffect, activateRain);
     
    4850                       );
    4951
    50 CREATE_FACTORY(RainEffect, CL_RAIN_EFFECT);
    51 NewObjectListDefinitionID(RainEffect, CL_RAIN_EFFECT);
     52CREATE_FACTORY(RainEffect);
    5253
    5354/**
  • branches/new_class_id/src/lib/graphics/effects/snow_effect.cc

    r9686 r9709  
    3232#include "class_id.h"
    3333
     34NewObjectListDefinitionID(SnowEffect, CL_SNOW_EFFECT);
    3435SHELL_COMMAND(activate, SnowEffect, activateSnow);
    3536SHELL_COMMAND(deactivate, SnowEffect, deactivateSnow);
     
    4142                       );
    4243
    43 CREATE_FACTORY(SnowEffect, CL_SNOW_EFFECT);
    44 NewObjectListDefinitionID(SnowEffect, CL_SNOW_EFFECT);
     44CREATE_FACTORY(SnowEffect);
    4545
    4646SnowEffect::SnowEffect(const TiXmlElement* root)
  • branches/new_class_id/src/lib/graphics/effects/volfog_effect.cc

    r9686 r9709  
    4848
    4949#include "class_id.h"
    50 
    51 CREATE_FACTORY(VolFogEffect, CL_VOLFOG_EFFECT);
    5250NewObjectListDefinitionID(VolFogEffect, CL_VOLFOG_EFFECT);
     51CREATE_FACTORY(VolFogEffect);
    5352
    5453VolFogEffect::VolFogEffect(const TiXmlElement* root) {
  • branches/new_class_id/src/lib/graphics/light.cc

    r9685 r9709  
    2929#include "class_id.h"
    3030
    31 CREATE_FACTORY(Light, CL_LIGHT);
    3231NewObjectListDefinitionID(Light, CL_LIGHT);
     32CREATE_FACTORY(Light);
    3333
    3434//! Definition of the Lights and their Names
  • branches/new_class_id/src/lib/graphics/render2D/image_plane.cc

    r9685 r9709  
    2525
    2626#include "class_id.h"
    27 CREATE_FACTORY(ImagePlane, CL_IMAGE_ENTITY);
    2827
    29 NewObjectListDefinitionID(ImagePlane, CL_IMAGE_ENTITY);
     28NewObjectListDefinitionID(ImagePlane, CL_IMAGE_PLANE);
     29CREATE_FACTORY(ImagePlane);
    3030
    3131
  • branches/new_class_id/src/lib/gui/gl/glmenu/glmenu_imagescreen.cc

    r9689 r9709  
    2626
    2727#include "class_id.h"
    28 CREATE_FACTORY(GLMenuImageScreen, CL_GLMENU_IMAGE_SCREEN);
    2928NewObjectListDefinitionID(GLMenuImageScreen, CL_GLMENU_IMAGE_SCREEN);
     29CREATE_FACTORY(GLMenuImageScreen);
    3030
    3131/**
  • branches/new_class_id/src/lib/lang/base_object.h

    r9705 r9709  
    4444  //inline const std::string& getClassName() const { return this->className; }
    4545  /** @returns the className of the corresponding Object as a C-compliant string (const char*) */
    46   inline const char* getClassCName() const { return this->className.c_str(); };
     46  inline const char* getClassCName() const { return _classes.front()._objectList->name().c_str(); };
    4747  /** @returns the ClassName of the Topmost Object of the ClassStack */
    48   inline const std::string& getClassName() const { return _classes.front()._objectList->name(); }
     48  inline const std::string& getClassName() const { return _classes.front()._objectList->name(); };
    4949
    5050  inline const NewClassID& getClassID() const { return *_leafClassID; }
  • branches/new_class_id/src/lib/lang/new_class_id.cc

    r9701 r9709  
    1919#include "new_object_list.h"
    2020
     21/**
     22 * @brief a Default Constructor.
     23 * this Always points to the ID of the NullClass.
     24 */
    2125NewClassID::NewClassID()
    2226{
    23   *this = NullClass::classID();
     27  NullClass::acquireID(this->_id, this->_name);
    2428};
    2529
    26 NewClassID::NewClassID(const NewObjectListBase* objList)
     30/**
     31 * @brief Acquiring the ID of a objectList.
     32 * @param objList The NewObjectList to acquire the ID from.
     33 */
     34NewClassID::NewClassID(const NewObjectListBase* const objList)
    2735{
    28 
    29   objList->acquireID(_id, _name);
    30 
     36  objList->acquireID(this->_id, this->_name);
    3137}
    3238
    3339
    3440NewClassID NullClass::_classID;
     41
     42int NullClass::_nullID;
     43const std::string NullClass::_nullName = std::string("NullClass");
  • branches/new_class_id/src/lib/lang/new_class_id.h

    r9701 r9709  
    1212class NewObjectListBase;
    1313
    14 //! A class to dynamically allocate ClassID's and support a isA operator
     14//! A class to dynamically allocate ClassID's and to support a isA operator
     15/**
     16 * A NewClassID can only be aquired over a NewObjectList,
     17 * thus enabling the developer to have permanent access to the correct ID and ClassName
     18 *
     19 * The Idea behind this concept is, that storing a NewClassID that changes its internal state
     20 * all NewClassID's will be updated correctly.
     21 *
     22 * Since the Existance of any NewObjectList is a requirement during the working process all
     23 * ID's should reference a valid ID and ClassName
     24 */
    1525class NewClassID
    1626{
    1727public:
    1828  NewClassID();
    19   NewClassID(const NewObjectListBase* id);
    20   // the copy constructor is also defined.
     29  NewClassID(const NewObjectListBase* const id);
     30  /// the copy constructor is also defined implicitely.
     31
     32  /** @returns A constant reference to the ID. */
    2133  const int& id() const { return *_id; };
     34  /** @returns A constant reference to the Name. */
    2235  const std::string& name() const { return *_name; };
    2336
     37  /** @param id the id to compare @returns true on match (match is same ID) @brief compares two id's */
    2438  bool operator==(const NewClassID& id) const { return *_id == *id._id /* || _name == id._name */; };
     39  /** @param id the id to compare @returns true on match (match is same ID) @brief compares two id's */
    2540  bool operator==(int id) const { return *_id == id; };
     41  /** @param name the id to compare @returns true on match (match is same Name) @brief compares an ID with a ClassName */
    2642  bool operator==(const std::string& name) const { return *_name == name; };
     43  /** @param id the id to compare @returns false on match (match is same ID) @brief compares two id's */
    2744  bool operator!=(const NewClassID& id) const { return *_id != *id._id /* && _name != id._name*/;  };
     45  /** @param id the id to compare @returns false on match (match is same ID) @brief compares two id's */
    2846  bool operator!=(int id) const { return *_id != id; };
     47  /** @param name the id to compare @returns false on match (match is same Name) @brief compares an ID with a ClassName */
    2948  bool operator!=(const std::string& name) const { return *_name != name; };
    3049
    3150private:
    32   const int*                _id;
    33   const std::string*        _name;
     51  const int*                _id;           //!< A pointer to the ID of the ClassID.
     52  const std::string*        _name;         //!< A pointer to the Name of the ClassID.
    3453};
    3554
     55//! A NullClass. This is the Null of the ClassID.
     56/**
     57 * implemented as a Class id can be used to reference NullObjects.
     58 */
    3659class NullClass
    3760{
    3861public:
    39   static NewClassID classID() { return NullClass::_classID; }
     62  /** @returns the NullClass' ID. */
     63  static const NewClassID& classID() { return NullClass::_classID; }
     64  /** @param id the ID to acquire @param name the name to acquire @brief acquires the ID of this Class */
     65  static void acquireID(const int*& id, const std::string*& name) { id = &_nullID; name = &_nullName; };
     66
    4067private:
    41   NullClass();
     68  NullClass() {}; //!< The Default Constructor is hidden from the User.
     69
    4270private:
    43   static NewClassID _classID;
     71  static NewClassID         _classID;      //!< The NullClass' ID
     72  static const std::string  _nullName;     //!< The NullClass' Name ("NullClass")
     73  static int                _nullID;       //!< The NullClass' ID
    4474};
    4575
  • branches/new_class_id/src/lib/lang/new_object_list.cc

    r9705 r9709  
    2020
    2121
     22#include <stdio.h>
     23
    2224/**
    2325 * @brief Constructor, that creates an ObjectList while checking (development mode) for uniqueness of all Keys (names and ID's)
     
    2729 */
    2830NewObjectListBase::NewObjectListBase(const std::string& className, int id)
    29   : _name(className)
    30 {
     31    : _name(className)
     32{
     33  printf("NewObjectList, Registered %s::%d\n", className.c_str(), id);
    3134  if (NewObjectListBase::_classesByID == NULL)
    3235  {
     
    4750  _id = id;
    4851  /// Some Output, that will fall out later
    49   //std::cout << "register new ObjectList " << className << " ID: " << this->_id << std::endl;
     52  std::cout << "register new ObjectList " << className << " ID: " << this->_id << std::endl;
    5053
    5154  this->_identity = NewClassID(this);
     
    98101 * @return true if such a class already exists.
    99102 */
     103bool NewObjectListBase::classIDExists(int id)
     104{
     105  return (NewObjectListBase::_classesByID->find(id) != NewObjectListBase::_classesByID->end());
     106}
     107
     108/**
     109 * @brief Checks if a Class with name already exists.
     110 * @param name The Name of the Class to check.
     111 * @return true if such a class already exists.
     112 */
    100113bool NewObjectListBase::classNameExists(const std::string& name)
    101114{
     
    108121 * @returns the ClassID if found and NullClass' identity if not.
    109122 */
    110 const NewClassID& NewObejctListBase::retrieveIdentity(int id)
     123const NewClassID& NewObjectListBase::retrieveIdentity(int id)
    111124{
    112125  const NewObjectListBase* const base = NewObjectListBase::getObjectList(id);
     
    117130    return NullClass::classID();
    118131}
     132
    119133
    120134/**
     
    130144    return base->_identity;
    131145  else
    132     return NullObject::classID();
    133 }
    134 
    135 
    136 /**
    137  * @brief Checks if a Class with name already exists.
    138  * @param name The Name of the Class to check.
    139  * @return true if such a class already exists.
    140  */
    141 bool NewObjectListBase::classIDExists(int id)
    142 {
    143   return (NewObjectListBase::_classesByID->find(id) != NewObjectListBase::_classesByID->end());
     146    return NullClass::classID();
    144147}
    145148
     
    230233}
    231234
     235#include "base_object.h"
     236
     237/**
     238 * @brief Prints out some debugging information about a given List.
     239 */
     240void NewObjectListBase::debug(unsigned int level) const
     241{
     242  base_list list;
     243  this->getBaseObjectList(&list);
     244
     245  if (level > 1 || !list.empty())
     246    printf(" ObjectList of class %s(id:%d) contains %d objects\n", this->name().c_str(), this->id(), list.size());
     247
     248  if (level >= 2)
     249  {
     250    printf("  - listing Instances: \n");
     251    for (base_iterator it = list.begin();
     252         it != list.end();
     253         ++it)
     254    {
     255      printf("   + %s::%s\n", (*it)->getClassCName(), (*it)->getCName());
     256    }
     257  }
     258}
     259
     260
     261void NewObjectListBase::debugAll(unsigned int level)
     262{
     263  printf("Listing all %d ObjectLists \n", NewObjectListBase::_classesByID->size());
     264
     265  for (classNameMap::const_iterator it = NewObjectListBase::_classesByName->begin();
     266       it != NewObjectListBase::_classesByName->end();
     267       ++it)
     268  {
     269    (*it).second->debug(level);
     270
     271  }
     272
     273}
     274
     275
    232276
    233277/**
  • branches/new_class_id/src/lib/lang/new_object_list.h

    r9705 r9709  
    4848  class IteratorBase { };
    4949
    50   typedef std::list<BaseObject*>            base_list;
    51   typedef base_list::iterator               base_iterator;
     50  /** @brief A Typedefinition for the Base-List that can be retrieved with getBaseObjectList(base_list*) */
     51  typedef std::list<BaseObject*>        base_list;
     52  /** @brief An iterator for the base_list */
     53  typedef base_list::iterator           base_iterator;
    5254
    5355public:
    5456  /** @returns The Identity of the Class stored within. */
    55   inline const NewClassID& identity() const { return _identity; }
     57  inline const NewClassID&              identity() const { return _identity; }
    5658  /** @returns the ID of the Identity of the ObjectList */
    57   inline int id() const { return _id; };
     59  inline int                            id() const { return _id; };
    5860  /** @returns The Name of the Class stored in this ObjectList */
    59   inline const std::string& name() const { return _name; };
     61  inline const std::string&             name() const { return _name; };
    6062  /** @param id The id to compare @returns true on match, false otherwise */
    61   inline bool operator==(int id) const { return _id == id; };
     63  inline bool                           operator==(int id) const { return _id == id; };
    6264  /** @param id The id to compare @returns true on match, false otherwise */
    63   inline bool operator==(const NewClassID& id) const { return id == _id; };
     65  inline bool                           operator==(const NewClassID& id) const { return id == _id; };
    6466  /** @param name The name to compare @returns true on match, false otherwise */
    65   inline bool operator==(const std::string& name) const { return _name == name; };
     67  inline bool                           operator==(const std::string& name) const { return _name == name; };
    6668  /** @param id The id to check @returns true on match, false otherwise */
    67   inline void acquireID(const int*& id, const std::string*& name) const { id = &_id; name = &_name; };
     69  inline void                           acquireID(const int*& id, const std::string*& name) const { id = &_id; name = &_name; };
    6870  /** @brief fills a list of Objects into a BaseObject*-List. @param list the list to fill */
    69   virtual void getBaseObjectList(base_list* list) const = 0;
    70 
    71   static const NewClassID& retrieveIdentity(int id);
    72   static const NewClassID& retrieveIdentity(const std::string& name);
     71  virtual void                          getBaseObjectList(base_list* list) const = 0;
     72
     73  static const NewClassID&              retrieveIdentity(int id);
     74  static const NewClassID&              retrieveIdentity(const std::string& name);
    7375
    7476  static const NewObjectListBase* const getObjectList(int classID);
     
    7678  static const NewObjectListBase* const getObjectList(const NewClassID& classID);
    7779
    78   static BaseObject* getBaseObject(int classID, const std::string& objectName);
    79   static BaseObject* getBaseObject(const std::string& className, const std::string& objectName);
    80   static BaseObject* getBaseObject(const NewClassID& classID, const std::string& objectName);
     80  static BaseObject*                    getBaseObject(int classID, const std::string& objectName);
     81  static BaseObject*                    getBaseObject(const std::string& className, const std::string& objectName);
     82  static BaseObject*                    getBaseObject(const NewClassID& classID, const std::string& objectName);
    8183
    8284  /** @returns an Object with Name name out of this List @param name the name of the Object. */
    83   virtual BaseObject* getBaseObject(const std::string& name) const = 0;
     85  virtual BaseObject*                   getBaseObject(const std::string& name) const = 0;
    8486
    8587  static const std::list<std::string>&  getClassNames();
    8688
     89
    8790  static unsigned int                   classCount();
     91  void                                  debug(unsigned int level) const;
     92  static void                           debugAll(unsigned int level);
     93
    8894  static const std::string&             IDToString(int classID);
    8995  static int                            StringToID(const std::string& className);
    9096
    91   virtual void debug() const = 0;
    92 
    9397  //! Only uset to unsubscribe a BaseObject.
    94   virtual void unregisterObject(IteratorBase* _iterators) = 0;
     98  virtual void                          unregisterObject(IteratorBase* _iterators) = 0;
    9599
    96100protected:
     
    101105  NewObjectListBase(const NewObjectListBase&);
    102106
    103   static bool classIDExists(int id);
    104   static bool classNameExists(const std::string& className);
     107  static bool                         classIDExists(int id);
     108  static bool                         classNameExists(const std::string& className);
    105109
    106110
     
    126130//! Defines a ObjectsList handler for objects of type T.
    127131/**
     132 * The ObjectList is a generic way to store every object created from a Class 'T'
     133 *  into a List. The list can be retrieved, and used constantly over iterators,
     134 *  as with normal std::list.
     135 *
     136 * Furthermore the linkage over the single Lists is given over the Superclass NewObjectListBase.
     137 *
     138 *
     139 *
     140 *
    128141 * To define a Class with a ObjectList, you have to:
    129142 *  1. Include 'NewObjectListDeclaration(T);' in its Declaration (at the beginning)
     
    132145 *
    133146 * @note The Class must define the compare with const std::string& operator for this to work.
     147 *
     148 *
     149 *
     150 * Limitations:
     151 *  ObjectList cannot be used with other Factory style Classes, if the class is also a BaseObject,
     152 *   and not loaded before the ObjectList.
     153 *
     154 * @example Iterating: Iteration is made easy, and fast as follows:
     155 *   for (NewObjectList<PlayerStats>::const_iterator it = PlayerStats::objectList().begin();
     156 *      it != PlayerStats::objectList().end();
     157 *     ++it)
     158 *   {
     159 *    (*it)->dosomething
     160 *   }
     161 *
     162 * @example Find an Object:
     163 * Playable* playable = Playable::objectList("orxonox-super-rocket-fighter"); // searches an Object By its name.
     164 *
    134165 */
    135166template<class T>
     
    154185  ~NewObjectList();
    155186
    156   virtual BaseObject*     getBaseObject(const std::string& name) const;
    157   T*                      getObject(const std::string& name) const;
    158   inline const list&      objects() const { return _objects; };
    159   bool exists(const T* const object) const;
    160 
    161   inline iterator begin() { return _objects.begin(); };
    162   inline const_iterator begin() const { return _objects.begin(); };
    163   inline iterator  end() { return _objects.end(); };
    164   inline const_iterator  end() const { return _objects.end(); };
    165 
    166   inline bool empty() const { return _objects.empty(); };
    167   inline int size() const { return _objects.size(); };
    168   inline T* front() const { return _objects.front(); };
    169   inline T* back() const { return _objects.back(); };
    170 
    171 
    172   NewObjectListBase::IteratorBase* registerObject(T* object);
    173   virtual void unregisterObject(IteratorBase* iterator);
    174 
    175   virtual void debug() const;
     187  virtual BaseObject*                getBaseObject(const std::string& name) const;
     188  T*                                 getObject(const std::string& name) const;
     189  inline const list&                 objects() const { return _objects; };
     190  bool                               exists(const T* const object) const;
     191
     192  /** @returns an Iterator to the beginning of the List. */
     193  inline iterator                    begin() { return _objects.begin(); };
     194  /** @returns a constant Iterator to the beginning of the List. */
     195  inline const_iterator              begin() const { return _objects.begin(); };
     196  /** @returns an Iterator to the end of the List. */
     197  inline iterator                    end() { return _objects.end(); };
     198  /** @returns a constant Iterator to the beginning of the List. */
     199  inline const_iterator              end() const { return _objects.end(); };
     200
     201  /** @returns true if the List is empty. */
     202  inline bool                        empty() const { return _objects.empty(); };
     203  /** @returns the size of the List */
     204  inline int                         size() const { return _objects.size(); };
     205  /** @returns the frontmost Element of the list (normaly the last added Object). */
     206  inline T*                          front() const { return _objects.front(); };
     207  /** @returns the last added Object */
     208  inline T*                          back() const { return _objects.back(); };
     209
     210
     211  NewObjectListBase::IteratorBase*   registerObject(T* object);
     212  virtual void                       unregisterObject(IteratorBase* iterator);
    176213
    177214protected:
    178   virtual void getBaseObjectList(NewObjectListBase::base_list* list) const;
     215  virtual void                       getBaseObjectList(NewObjectListBase::base_list* list) const;
    179216
    180217
     
    184221
    185222private:
    186   list                _objects;
     223  list                _objects;     //!< The List of stored Objects of Type T.
    187224};
    188225
     
    212249  if (!_objects.empty())
    213250  {
    214     std::cout << "There are still Object in the ObjectList of " << this->name() << "(id:" << this->id() << ")\n";
    215     this->debug();
     251    // std::cout << "There are " << this->size() << " objects from class " << this->name() << "(id:" << this->id() << ") in existance\n";
    216252  }
    217253}
     
    279315NewObjectListBase::IteratorBase* NewObjectList<T>::registerObject(T* object)
    280316{
    281   this->_objects.push_front(object);
    282   return new Iterator(this->_objects.begin());
     317  this->_objects.push_back(object);
     318  return new Iterator(--this->_objects.end());
    283319}
    284320
     
    294330}
    295331
    296 /**
    297  * @brief print out some debug information
    298  * @note this function will most probably vanish from here and be completely moved to the base class.
    299  */
    300 template <class T>
    301 void NewObjectList<T>::debug() const
    302 {
    303   const_iterator it;
    304   for (it = this->_objects.begin(); it != this->_objects.end(); ++it)
    305   {
    306     std::cout << (*it)->getName() << std::endl;
    307   }
    308 }
    309 
    310332#endif /* _NEW_OBJECT_LIST_H */
  • branches/new_class_id/src/lib/network/monitor/network_stats_widget.cc

    r9691 r9709  
    2929// SHELL_COMMAND(gui, NetworkStatsWidget, toggleGUI)
    3030// ->setAlias("ProxyGui");
    31 
    32 NewObjectListDefinition(NetworkStatsWidget);
    3331
    3432HostWidget::HostWidget(const std::string& name, const IP& ip)
     
    212210//======================================================//
    213211
     212
     213NewObjectListDefinition(NetworkStatsWidget);
    214214/**
    215215 * @brief standard constructor
  • branches/new_class_id/src/lib/network/network_stream.cc

    r9691 r9709  
    11941194          }
    11951195          else
    1196             b = Factory::fabricate( leafClassId );
     1196            ; /// FIXME NEW_CLASS_ID :: b = Factory::fabricate( leafClassId );
    11971197
    11981198          if ( !b )
  • branches/new_class_id/src/lib/network/player_stats.cc

    r9691 r9709  
    3232#include "class_id.h"
    3333
    34 CREATE_FACTORY(PlayerStats, CL_PLAYER_STATS);
    3534NewObjectListDefinitionID(PlayerStats, CL_PLAYER_STATS);
     35CREATE_FACTORY(PlayerStats);
    3636
    3737/**
  • branches/new_class_id/src/lib/particles/box_emitter.cc

    r9686 r9709  
    2626#include "class_id.h"
    2727
    28 CREATE_FACTORY(BoxEmitter, CL_BOX_EMITTER);
    2928NewObjectListDefinitionID(BoxEmitter, CL_BOX_EMITTER);
     29CREATE_FACTORY(BoxEmitter);
     30
    3031/**
    3132 *  standard constructor
  • branches/new_class_id/src/lib/particles/dot_emitter.cc

    r9686 r9709  
    2727
    2828#include "class_id.h"
    29 CREATE_FACTORY(DotEmitter, CL_DOT_EMITTER);
    3029NewObjectListDefinitionID(DotEmitter, CL_DOT_EMITTER);
     30CREATE_FACTORY(DotEmitter);
    3131
    3232/**
  • branches/new_class_id/src/lib/particles/dot_particles.cc

    r9687 r9709  
    2626#include "class_id.h"
    2727
    28 CREATE_FACTORY(DotParticles, CL_DOT_PARTICLES);
    2928NewObjectListDefinitionID(DotParticles, CL_DOT_PARTICLES);
     29CREATE_FACTORY(DotParticles);
    3030
    3131SHELL_COMMAND(texture, DotParticles, setMaterialTexture)
  • branches/new_class_id/src/lib/particles/model_particles.cc

    r9687 r9709  
    2626#include "class_id.h"
    2727
    28 CREATE_FACTORY(ModelParticles, CL_MODEL_PARTICLES);
    2928NewObjectListDefinitionID(ModelParticles, CL_MODEL_PARTICLES);
     29CREATE_FACTORY(ModelParticles);
    3030
    3131SHELL_COMMAND(texture, ModelParticles, setMaterialTexture)
  • branches/new_class_id/src/lib/particles/plane_emitter.cc

    r9686 r9709  
    2626#include "class_id.h"
    2727
    28 CREATE_FACTORY(PlaneEmitter, CL_PLANE_EMITTER);
    2928NewObjectListDefinitionID(PlaneEmitter, CL_PLANE_EMITTER);
     29CREATE_FACTORY(PlaneEmitter);
    3030
    3131/**
  • branches/new_class_id/src/lib/particles/spark_particles.cc

    r9687 r9709  
    2626#include "class_id.h"
    2727
    28 CREATE_FACTORY(SparkParticles, CL_SPARK_PARTICLES);
    2928NewObjectListDefinitionID(SparkParticles, CL_SPARK_PARTICLES);
     29CREATE_FACTORY(SparkParticles);
    3030
    3131/**
  • branches/new_class_id/src/lib/particles/sprite_particles.cc

    r9687 r9709  
    2626#include "class_id.h"
    2727
    28 CREATE_FACTORY(SpriteParticles, CL_SPRITE_PARTICLES);
    2928NewObjectListDefinitionID(SpriteParticles, CL_SPRITE_PARTICLES);
     29CREATE_FACTORY(SpriteParticles);
    3030
    3131SHELL_COMMAND(texture, SpriteParticles, setMaterialTexture)
  • branches/new_class_id/src/lib/physics/fields/gravity.cc

    r9686 r9709  
    2424NewObjectListDefinitionID(Gravity, CL_FIELD_GRAVITY);
    2525
    26 CREATE_FACTORY(Gravity, CL_FIELD_GRAVITY);
     26CREATE_FACTORY(Gravity);
    2727
    2828Gravity::Gravity(const TiXmlElement* root)
  • branches/new_class_id/src/lib/physics/physics_connection.cc

    r9686 r9709  
    2828
    2929#include "class_id.h"
    30 
    31 CREATE_FACTORY(PhysicsConnection, CL_PHYSICS_CONNECTION);
    3230NewObjectListDefinition(PhysicsConnection);
     31CREATE_FACTORY(PhysicsConnection);
    3332/**
    3433 *  creates a PhysicsConnection
  • branches/new_class_id/src/lib/script_engine/script.cc

    r9699 r9709  
    2222#include "loading/load_param.h"
    2323#include "parser/tinyxml/tinyxml.h"
     24
     25NewObjectListDefinition(Script);
    2426
    2527CREATE_SCRIPTABLE_CLASS(Script, Script::classID(),
     
    3032                     );
    3133
    32 NewObjectListDefinition(Script);
    3334
    3435Script::Script(const TiXmlElement* root)
  • branches/new_class_id/src/lib/script_engine/script_class.h

    r9699 r9709  
    2929public:
    3030  virtual ~ScriptClass();
    31 
    32   const std::string& getName() const { return this->getName(); }
    33   bool operator==(const std::string& name) const { return (this->getName() == name); }
    34   bool operator==(NewClassID classID) const { return (this->_classID == classID); }
    3531
    3632  virtual void registerClass(Script* script) = 0;
  • branches/new_class_id/src/lib/shell/Makefile.am

    r7428 r9709  
    1818                shell_buffer.h \
    1919                shell_input.h \
     20                shell_command_class.h \
    2021                shell_command.h \
    21                 shell_command_class.h \
    2222                shell_completion.h \
    2323                shell_completion_plugin.h
  • branches/new_class_id/src/lib/shell/shell_command.cc

    r9702 r9709  
    2626namespace OrxShell
    2727{
     28  NewObjectListDefinition(ShellCommand);
    2829  SHELL_COMMAND(debug, ShellCommandClass, help);
    29   NewObjectListDefinition(ShellCommand);
    3030
    3131
  • branches/new_class_id/src/lib/shell/shell_completion.cc

    r9697 r9709  
    141141      type = ClassCompletion;
    142142
    143     /// FIXME
    144 //     if (!this->addToCompleteList(*boList, objectBegin, type))
    145 //       return false;
     143    NewObjectListBase::base_list list;
     144    objectList->getBaseObjectList(&list);
     145
     146    if (!this->addToCompleteList(list, objectBegin, type))
     147     return false;
    146148
    147149    return true;
  • branches/new_class_id/src/lib/shell/some_shell_commands.cc

    r8623 r9709  
    3434  SHELL_COMMAND(nick, PlayerStats, shellNick)->setAlias("nick");
    3535
    36 #include "class_list.h"
    37   SHELL_COMMAND(debug, ClassList, ClassList::debugS)
    38       ->describe("Shows all registered classes, if param1: is a valid ClassName only values of this class are shown. param2: how much output")
    39       ->defaultValues(MT_NULL, 1);
     36// #include "class_list.h"
     37//   SHELL_COMMAND(debug, ClassList, ClassList::debugS)
     38//       ->describe("Shows all registered classes, if param1: is a valid ClassName only values of this class are shown. param2: how much output")
     39//       ->defaultValues(MT_NULL, 1);
    4040
    4141#include "p_node.h"
  • branches/new_class_id/src/lib/util/Makefile.am

    r9406 r9709  
    22include $(MAINSRCDIR)/defs/include_paths.am
    33
    4 noinst_LIBRARIES = libORXlibutil.a
     4noinst_LIBRARIES = \
     5                libORXlibutil.a \
     6                libORXexecutor.a
     7
     8libORXexecutor_a_SOURCES = \
     9                executor/executor.cc \
     10                executor/executor_functional.cc \
     11                executor/executor_lua.cc
    512
    613libORXlibutil_a_SOURCES = \
     
    916                helper_functions.cc \
    1017                multi_type.cc \
    11                 executor/executor.cc \
    12                 executor/executor_functional.cc \
    13                 executor/executor_lua.cc \
    1418                \
    1519                loading/resource_manager.cc \
     
    1923                loading/load_param_description.cc \
    2024                loading/factory.cc \
    21                 loading/dynamic_loader.cc \
     25                loading/fast_factory.cc \
    2226                \
    2327                filesys/file.cc \
     
    2832                threading.cc \
    2933                timer.cc
     34
     35#               loading/dynamic_loader.cc
    3036
    3137
     
    5561                loading/load_param_description.h \
    5662                loading/factory.h \
     63                loading/fast_factory.h \
    5764                loading/dynamic_loader.h \
    5865                \
  • branches/new_class_id/src/lib/util/loading/dynamic_loader.cc

    r9684 r9709  
    3131*/
    3232DynamicLoader::DynamicLoader (const std::string& libName)
    33     : Factory(NULL, 0)
     33    : Factory(libName)
    3434{
    3535  this->registerObject(this, DynamicLoader::_objectList);
  • branches/new_class_id/src/lib/util/loading/factory.cc

    r9695 r9709  
    2828 * set everything to zero and define factoryName
    2929 */
    30 Factory::Factory (const std::string& factoryName, int classID)
    31     : _classID(classID), _className(factoryName)
     30Factory::Factory (const NewClassID& classID)
     31    : _classID(classID)
    3232{
    33   this->registerObject(this, Factory::_objectList);
    34   this->setName(factoryName);
     33  printf("Factory::create(%s::%d)\n", classID.name().c_str(), classID.id());
     34  //this->registerObject(this, Factory::_objectList);
     35  this->setName(classID.name());
    3536
    3637  if( Factory::_factoryList == NULL)
     
    7980}
    8081
    81 /**
    82  * @brief Compares the Factories Name against a given ClassName
    83  * @param className the Name of the Class to Query
    84  * @returns true on match, false otherwise.
    85  */
    86 bool Factory::operator==(const char* className) const
    87 {
    88   return (className != NULL && this->_className == className);
    89 }
    9082
    9183/**
     
    9688bool Factory::operator==(const std::string& className) const
    9789{
    98   return (this->_className == className);
     90  return (this->_classID.name() == className);
    9991}
    10092
     
    143135}
    144136
    145 
    146137/**
    147138 * @brief Creates a new Object of type classID
     
    149140 * @returns a new Object of Type classID on match, NULL otherwise
    150141 */
    151 BaseObject* Factory::fabricate(int classID)
     142BaseObject* Factory::fabricate(const NewClassID& classID)
    152143{
    153144  if (Factory::_factoryList == NULL)
     
    157148  for (factory = Factory::_factoryList->begin(); factory != Factory::_factoryList->end(); factory++)
    158149    if (*(*factory) == classID)
    159     {
    160       PRINTF(4)("Create a new Object of type %s\n", (*factory)->getCName());
    161       return (*factory)->fabricateObject(NULL);
     150  {
     151    PRINTF(4)("Create a new Object of type %s\n", (*factory)->getCName());
     152    return (*factory)->fabricateObject(NULL);
    162153
    163     }
    164   PRINTF(2)("Could not Fabricate an Object of ClassID '0x%h'\n", classID);
     154  }
     155  PRINTF(2)("Could not Fabricate an Object of ClassID '%d'\n", classID.id());
    165156  return NULL;
    166157}
    167 
    168 
    169 /**
    170  * @brief Creates a new Object of type classID
    171  * @param classID the ClassID to match for the newly created Object
    172  * @returns a new Object of Type classID on match, NULL otherwise
    173  */
    174 BaseObject* Factory::fabricate(const NewClassID& classID)
    175 {
    176   return Factory::fabricate(classID.id());
    177 }
  • branches/new_class_id/src/lib/util/loading/factory.h

    r9691 r9709  
    2020
    2121
    22 #ifndef _FACTORY_H
    23 #define _FACTORY_H
     22#ifndef __FACTORY_H
     23#define __FACTORY_H
    2424
    2525class BaseObject;
     
    2727#include "parser/tinyxml/tinyxml.h"
    2828#include "base_object.h"
    29 #include <vector>
    3029#include <list>
    3130
     
    3433 * this should be used at the beginning of all the Classes that should be loadable (in the cc-file)
    3534 */
    36 #define CREATE_FACTORY(CLASS_NAME, CLASS_ID) \
    37     tFactory<CLASS_NAME>* global_##CLASS_NAME##_Factory = new tFactory<CLASS_NAME>(#CLASS_NAME, CLASS_ID)
     35#define CREATE_FACTORY(CLASS_NAME) \
     36    tFactory<CLASS_NAME>* global_##CLASS_NAME##_Factory = new tFactory<CLASS_NAME>(CLASS_NAME::classID())
    3837
    3938//! The Factory is a loadable object handler
     
    4847  static  BaseObject* fabricate(const std::string& className);
    4948  static  BaseObject* fabricate(const NewClassID& classID);
    50   static  BaseObject* fabricate(int classID);
    51   static  BaseObject* fabricate(const TiXmlElement* root = NULL);
     49  static  BaseObject* fabricate(const TiXmlElement* root);
    5250
    5351
    5452  bool operator==(int classID) const;
    55   bool operator==(const char* className) const;
    5653  bool operator==(const std::string& className) const;
     54  bool operator==(const NewClassID& classID) const { return _classID == classID; };
    5755
    5856protected:
    59   Factory (const std::string& factoryName, int classID);
     57  Factory (const NewClassID& id);
    6058  virtual BaseObject* fabricateObject(const TiXmlElement* root = NULL) const = 0;
    6159
     60private:
     61  Factory (const Factory&) {};
     62
    6263protected:
    63   const int                     _classID;              //!< The Class-Identifyer of the Factory.
    64   const std::string             _className;            //!< The name of the Class.
     64  const NewClassID              _classID;              //!< The Class-Identifyer of the Factory.
    6565  static std::list<Factory*>*   _factoryList;          //!< List of Registered Factories
    6666};
     
    7878   * @param classID the ID of the Class to be created.
    7979   */
    80   tFactory (const char* factoryName, int classID)
    81       : Factory(factoryName, classID)
     80  tFactory (const NewClassID& classID)
     81      : Factory(classID)
    8282  {  }
    8383
    8484private:
     85  tFactory (const tFactory&) {};
    8586  /**
    8687   * @brief fabricates an Object of type T, with the constructor T::T(const TiXmlElemnt*)
  • branches/new_class_id/src/lib/util/loading/fast_factory.h

    r9707 r9709  
    122122{
    123123public:
    124   static tFastFactory<T>* getFastFactory(const NewClassID& classID, const std::string& fastFactoryName = NULL);
     124  static tFastFactory<T>* getFastFactory(const NewClassID& classID, const std::string& fastFactoryName);
    125125
    126126private:
  • branches/new_class_id/src/orxonox.cc

    r9406 r9709  
    4646
    4747#include "util/loading/factory.h"
    48 #include "fast_factory.h"
     48#include "loading/fast_factory.h"
    4949
    5050#include "benchmark.h"
    5151
    52 #include "class_list.h"
    5352#include "shell_command_class.h"
    5453#include "shell_command.h"
     
    9796REGISTER_ARG_ARG(  _, write_dict,  "compression", "writedict",    "write packets to DATA/dicts/newdict",               "numBytes" );
    9897
     98NewObjectListDefinition(Orxonox);
    9999
    100100/**
     
    105105Orxonox::Orxonox ()
    106106{
    107   this->setClassID(CL_ORXONOX, "Orxonox");
     107  this->registerObject(this, Orxonox::_objectList);
    108108  this->setName("orxonox-main");
    109109
     
    146146
    147147  SDL_QuitSubSystem(SDL_INIT_TIMER);
    148   ClassList::debug();
     148
     149
     150  NewObjectListBase::debugAll(1);
    149151
    150152  Preferences::getInstance()->save();
  • branches/new_class_id/src/orxonox.h

    r7256 r9709  
    1616*/
    1717class Orxonox : public BaseObject {
     18  NewObjectListDeclaration(Orxonox);
    1819
    1920 public:
  • branches/new_class_id/src/story_entities/campaign.cc

    r9406 r9709  
    2727
    2828
     29NewObjectListDefinition(Campaign);
    2930
    3031/**
     
    3637Campaign::Campaign ( TiXmlElement* root)
    3738{
    38   this->setClassID(CL_CAMPAIGN, "Campaign");
     39  this->registerObject(this, Campaign::_objectList);
    3940
    4041  PRINTF(4)("Loading Campaign...\n");
  • branches/new_class_id/src/story_entities/campaign.h

    r6874 r9709  
    1818class Campaign : public StoryEntity
    1919{
    20 
     20  NewObjectListDeclaration(Campaign);
    2121  public:
    2222    Campaign( TiXmlElement* root);
  • branches/new_class_id/src/story_entities/campaign_data.cc

    r9406 r9709  
    2525
    2626
     27NewObjectListDefinition(CampaignData);
    2728
    2829/**
     
    3132CampaignData::CampaignData(const TiXmlElement* root)
    3233{
    33   this->setClassID(CL_CAMPAIGN_DATA, "CampaignData");
     34  this->registerObject(this, CampaignData::_objectList);
    3435
    3536  this->currentEntity = NULL;
  • branches/new_class_id/src/story_entities/campaign_data.h

    r7370 r9709  
    1616class CampaignData : public DataTank
    1717{
     18  NewObjectListDeclaration(CampaignData);
    1819
    1920public:
  • branches/new_class_id/src/story_entities/dedicated_server_world.cc

    r9406 r9709  
    2121
    2222#include "util/loading/load_param.h"
    23 #include "fast_factory.h"
     23#include "loading/fast_factory.h"
    2424#include "util/loading/factory.h"
    2525
  • branches/new_class_id/src/story_entities/game_world.cc

    r9494 r9709  
    2222#include "util/loading/resource_manager.h"
    2323#include "state.h"
    24 #include "class_list.h"
    2524
    2625#include "util/loading/game_loader.h"
     
    4039#include "util/loading/factory.h"
    4140#include "util/loading/load_param.h"
    42 #include "fast_factory.h"
     41#include "loading/fast_factory.h"
    4342#include "shell_command.h"
    4443
     
    6362
    6463#include "script_class.h"
    65 CREATE_SCRIPTABLE_CLASS(GameWorld, CL_GAME_WORLD,
     64NewObjectListDefinition(GameWorld);
     65CREATE_SCRIPTABLE_CLASS(GameWorld, GameWorld::classID(),
    6666                        addMethod("setPlaymode", ExecutorLua1<GameWorld,const std::string&>(&GameWorld::setPlaymode))
    6767                        ->addMethod("setSoundtrack", ExecutorLua1<GameWorld, const std::string&>(&GameWorld::setSoundtrack))
     
    7777
    7878
    79 
    8079GameWorld::GameWorld()
    8180    : StoryEntity()
    8281{
    83   this->setClassID(CL_GAME_WORLD, "GameWorld");
     82  this->registerObject(this, GameWorld::_objectList);
    8483  this->setName("Preloaded World - no name yet");
    8584
     
    432431    // TICK everything
    433432    for (i = 0; i < this->dataTank->tickLists.size(); ++i)
    434       this->tick(this->dataTank->objectManager->getObjectList(this->dataTank->tickLists[i]), this->dtS);
     433      this->tick(this->dataTank->objectManager->getEntityList(this->dataTank->tickLists[i]), this->dtS);
    435434
    436435    /* update tick the rest */
     
    471470{
    472471  // object-object collision detection
    473   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    474       this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
    475   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    476       this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ));
    477   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    478       this->dataTank->objectManager->getObjectList(OM_GROUP_00));
    479 
    480   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    481       this->dataTank->objectManager->getObjectList(OM_GROUP_02));
    482   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_02),
    483       this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
    484 
    485 
    486   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    487       this->dataTank->objectManager->getObjectList(OM_COMMON));
    488   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    489       this->dataTank->objectManager->getObjectList(OM_COMMON));
     472  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     473      this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
     474  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     475      this->dataTank->objectManager->getEntityList(OM_GROUP_00_PROJ));
     476  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     477      this->dataTank->objectManager->getEntityList(OM_GROUP_00));
     478
     479  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     480      this->dataTank->objectManager->getEntityList(OM_GROUP_02));
     481  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_02),
     482      this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
     483
     484
     485  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     486      this->dataTank->objectManager->getEntityList(OM_COMMON));
     487  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     488      this->dataTank->objectManager->getEntityList(OM_COMMON));
    490489
    491490  // ground collision detection: BSP Model
    492   CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_00));
    493   CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_01));
     491  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_00));
     492  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_01));
    494493}
    495494
     
    567566  //  glLoadIdentity();
    568567
    569   const std::list<BaseObject*>* reflectedWaters;
    570568  MappedWater* mw;
    571569
    572   if( (reflectedWaters = ClassList::getList(CL_MAPPED_WATER)) != NULL)
    573   {
    574     std::list<BaseObject*>::const_iterator it;
    575     for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++)
    576     {
    577       mw =  dynamic_cast<MappedWater*>(*it);
    578 
    579       //camera and light
    580       //this->dataTank->localCamera->apply ();
    581       //this->dataTank->localCamera->project ();
    582 
    583       LightManager::getInstance()->draw();
    584 
    585 
    586       // prepare for reflection rendering
    587       mw->activateReflection();
    588 
    589       // draw everything to be included in the reflection
    590       this->drawEntityList(State::getObjectManager()->getReflectionList());
    591       //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
    592       //         this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
    593 
    594       // clean up from reflection rendering
    595       mw->deactivateReflection();
    596     }
     570  for (NewObjectList<MappedWater>::const_iterator it = MappedWater::objectList().begin();
     571       it != MappedWater::objectList().end();
     572       ++it)
     573  {
     574    mw =  (*it);
     575
     576    //camera and light
     577    //this->dataTank->localCamera->apply ();
     578    //this->dataTank->localCamera->project ();
     579
     580    LightManager::getInstance()->draw();
     581
     582
     583    // prepare for reflection rendering
     584    mw->activateReflection();
     585
     586    // draw everything to be included in the reflection
     587    this->drawEntityList(State::getObjectManager()->getReflectionList());
     588    //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
     589    //         this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]));
     590
     591    // clean up from reflection rendering
     592    mw->deactivateReflection();
    597593  }
    598594
     
    609605  //glLoadIdentity();
    610606
    611   const std::list<BaseObject*>* reflectedWaters;
    612607  MappedWater* mw;
    613608
    614   if( (reflectedWaters = ClassList::getList(CL_MAPPED_WATER)) != NULL)
    615   {
    616     std::list<BaseObject*>::const_iterator it;
    617     for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++)
    618     {
    619       mw =  dynamic_cast<MappedWater*>(*it);
    620 
    621       //camera and light
    622       //this->dataTank->localCamera->apply ();
    623       //this->dataTank->localCamera->project ();
    624       // prepare for reflection rendering
    625       mw->activateRefraction();
    626 
    627 
    628       LightManager::getInstance()->draw();
    629       // draw everything to be included in the reflection
    630       this->drawEntityList(State::getObjectManager()->getReflectionList());
    631       //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
    632       //         this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
    633 
    634       // clean up from reflection rendering
    635       mw->deactivateRefraction();
    636     }
     609  for (NewObjectList<MappedWater>::const_iterator it = MappedWater::objectList().begin();
     610       it != MappedWater::objectList().end();
     611       ++it)
     612  {
     613    mw =  dynamic_cast<MappedWater*>(*it);
     614
     615    //camera and light
     616    //this->dataTank->localCamera->apply ();
     617    //this->dataTank->localCamera->project ();
     618    // prepare for reflection rendering
     619    mw->activateRefraction();
     620
     621
     622    LightManager::getInstance()->draw();
     623    // draw everything to be included in the reflection
     624    this->drawEntityList(State::getObjectManager()->getReflectionList());
     625    //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
     626    //         this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]));
     627
     628    // clean up from reflection rendering
     629    mw->deactivateRefraction();
    637630  }
    638631}
     
    659652  {
    660653    /* Draw the BackGround */
    661     this->drawEntityList(State::getObjectManager()->getObjectList(OM_BACKGROUND));
     654    this->drawEntityList(State::getObjectManager()->getEntityList(OM_BACKGROUND));
    662655    engine->drawBackgroundElements();
    663656
    664657    /* draw all WorldEntiy groups */
    665658    for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
    666       this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
     659      this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]));
    667660
    668661    AtmosphericEngine::getInstance()->draw();
     
    672665      CDEngine* engine = CDEngine::getInstance();
    673666      for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
    674         engine->drawBV(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]), this->showBVLevel);
     667        engine->drawBV(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]), this->showBVLevel);
    675668    }
    676669
  • branches/new_class_id/src/story_entities/game_world.h

    r9235 r9709  
    3131class GameWorld : public StoryEntity
    3232{
     33  NewObjectListDeclaration(GameWorld);
     34
    3335public:
    3436  GameWorld ();
  • branches/new_class_id/src/story_entities/game_world_data.cc

    r9406 r9709  
    2323#include "util/loading/resource_manager.h"
    2424#include "state.h"
    25 #include "class_list.h"
    2625#include "substring.h"
    2726
     
    4140
    4241#include "util/loading/factory.h"
    43 #include "fast_factory.h"
     42#include "loading/fast_factory.h"
    4443#include "util/loading/load_param.h"
    4544
    4645#include "graphics_engine.h"
     46#include "effects/graphics_effect.h"
    4747#include "effects/atmospheric_engine.h"
    4848#include "event_handler.h"
     
    6161
    6262
    63 
    64 
    65 
     63NewObjectListDefinition(GameWorldData);
    6664/**
    6765 * constructor of the GameWorldData
     
    6967GameWorldData::GameWorldData()
    7068{
    71   this->setClassID(CL_GAME_WORLD_DATA, "GameWorldData");
     69  this->registerObject(this, GameWorldData::_objectList);
    7270
    7371  this->glmis = NULL;
     
    215213
    216214      //todo do this more elegant
    217       if( element->Value() == "SkyBox" && created->isA(CL_SKYBOX))
     215      if( element->Value() == "SkyBox" && created->isA(SkyBox::classID()))
    218216      {
    219217        this->sky = dynamic_cast<WorldEntity*>(created);
    220218        State::setSkyBox(dynamic_cast<SkyBox*>(this->sky));
    221219      }
    222       if( element->Value() == "Terrain" && created->isA(CL_TERRAIN))
     220      if( element->Value() == "Terrain" && created->isA(Terrain::classID()))
    223221      {
    224222        this->terrain = dynamic_cast<Terrain*>(created);
     
    236234
    237235  Playable* playable;
    238   const std::list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
    239   if (playableList != NULL && !playableList->empty())
     236  if (!Playable::objectList().empty())
    240237  {
    241238    /// TODO Make this also loadable
    242     playable = dynamic_cast<Playable*>(playableList->front());
    243     this->localPlayer->setPlayable(playable);
     239    this->localPlayer->setPlayable(Playable::objectList().back());
    244240  }
    245241
     
    280276  GraphicsEngine::getInstance()->displayFPS(false);
    281277  // erease everything that is left.
    282   // delete PNode::getNullParent(); // not needed as this is also done in the next step (and also much cleaner)
    283   const std::list<BaseObject*>* nodeList;
    284278  //secondary cleanup of PNodes;
    285   nodeList = ClassList::getList(CL_PARENT_NODE);
    286   if (nodeList != NULL)
    287     while (!nodeList->empty())
    288     {
    289       //    ClassList::debug( 3, CL_PARENT_NODE);
    290       //    PNode::getNullParent()->debugNode(0);
    291       //    printf("%s::%s\n", nodeList->front()->getClassCName(), nodeList->front()->getName());
    292       delete nodeList->front();
    293     }
     279  while (!PNode::objectList().empty())
     280    delete PNode::objectList().front();
     281
    294282  /* remove the player object */
    295283  if( this->localPlayer)
     
    302290  this->terrain = NULL;
    303291
    304   nodeList = ClassList::getList(CL_GRAPHICS_EFFECT);
    305   if (nodeList != NULL)
    306     while (!nodeList->empty())
    307       delete nodeList->front();
    308 
    309 
    310   nodeList = ClassList::getList(CL_ELEMENT_2D);
    311   if (nodeList != NULL)
    312     while (!nodeList->empty())
    313       delete nodeList->front();
     292  while (!GraphicsEffect::objectList().empty())
     293    delete GraphicsEffect::objectList().front();
     294
     295
     296  while (!Element2D::objectList().empty())
     297    delete Element2D::objectList().front();
    314298
    315299  // At this Point all the WorldEntites should be unloaded.
     
    414398    PRINTF(2)("creating %s\n", element->Value());
    415399    BaseObject* created = Factory::fabricate(element);
    416     if (created != NULL && created->isA(CL_GAME_RULES))
     400    if (created != NULL && created->isA(GameRules::classID()))
    417401    {
    418402      this->gameRule = dynamic_cast<GameRules*>(created);
  • branches/new_class_id/src/story_entities/game_world_data.h

    r9406 r9709  
    3030class GameWorldData : public DataTank
    3131{
     32  NewObjectListDeclaration(GameWorldData);
    3233  public:
    3334    GameWorldData();
  • branches/new_class_id/src/story_entities/menu/game_menu.cc

    r9656 r9709  
    2222
    2323#include "state.h"
    24 #include "class_list.h"
    2524
    2625#include "util/loading/load_param.h"
     
    4342#include "preferences.h"
    4443
     44#include "class_id.h"
    4545//! This creates a Factory to fabricate a GameMenu
    46 CREATE_FACTORY(GameMenu, CL_GAME_MENU);
    47 
     46NewObjectListDefinitionID(GameMenu, CL_GAME_MENU);
     47CREATE_FACTORY(GameMenu);
    4848
    4949
     
    5151    : GameWorld()
    5252{
    53   this->setClassID(CL_GAME_MENU, "GameMenu");
     53  this->registerObject(this, GameMenu::_objectList);
    5454  this->setName("GameMenu uninitialized");
    5555
     
    191191      image->setForegroundColor(Color( 1,1,1,.6));
    192192
    193       const std::list<BaseObject*>* storyEntities = ClassList::getList(CL_STORY_ENTITY);
    194       std::list<BaseObject*>::const_iterator it;
    195193      bool first = true;
    196       for( it = storyEntities->begin(); it != storyEntities->end(); it++)
     194      for(NewObjectList<StoryEntity>::const_iterator it = StoryEntity::objectList().begin();
     195          it != StoryEntity::objectList().end();
     196          ++it)
    197197      {
    198         StoryEntity* se = dynamic_cast<StoryEntity*>(*it);
     198        StoryEntity* se = *it;
    199199        if( se->isContainedInMenu())
    200200        {
  • branches/new_class_id/src/story_entities/menu/game_menu.h

    r9406 r9709  
    2222class GameMenu : virtual public GameWorld, virtual public EventListener
    2323{
    24 
     24  NewObjectListDeclaration(GameMenu);
    2525  public:
    2626    GameMenu(const TiXmlElement* root = NULL);
     
    4545    void showMultiPlayer();
    4646    void showOptionsMenu();
    47    
     47
    4848    void showClientMenu();
    4949    void connectToServer();
    50    
     50
    5151    void showServerMenu();
    5252    void createMasterServer();
     
    6969    void setSelectorSound(const std::string& selectorSound);
    7070
    71    
     71
    7272
    7373
     
    7676    OrxGui::GLGuiBox*                 levelsBox;
    7777    OrxGui::GLGuiBox*                 networkBox;
    78    
     78
    7979    OrxGui::GLGuiBox*                 clientNetworkBox;
    8080    OrxGui::GLGuiInputLine*           ipInputLine;
    81    
     81
    8282    OrxGui::GLGuiBox*                 serverNetworkBox;
    8383
  • branches/new_class_id/src/story_entities/movie_loader.cc

    r9406 r9709  
    2525
    2626
    27 
    28 CREATE_FACTORY(MovieLoader, CL_MOVIE_LOADER);
     27#include "class_id.h"
     28NewObjectListDefinitionID(MovieLoader, CL_MOVIE_LOADER);
     29CREATE_FACTORY(MovieLoader);
    2930
    3031MovieLoader::MovieLoader(const TiXmlElement* root)
    3132{
    32   this->setClassID(CL_MOVIE_LOADER, "MovieLoader");
     33  this->registerObject(this, MovieLoader::_objectList);
    3334
    3435  movie_player = new MoviePlayer();
  • branches/new_class_id/src/story_entities/movie_loader.h

    r7221 r9709  
    1515class MovieLoader : public StoryEntity, virtual public EventListener
    1616{
     17  NewObjectListDeclaration(MovieLoader);
    1718  private:
    1819    MoviePlayer* movie_player;
  • branches/new_class_id/src/story_entities/multi_player_world.cc

    r9656 r9709  
    3636SHELL_COMMAND(debug, MultiPlayerWorld, debug);
    3737
    38 
     38#include "class_id.h"
    3939//! This creates a Factory to fabricate a MultiPlayerWorld
    40 CREATE_FACTORY(MultiPlayerWorld, CL_MULTI_PLAYER_WORLD);
    41 
     40NewObjectListDefinitionID(MultiPlayerWorld, CL_MULTI_PLAYER_WORLD);
     41CREATE_FACTORY(MultiPlayerWorld);
    4242
    4343MultiPlayerWorld::MultiPlayerWorld(const TiXmlElement* root)
    4444  : GameWorld()
    4545{
    46   this->setClassID(CL_MULTI_PLAYER_WORLD, "MultiPlayerWorld");
     46  this->registerObject(this, MultiPlayerWorld::_objectList);
    4747
    4848  this->dataTank = new MultiPlayerWorldData();
     
    9595void MultiPlayerWorld::collisionDetection()
    9696{
    97   //CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS), this->dataTank->objectManager->getObjectList(OM_PLAYERS));
     97  //CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS), this->dataTank->objectManager->getEntityList(OM_PLAYERS));
    9898
    9999  PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_GROUP_01_PROJ\n\n");
    100   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
    101     this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ));
     100  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS),
     101    this->dataTank->objectManager->getEntityList(OM_GROUP_00_PROJ));
    102102  PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_GROUP_01_PROJ\n\n");
    103   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
    104     this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
     103  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS),
     104    this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
    105105  PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_PLAYERS_PROJ\n\n");
    106   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
    107     this->dataTank->objectManager->getObjectList(OM_PLAYERS_PROJ));
     106  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS),
     107    this->dataTank->objectManager->getEntityList(OM_PLAYERS_PROJ));
    108108
    109   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    110   this->dataTank->objectManager->getObjectList(OM_PLAYERS));
    111   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    112   this->dataTank->objectManager->getObjectList(OM_PLAYERS));
     109  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     110  this->dataTank->objectManager->getEntityList(OM_PLAYERS));
     111  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     112  this->dataTank->objectManager->getEntityList(OM_PLAYERS));
    113113
    114114
    115115
    116116  PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_00 vs OM_GROUP_01_PROJ\n\n");
    117   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    118     this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
     117  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     118    this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
    119119  PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_00 vs OM_GROUP_01\n\n");
    120   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    121     this->dataTank->objectManager->getObjectList(OM_GROUP_01));
    122   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    123     this->dataTank->objectManager->getObjectList(OM_PLAYERS_PROJ));
     120  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     121    this->dataTank->objectManager->getEntityList(OM_GROUP_01));
     122  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     123    this->dataTank->objectManager->getEntityList(OM_PLAYERS_PROJ));
    124124
    125125  PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_01 vs OM_GROUP_00_PROJ\n\n");
    126   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    127     this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ));
    128   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    129     this->dataTank->objectManager->getObjectList(OM_GROUP_00));
    130   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    131     this->dataTank->objectManager->getObjectList(OM_PLAYERS_PROJ));
     126  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     127    this->dataTank->objectManager->getEntityList(OM_GROUP_00_PROJ));
     128  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     129    this->dataTank->objectManager->getEntityList(OM_GROUP_00));
     130  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     131    this->dataTank->objectManager->getEntityList(OM_PLAYERS_PROJ));
    132132
    133133
    134134
    135135    // ground collision detection: BSP Model
    136   CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_00));
    137   CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_01));
    138   CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_PLAYERS));
     136  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_00));
     137  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_01));
     138  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_PLAYERS));
    139139}
    140140
  • branches/new_class_id/src/story_entities/multi_player_world.h

    r8228 r9709  
    2020 */
    2121class MultiPlayerWorld : public GameWorld {
    22 
     22  NewObjectListDeclaration(MultiPlayerWorld);
    2323 public:
    2424  MultiPlayerWorld (const TiXmlElement* root = NULL);
     
    2626
    2727  virtual void loadParams(const TiXmlElement* root);
    28  
     28
    2929  virtual ErrorMessage unloadData();
    3030
  • branches/new_class_id/src/story_entities/multi_player_world_data.cc

    r9494 r9709  
    2020#include "util/loading/resource_manager.h"
    2121#include "state.h"
    22 #include "class_list.h"
    2322#include "substring.h"
    2423
     
    4039
    4140#include "util/loading/factory.h"
    42 #include "fast_factory.h"
     41#include "loading/fast_factory.h"
    4342#include "util/loading/load_param.h"
    4443
     
    5049
    5150#include "glmenu_imagescreen.h"
    52 
    53 
    54 
    55 
    5651
    5752
     
    313308{
    314309  PRINT(0)("==================================================\n");
     310
    315311  Playable* playable;
    316   const std::list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
    317   assert(playableList != NULL);
    318   std::list<BaseObject*>::const_iterator entity;
    319 
    320 
    321 
    322   for (entity = playableList->begin(); entity != playableList->end(); entity++)
    323   {
    324     Playable* p = dynamic_cast<Playable*>(*entity);
     312
     313  for (NewObjectList<Playable>::const_iterator entity = Playable::objectList().begin();
     314       entity != Playable::objectList().end();
     315      ++entity)
     316  {
     317    Playable* p = *entity;
    325318    PRINTF(0)("Got a playable, class: %s, name: %s, uid: %i\n", (*entity)->getClassCName(), (*entity)->getCName(), p->getUniqueID());
    326319  }
     
    329322  if( this->toggle)
    330323  {
    331     playable = dynamic_cast<Playable*>(playableList->front());
     324    playable = Playable::objectList().front();
    332325    this->localPlayer->setPlayable(playable);
    333326    this->toggle = !this->toggle;
     
    335328  else
    336329  {
    337     playable = dynamic_cast<Playable*>(playableList->back());
     330    playable = Playable::objectList().back();
    338331    this->localPlayer->setPlayable(playable);
    339332    this->toggle = !this->toggle;
  • branches/new_class_id/src/story_entities/single_player_world.cc

    r9406 r9709  
    2020
    2121#include "state.h"
    22 #include "class_list.h"
    2322
    2423#include "util/loading/load_param.h"
    25 #include "fast_factory.h"
     24#include "loading/fast_factory.h"
    2625#include "util/loading/factory.h"
    2726
     
    3029
    3130
    32 
    33 
    34 
     31#include "class_id.h"
    3532//! This creates a Factory to fabricate a SinglePlayerWorld
    36 CREATE_FACTORY(SinglePlayerWorld, CL_SINGLE_PLAYER_WORLD);
    37 
    38 
     33NewObjectListDefinitionID(SinglePlayerWorld, CL_SINGLE_PLAYER_WORLD);
     34CREATE_FACTORY(SinglePlayerWorld);
    3935
    4036SinglePlayerWorld::SinglePlayerWorld(const TiXmlElement* root)
    4137  : GameWorld()
    4238{
    43   this->setClassID(CL_SINGLE_PLAYER_WORLD, "SinglePlayerWorld");
     39  this->registerObject(this, SinglePlayerWorld::_objectList);
    4440  this->setName("SinglePlayerWorld uninitialized");
    4541
  • branches/new_class_id/src/story_entities/single_player_world.h

    r6512 r9709  
    2222class SinglePlayerWorld : public GameWorld
    2323{
     24  NewObjectListDeclaration(SinglePlayerWorld);
    2425
    2526  public:
  • branches/new_class_id/src/story_entities/story_entity.cc

    r9406 r9709  
    2727
    2828
    29 
     29NewObjectListDefinition(StoryEntity);
    3030
    3131/**
     
    3434StoryEntity::StoryEntity ()
    3535{
    36   this->setClassID(CL_STORY_ENTITY, "StoryEntity");
     36  this->registerObject(this, StoryEntity::_objectList);
    3737
    3838  this->bInit = false;
  • branches/new_class_id/src/story_entities/story_entity.h

    r8717 r9709  
    2626class StoryEntity : virtual public BaseObject
    2727{
     28  NewObjectListDeclaration(StoryEntity);
    2829
    2930public:
  • branches/new_class_id/src/subprojects/network/simple_sync.cc

    r7954 r9709  
    2323
    2424#include "class_id.h"
    25 #include "fast_factory.h"
     25#include "loading/fast_factory.h"
    2626#include "lib/util/loading/factory.h"
    2727
  • branches/new_class_id/src/util/Makefile.am

    r9494 r9709  
    44noinst_LIBRARIES = libORXutils.a
    55
    6 libORXutils_a_SOURCES = fast_factory.cc \
     6libORXutils_a_SOURCES = \
    77                        object_manager.cc \
    88                        state.cc \
     
    3131                        track/track_node.cc
    3232
    33 noinst_HEADERS =        fast_factory.h \
     33noinst_HEADERS =        \
    3434                        object_manager.h \
    3535                        state.h \
  • branches/new_class_id/src/util/kill_target.cc

    r9705 r9709  
    2323
    2424#include "class_id.h"
    25 CREATE_FACTORY(KillTarget, CL_KILL_TARGET);
    2625NewObjectListDefinitionID(KillTarget, CL_KILL_TARGET);
     26CREATE_FACTORY(KillTarget);
    2727
    2828
  • branches/new_class_id/src/util/multiplayer_team_deathmatch.cc

    r9705 r9709  
    5050#include "class_id.h"
    5151
    52 CREATE_FACTORY(MultiplayerTeamDeathmatch, CL_MULTIPLAYER_TEAM_DEATHMATCH);
    5352NewObjectListDefinitionID(MultiplayerTeamDeathmatch, CL_MULTIPLAYER_TEAM_DEATHMATCH);
     53CREATE_FACTORY(MultiplayerTeamDeathmatch);
    5454/**
    5555 * constructor
  • branches/new_class_id/src/util/singleplayer_shootemup.cc

    r9705 r9709  
    2626
    2727#include "class_id.h"
    28 CREATE_FACTORY(SingleplayerShootemup, CL_SINGLEPLAYER_SHOOTEMUP);
    2928NewObjectListDefinitionID(SingleplayerShootemup, CL_SINGLEPLAYER_SHOOTEMUP);
     29CREATE_FACTORY(SingleplayerShootemup);
    3030
    3131/**
  • 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.