Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

adapted many more classes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.