Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Aug 25, 2006, 9:44:53 PM (18 years ago)
Author:
bensch
Message:

adapted many more classes

Location:
branches/new_class_id/src/world_entities
Files:
29 edited

Legend:

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

    r9406 r9705  
    1919#include "glincl.h"
    2020
     21NewObjectListDefinition(Camera);
     22
    2123/**
    2224 *  creates a Camera
     
    2426Camera::Camera()
    2527{
    26   this->setClassID(CL_CAMERA, "Camera");
     28  this->registerObject(this, Camera::_objectList);
    2729  this->setName("camera");
    2830  this->target = new CameraTarget();
     
    221223///////////////////
    222224
    223 
     225NewObjectListDefinition(CameraTarget);
    224226CameraTarget::CameraTarget()
    225227{
    226   this->setClassID(CL_CAMERA_TARGET, "CameraTarget");
     228  this->registerObject(this, CameraTarget::_objectList);
    227229  //  this->setParentMode(PNODE_MOVEMENT);
    228230}
  • branches/new_class_id/src/world_entities/camera.h

    r7347 r9705  
    2222class Camera : public PNode, public EventListener
    2323{
     24  NewObjectListDeclaration(Camera);
    2425public:
    2526  //! an enumerator for different types of view
     
    8485{
    8586  friend class Camera;             //! The CameraTarget is a friend of Camera. noone else needs a CameraTarget, so noone else can create it.
     87  NewObjectListDeclaration(CameraTarget);
    8688
    8789private:
  • branches/new_class_id/src/world_entities/npcs/npc.cc

    r9235 r9705  
    2020#include "npc.h"
    2121
     22NewObjectListDefinition(NPC);
    2223
    2324NPC::NPC(const TiXmlElement* root)
    2425{
    25   this->setClassID(CL_NPC, "NPC");
     26  this->registerObject(this, NPC::_objectList);
    2627
    2728  this->toList(OM_GROUP_00);
  • branches/new_class_id/src/world_entities/npcs/npc.h

    r8724 r9705  
    88
    99class NPC : public WorldEntity {
    10 
     10  NewObjectListDeclaration(NPC);
    1111 public:
    1212   NPC (const TiXmlElement* root);
  • branches/new_class_id/src/world_entities/npcs/npc_test1.cc

    r9235 r9705  
    2525#include "power_ups/laser_power_up.h"
    2626
     27NewObjectListDefinition(NPCTest1);
    2728
    2829NPCTest1::NPCTest1()
    2930  : NPC(NULL)
    3031{
    31   this->setClassID(CL_NPC_TEST1, "NPCTest1");
     32  this->registerObject(this, NPCTest1::_objectList);
    3233
    3334  if ((float)rand()/RAND_MAX > .5f)
  • branches/new_class_id/src/world_entities/npcs/npc_test1.h

    r6981 r9705  
    88
    99class NPCTest1 : public NPC {
    10 
     10  NewObjectListDeclaration(NPCTest1);
    1111 public:
    1212  NPCTest1 ();
  • branches/new_class_id/src/world_entities/playable.cc

    r9691 r9705  
    4141SHELL_COMMAND_STATIC(orxoWeapon, Playable, Playable::addSomeWeapons_CHEAT)
    4242  ->setAlias("orxoWeapon");
    43 NewObjectListDefinition(Playable)
     43NewObjectListDefinition(Playable);
    4444
    4545Playable::Playable()
     
    4848    playmode(Playable::Full3D)
    4949{
    50   this->registerObject(this, Playable::_classID);
     50  this->registerObject(this, Playable::_objectList);
    5151  PRINTF(4)("PLAYABLE INIT\n");
    5252
     
    109109bool Playable::pickup(PowerUp* powerUp)
    110110{
    111   if(powerUp->isA(CL_WEAPON_POWER_UP))
    112   {
    113     return dynamic_cast<WeaponPowerUp*>(powerUp)->process(&this->getWeaponManager());
    114   }
    115   else if(powerUp->isA(CL_PARAM_POWER_UP))
    116   {
    117     ParamPowerUp* ppu = dynamic_cast<ParamPowerUp*>(powerUp);
     111  /// FIXME TOTALLY
     112  if(powerUp->isA(WeaponPowerUp::classID()))
     113  {
     114    return static_cast<WeaponPowerUp*>(powerUp)->process(&this->getWeaponManager());
     115  }
     116  else if(powerUp->isA(ParamPowerUp::classID()))
     117  {
     118    ParamPowerUp* ppu = static_cast<ParamPowerUp*>(powerUp);
    118119    switch(ppu->getType())
    119120    {
     
    213214    {
    214215      PRINTF(2)("ADDING WEAPONS - you cheater\n");
    215       playable->addWeapon(Weapon::createWeapon(CL_HYPERBLASTER));
    216       playable->addWeapon(Weapon::createWeapon(CL_TURRET));
    217       playable->addWeapon(Weapon::createWeapon(CL_AIMING_TURRET));
    218       playable->addWeapon(Weapon::createWeapon(CL_CANNON));
    219       playable->addWeapon(Weapon::createWeapon(CL_TARGETING_TURRET));
     216      playable->addWeapon(Weapon::createWeapon("Hyperblaster"));
     217      playable->addWeapon(Weapon::createWeapon("Turret"));
     218      playable->addWeapon(Weapon::createWeapon("AimingTurret"));
     219      playable->addWeapon(Weapon::createWeapon("Cannon"));
     220      playable->addWeapon(Weapon::createWeapon("TargetingTurret"));
    220221      PRINTF(2)("ADDING WEAPONS FINISHED\n");
    221222    }
  • branches/new_class_id/src/world_entities/player.cc

    r9062 r9705  
    1919#include "event_handler.h"
    2020
    21 
    22 #include "class_list.h"
    2321#include "state.h"
    2422#include "util/hud.h"
     
    2624#include "debug.h"
    2725
    28 
     26NewObjectListDefinition(Player);
    2927/**
    3028 * creates a new Player
     
    3331{
    3432  //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
    35   this->setClassID(CL_PLAYER, "Player");
     33  this->registerObject(this, Player::_objectList);
    3634
    3735  PRINTF(4)("PLAYER INIT\n");
     
    9492
    9593
    96  void Player::weaponConfigChanged()
    97  {
    98    this->_hud.updateWeaponManager();
    99  }
     94void Player::weaponConfigChanged()
     95{
     96  this->_hud.updateWeaponManager();
     97}
    10098
    10199
     
    103101{
    104102  /// FIXME this should be in the ObjectManager
    105   const std::list<BaseObject*>* objectList = ClassList::getList(CL_PLAYABLE);
    106   if (objectList != NULL)
     103  for (NewObjectList<Playable>::const_iterator node = Playable::objectList().begin();
     104       node != Playable::objectList().end();
     105       ++node)
    107106  {
    108     std::list<BaseObject*>::const_iterator node;
    109     for (node = objectList->begin(); node != objectList->end(); node++)
    110       if (this->playable != (*node) &&
    111           (dynamic_cast<PNode*>(*node)->getAbsCoor() - this->playable->getAbsCoor()).len() < (dynamic_cast<Playable*>(*node)->getEnterRadius()))
    112       {
     107    if (this->playable != (*node) &&
     108        ((*node)->getAbsCoor() - this->playable->getAbsCoor()).len() < ((*node)->getEnterRadius()))
     109    {
    113110
    114         this->setPlayable(dynamic_cast<Playable*>(*node));
     111      this->setPlayable(*(node));
    115112
    116         break;
    117       }
     113      break;
     114    }
    118115  }
    119116}
  • branches/new_class_id/src/world_entities/player.h

    r9061 r9705  
    2323class Player : public EventListener
    2424{
     25  NewObjectListDeclaration(Player);
    2526
    2627  public:
     
    3132    bool              eject();
    3233    inline Playable*  getPlayable() const  { return this->playable; };
    33    
     34
    3435
    3536     inline Hud& hud() { return this->_hud; };
  • branches/new_class_id/src/world_entities/power_ups/param_power_up.cc

    r9656 r9705  
    2727
    2828
    29 
     29#include "class_id.h"
    3030CREATE_FACTORY(ParamPowerUp, CL_PARAM_POWER_UP);
     31NewObjectListDefinitionID(ParamPowerUp, CL_PARAM_POWER_UP);
    3132
    3233const char* ParamPowerUp::paramTypes[] = {
     
    5859void ParamPowerUp::init()
    5960{
    60   this->setClassID(CL_PARAM_POWER_UP, "ParamPowerUp");
     61  this->registerObject(this, ParamPowerUp::_objectList);
    6162  this->value = 0;
    6263  this->max_value = 0;
  • branches/new_class_id/src/world_entities/power_ups/param_power_up.h

    r7954 r9705  
    2020
    2121class ParamPowerUp : public PowerUp {
     22  NewObjectListDeclaration(ParamPowerUp);
    2223
    2324public:
  • branches/new_class_id/src/world_entities/power_ups/power_up.cc

    r9406 r9705  
    2525
    2626
     27NewObjectListDefinition(PowerUp);
    2728
    2829PowerUp::PowerUp(float r, float g, float b)
    2930{
    30   this->setClassID(CL_POWER_UP, "PowerUp");
     31  this->registerObject(this, PowerUp::_objectList);
    3132
    3233  this->respawnType = RESPAWN_TIME;
     
    120121void PowerUp::collidesWith (WorldEntity* entity, const Vector& location)
    121122{
    122   if(this->collider != entity && entity->isA(CL_EXTENDABLE))
     123  if(this->collider != entity && entity->isA(Extendable::classID()))
    123124  {
    124125    this->collider = entity;
  • branches/new_class_id/src/world_entities/power_ups/power_up.h

    r7954 r9705  
    2121
    2222class PowerUp : public WorldEntity {
     23  NewObjectListDeclaration(PowerUp);
    2324
    2425public:
  • branches/new_class_id/src/world_entities/power_ups/weapon_power_up.cc

    r9406 r9705  
    2727
    2828
    29 
     29#include "class_id.h"
    3030CREATE_FACTORY(WeaponPowerUp, CL_WEAPON_POWER_UP);
     31NewObjectListDefinitionID(WeaponPowerUp, CL_WEAPON_POWER_UP);
    3132
    3233WeaponPowerUp::WeaponPowerUp(const TiXmlElement* root) : PowerUp(1.0, 1.0, 0.0)
     
    4546void WeaponPowerUp::init()
    4647{
    47   this->setClassID(CL_WEAPON_POWER_UP, "WeaponPowerUp");
     48  this->registerObject(this, WeaponPowerUp::_objectList);
    4849  this->loadPickupSound("sound/powerups/whats this2.wav");
    4950
  • branches/new_class_id/src/world_entities/power_ups/weapon_power_up.h

    r7954 r9705  
    1414
    1515class WeaponPowerUp : public PowerUp {
    16 
     16NewObjectListDeclaration(WeaponPowerUp);
    1717public:
    1818  WeaponPowerUp(const TiXmlElement* root = NULL);
  • branches/new_class_id/src/world_entities/projectiles/projectile.cc

    r9656 r9705  
    2626#include "debug.h"
    2727
     28NewObjectListDefinition(Projectile);
    2829
    2930/**
     
    3233Projectile::Projectile () : WorldEntity()
    3334{
    34   this->setClassID(CL_PROJECTILE, "Projectile");
     35  this->registerObject(this, Projectile::_objectList);
    3536
    3637  this->lifeCycle = 0.0;
  • branches/new_class_id/src/world_entities/projectiles/projectile.h

    r9235 r9705  
    1818class Projectile : public WorldEntity
    1919{
     20  NewObjectListDeclaration(Projectile);
    2021  public:
    2122    Projectile ();
  • branches/new_class_id/src/world_entities/spawning_point.cc

    r9656 r9705  
    2121
    2222#include "world_entity.h"
    23 
    24 #include "class_list.h"
    2523
    2624#include "compiler.h"
  • branches/new_class_id/src/world_entities/spawning_point.h

    r9656 r9705  
    4242 */
    4343class SpawningPoint : public WorldEntity {
    44 
     44  NewObjectListDeclaration(SpawningPoint);
    4545  public:
    4646    SpawningPoint(const TiXmlElement* root = NULL);
  • branches/new_class_id/src/world_entities/weapons/ammo_container.cc

    r9406 r9705  
    2323
    2424
    25 
     25NewObjectListDefinition(AmmoContainer);
    2626/**
    2727 * standard constructor
    2828 * @todo this constructor is not jet implemented - do it
    2929*/
    30 AmmoContainer::AmmoContainer (ClassID projectileType, float maxEnergy)
     30AmmoContainer::AmmoContainer (const NewClassID& projectileType, float maxEnergy)
    3131{
    32    this->setClassID(CL_AMMO_CONTAINER, "AmmoContainer");
     32  this->registerObject(this, AmmoContainer::_objectList);
    3333
    34    this->projectileType = projectileType;
    35    this->maxEnergy = maxEnergy;
     34  this->projectileType = projectileType;
     35  this->maxEnergy = maxEnergy;
    3636
    37    this->energy = 0.0;
     37  this->energy = 0.0;
    3838}
    3939
  • branches/new_class_id/src/world_entities/weapons/ammo_container.h

    r9685 r9705  
    1717//! A class for Storing energy of Projectiles.
    1818class AmmoContainer : public BaseObject {
     19  NewObjectListDeclaration(AmmoContainer);
    1920
    2021 public:
    21   AmmoContainer(NewClassID id, float maxEnergy = DEFAULT_MAX_ENERGY);
     22  AmmoContainer(const NewClassID& id, float maxEnergy = DEFAULT_MAX_ENERGY);
    2223  virtual ~AmmoContainer();
    2324
  • branches/new_class_id/src/world_entities/weapons/crosshair.cc

    r9406 r9705  
    2626
    2727
    28 
     28NewObjectListDefinition(Crosshair);
    2929/**
    3030 * standart constructor
     
    5454void Crosshair::init()
    5555{
    56   this->setClassID(CL_CROSSHAIR, "Crosshair");
     56  this->registerObject(this, Crosshair::_objectList);
    5757  this->setName("Crosshair");
    5858
  • branches/new_class_id/src/world_entities/weapons/crosshair.h

    r7221 r9705  
    2222//! A class that enables the
    2323class Crosshair : public PNode, public Element2D, public EventListener {
    24 
     24  NewObjectListDeclaration(Crosshair);
    2525 public:
    2626  Crosshair(const TiXmlElement* root = NULL);
  • branches/new_class_id/src/world_entities/weapons/weapon.cc

    r9406 r9705  
    2525
    2626#include "util/loading/resource_manager.h"
    27 #include "class_list.h"
    2827#include "util/loading/factory.h"
    2928#include "util/loading/load_param.h"
     
    3635#include "elements/glgui_energywidget.h"
    3736
    38 
     37NewObjectListDefinition(Weapon);
    3938
    4039////////////////////
     
    5857{
    5958  for (int i = 0; i < WS_STATE_COUNT; i++)
    60     if (this->animation[i] && ClassList::exists(animation[i], CL_ANIMATION))  //!< @todo this should check animation3D
     59    if (this->animation[i] && Animation::objectList().exists(animation[i]))  //!< @todo this should check animation3D
    6160      delete this->animation[i];
    6261  for (int i = 0; i < WA_ACTION_COUNT; i++)
    63     if (this->soundBuffers[i] != NULL && ClassList::exists(this->soundBuffers[i], CL_SOUND_BUFFER))
     62    if (this->soundBuffers[i] != NULL && OrxSound::SoundBuffer::objectList().exists(this->soundBuffers[i]))
    6463      ResourceManager::getInstance()->unload(this->soundBuffers[i]);
    6564
    66   if (ClassList::exists(this->soundSource, CL_SOUND_SOURCE))
     65  if (OrxSound::SoundSource::objectList().exists(this->soundSource))
    6766    delete this->soundSource;
    6867}
     
    7372 * @returns the newly created Weapon.
    7473 */
    75 Weapon* Weapon::createWeapon(ClassID weaponID)
     74Weapon* Weapon::createWeapon(const NewClassID& weaponID)
    7675{
    7776  BaseObject* createdObject = Factory::fabricate(weaponID);
    7877  if (createdObject != NULL)
    7978  {
    80     if (createdObject->isA(CL_WEAPON))
     79    if (createdObject->isA(Weapon::classID()))
    8180      return dynamic_cast<Weapon*>(createdObject);
    8281    else
     
    8988}
    9089
     90Weapon* Weapon::createWeapon(const std::string& weaponName)
     91{
     92  BaseObject* createdObject = Factory::fabricate(weaponName);
     93  if (createdObject != NULL)
     94  {
     95    if (createdObject->isA(Weapon::classID()))
     96      return dynamic_cast<Weapon*>(createdObject);
     97    else
     98    {
     99      delete createdObject;
     100      return NULL;
     101    }
     102  }
     103  return NULL;
     104}
     105
     106
    91107/**
    92108 * initializes the Weapon with ALL default values
     
    96112void Weapon::init()
    97113{
    98   this->setClassID(CL_WEAPON, "Weapon");
     114  this->registerObject(this, Weapon::_objectList);
    99115  this->currentState     = WS_INACTIVE;            //< Normaly the Weapon is Inactive
    100116  this->requestedAction  = WA_NONE;                //< No action is requested by default
     
    115131  this->defaultTarget = NULL;                      //< Nothing is Targeted by default.
    116132
    117   this->projectile = CL_NULL;                      //< No Projectile Class is Connected to this weapon
     133  this->projectile = NullClass::classID();         //< No Projectile Class is Connected to this weapon
    118134  this->projectileFactory = NULL;                  //< No Factory generating Projectiles is selected.
    119135
     
    163179 * What it does, is telling the Weapon what Projectiles it can Emit.
    164180 */
    165 void Weapon::setProjectileType(ClassID projectile)
    166 {
    167   if (projectile == CL_NULL)
    168     return;
     181void Weapon::setProjectileType(const NewClassID& projectile)
     182{
    169183  this->projectile = projectile;
    170184  this->projectileFactory = FastFactory::searchFastFactory(projectile);
  • branches/new_class_id/src/world_entities/weapons/weapon.h

    r9685 r9705  
    8383class Weapon : public WorldEntity
    8484{
     85  NewObjectListDeclaration(Weapon);
     86
    8587  public:
    8688    // INITIALISATION //
    8789    Weapon ();
    8890    virtual ~Weapon ();
    89     static Weapon* createWeapon(NewClassID weaponID);
     91    static Weapon* createWeapon(const NewClassID& weaponID);
     92    static Weapon* createWeapon(const std::string& weaponName);
    9093
    9194    void init();
     
    110113    /** @returns the Capabilities of this Weapon */
    111114    inline long getCapability() const { return this->capability; };
    112     void setProjectileType(NewClassID projectile);
     115    void setProjectileType(const NewClassID& projectile);
    113116    void setProjectileTypeC(const std::string& projectile);
    114117    /** @returns The projectile's classID */
  • branches/new_class_id/src/world_entities/weapons/weapon_manager.cc

    r9406 r9705  
    2222#include "weapon.h"
    2323#include "crosshair.h"
    24 #include "class_list.h"
    2524
    2625#include "playable.h"
     
    3231
    3332
     33NewObjectListDefinition(WeaponManager);
    3434/**
    3535 * @brief this initializes the weaponManager for a given nnumber of weapon slots
     
    5757  // crosshair being a PNode it must not be deleted (this is because PNodes delete themselves.)
    5858  // rennerc: crosshair seems not to delete itselve
    59   if (ClassList::exists(this->crosshair, CL_CROSSHAIR))
     59  if (Crosshair::objectList().exists(this->crosshair))
    6060    delete this->crosshair;
    6161}
     
    6666void WeaponManager::init()
    6767{
    68   this->setClassID(CL_WEAPON_MANAGER, "WeaponManager");
     68  this->registerObject(this, WeaponManager::_objectList);
    6969
    7070  this->parentNode = NULL;
     
    298298  {
    299299    this->parentNode->addChild(weapon);
    300     if (this->parentEntity->isA(CL_PLAYABLE))
     300    if (this->parentEntity->isA(Playable::classID()))
    301301      dynamic_cast<Playable*>(this->parentEntity)->weaponConfigChanged();
    302302    weapon->setDefaultTarget(this->crosshair);
     
    311311 * @param ammo the ammo to increase
    312312 */
    313 float WeaponManager::increaseAmmunition(ClassID projectileType, float ammo)
     313float WeaponManager::increaseAmmunition(const NewClassID& projectileType, float ammo)
    314314{
    315315  return this->getAmmoContainer(projectileType)->increaseEnergy(ammo);
     
    324324{
    325325  assert (weapon != NULL);
    326   return this->increaseAmmunition(weapon->getLeafClassID(), ammo);
     326  return this->increaseAmmunition(weapon->getClassID(), ammo);
    327327
    328328}
     
    468468      else
    469469        this->currentSlotConfig[i].position.deactivateNode();
    470       if (this->parentEntity != NULL && this->parentEntity->isA(CL_PLAYABLE))
     470      if (this->parentEntity != NULL && this->parentEntity->isA(Playable::classID()))
    471471        dynamic_cast<Playable*>(this->parentEntity)->weaponConfigChanged();
    472472    }
     
    523523}
    524524
    525 CountPointer<AmmoContainer>& WeaponManager::getAmmoContainer(ClassID projectileType)
     525CountPointer<AmmoContainer>& WeaponManager::getAmmoContainer(const NewClassID& projectileType)
    526526{
    527527  for (unsigned int i = 0; i < this->ammo.size(); i++)
     
    537537{
    538538  assert (weapon != NULL);
    539   return (this->getAmmoContainer(weapon->getLeafClassID()));
     539  return (this->getAmmoContainer(weapon->getClassID()));
    540540}
    541541
  • branches/new_class_id/src/world_entities/weapons/weapon_manager.h

    r9685 r9705  
    3939 */
    4040class WeaponManager : public BaseObject {
     41  NewObjectListDeclaration(WeaponManager);
    4142
    4243  //! an enumerator defining a Slot, where a Weapon can be stored inside.
     
    8990    void changeWeaponConfig(int weaponConfig);
    9091
    91     float increaseAmmunition(NewClassID projectileType, float ammo);
     92    float increaseAmmunition(const NewClassID& projectileType, float ammo);
    9293    float inclreaseAmmunition(const Weapon* weapon, float ammo);
    9394
     
    106107 // private:
    107108    int getNextFreeSlot(int configID, long capability = WTYPE_ALL);
    108     CountPointer<AmmoContainer>& getAmmoContainer(NewClassID projectileType);
     109    CountPointer<AmmoContainer>& getAmmoContainer(const NewClassID& projectileType);
    109110    CountPointer<AmmoContainer>& getAmmoContainer(const Weapon* weapon);
    110111
  • branches/new_class_id/src/world_entities/world_entity.cc

    r9656 r9705  
    4747SHELL_COMMAND(debugEntity, WorldEntity, debugWE);
    4848
     49
     50NewObjectListDefinition(WorldEntity);
    4951/**
    5052 *  Loads the WordEntity-specific Part of any derived Class
     
    5658    : Synchronizeable()
    5759{
    58   this->setClassID(CL_WORLD_ENTITY, "WorldEntity");
     60  this->registerObject(this, WorldEntity::_objectList);
    5961
    6062  this->obbTree = NULL;
     
    8183
    8284  // registering default reactions:
    83   this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, /*CL_WORLD_ENTITY*/ CL_PROJECTILE);
     85/// FIXME  this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, /*CL_WORLD_ENTITY*/ CL_PROJECTILE);
    8486
    8587  this->toList(OM_NULL);
     
    197199        PRINTF(1)("OBJ-File %s not found.\n", fileName.c_str());
    198200
    199       if( modelNumber == 0 && !this->isA(CL_WEAPON))
     201      if( modelNumber == 0 /* FIXME && !this->isA(CL_WEAPON) */)
    200202        this->buildObbTree(obbTreeDepth);
    201203    }
     
    300302 *  @param target1 a filter target (classID)
    301303 */
    302 void WorldEntity::subscribeReaction(CREngine::CRType type, long target1)
     304void WorldEntity::subscribeReaction(CREngine::CRType type, const NewClassID& target1)
    303305{
    304306  this->subscribeReaction(type);
     
    314316 *  @param target1 a filter target (classID)
    315317 */
    316 void WorldEntity::subscribeReaction(CREngine::CRType type, long target1, long target2)
     318void WorldEntity::subscribeReaction(CREngine::CRType type, const NewClassID& target1, const NewClassID& target2)
    317319{
    318320  this->subscribeReaction(type);
     
    329331 *  @param target1 a filter target (classID)
    330332 */
    331 void WorldEntity::subscribeReaction(CREngine::CRType type, long target1, long target2, long target3)
     333void WorldEntity::subscribeReaction(CREngine::CRType type, const NewClassID& target1, const NewClassID& target2, const NewClassID& target3)
    332334{
    333335  this->subscribeReaction(type);
     
    345347 *  @param target1 a filter target (classID)
    346348 */
    347 void WorldEntity::subscribeReaction(CREngine::CRType type, long target1, long target2, long target3, long target4)
     349void WorldEntity::subscribeReaction(CREngine::CRType type, const NewClassID& target1, const NewClassID& target2, const NewClassID& target3, const NewClassID& target4)
    348350{
    349351  this->subscribeReaction(type);
  • branches/new_class_id/src/world_entities/world_entity.h

    r9656 r9705  
    3737
    3838
     39
    3940//! Basis-class all interactive stuff in the world is derived from
    4041class WorldEntity : public PNode
    4142{
     43  NewObjectListDeclaration(WorldEntity);
    4244public:
    4345  WorldEntity();
     
    4951  void loadModel2(const std::string& fileN, float scal = 1.0f){this->loadModel(fileN,scal,0,4);}
    5052  void setModel(Model* model, unsigned int modelNumber = 0);
    51   Model* getModel(unsigned int modelNumber = 0) const { return (this->models.size() > modelNumber)? this->models[modelNumber] : NULL; };
     53Model* getModel(unsigned int modelNumber = 0) const { return (this->models.size() > modelNumber)? this->models[modelNumber] : NULL; };
    5254
    5355  inline void loadMD2Texture(const std::string& fileName) { this->md2TextureFileName = fileName; }
     
    7375
    7476
    75 /** @returns a reference to the obb tree of this worldentity */
     77  /** @returns a reference to the obb tree of this worldentity */
    7678  inline BVTree* getOBBTree() const { return this->obbTree; };
    7779  inline void setOBBTree(OBBTree* tree) { /*if( this->obbTree != NULL) delete this->obbTree;*/ this->obbTree = (BVTree*)tree; }
     
    8183  /* --- Collision Reaction Block --- */
    8284  void subscribeReaction(CREngine::CRType type);
    83   void subscribeReaction(CREngine::CRType type, long target1);
    84   void subscribeReaction(CREngine::CRType type, long target1, long target2);
    85   void subscribeReaction(CREngine::CRType type, long target1, long target2, long target3);
    86   void subscribeReaction(CREngine::CRType type, long target1, long target2, long target3, long target4);
     85  void subscribeReaction(CREngine::CRType type, const NewClassID& target1);
     86  void subscribeReaction(CREngine::CRType type, const NewClassID& target1, const NewClassID& target2);
     87  void subscribeReaction(CREngine::CRType type, const NewClassID& target1, const NewClassID& target2, const NewClassID& target3);
     88  void subscribeReaction(CREngine::CRType type, const NewClassID& target1, const NewClassID& target2, const NewClassID& target3, const NewClassID& target4);
    8789
    8890  void unsubscribeReaction(CREngine::CRType type);
     
    126128
    127129  void hide() { if( this->objectListNumber != OM_DEAD) this->lastObjectListNumber = this->objectListNumber; this->toList(OM_DEAD); }
    128   void unhide() { if( this->objectListNumber != this->lastObjectListNumber) this->toList(this->lastObjectListNumber); }
     130void unhide() { if( this->objectListNumber != this->lastObjectListNumber) this->toList(this->lastObjectListNumber); }
    129131
    130132
    131133  /* --- Character Attribute Block --- */
    132134  /** @returns the scaling of the model */
    133   float getScaling(){return this->scaling;}
     135float getScaling(){return this->scaling;}
    134136  /** @returns the damage dealt by this world entity */
    135137  float getDamage() const { return this->damage; }
     
    216218  bool                    bOnGround;                       //!< true if this entity is standing on the ground
    217219
    218   protected:
     220protected:
    219221  Vector                  velocity;                        //!< speed of the entity
    220222
Note: See TracChangeset for help on using the changeset viewer.