Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9869 in orxonox.OLD for trunk/src/util


Ignore:
Timestamp:
Oct 3, 2006, 12:19:30 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

Location:
trunk/src/util
Files:
2 deleted
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/Makefile.am

    r9494 r9869  
    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 \
  • trunk/src/util/animation/animation.cc

    r5777 r9869  
    2020#include "animation_player.h"
    2121
     22ObjectListDefinition(Animation);
    2223/**
    2324 *  creates a new Animation
     
    2728Animation::Animation()
    2829{
    29   this->setClassID(CL_ANIMATION, "Animation");
     30  this->registerObject(this, Animation::_objectList);
    3031
    3132  // initialize a beginning KeyFrame, that will be deleted afterwards
  • trunk/src/util/animation/animation.h

    r6222 r9869  
    7373class Animation : public BaseObject
    7474{
    75  public:
     75  ObjectListDeclaration(Animation);
     76public:
    7677  virtual ~Animation();
    7778
     
    9596  inline bool ifDelete() { return bDelete; };
    9697
    97  protected:
     98protected:
    9899  Animation();
    99100
    100101  void handleInfinity();
    101102
    102  protected:
     103protected:
    103104  // variables
    104105  float                 localTime;              //!< The Time passed since the beginning of the currentKeyFrame.
     
    119120class aTest
    120121{
    121  public:
     122public:
    122123  inline aTest() { last = 0.0;}
    123124  /** a little debug information to show the results of this class @param f new value */
    124125  inline void littleDebug(float f) {  diff = f - last; printf("f=%f, diff=%f\n", f,diff); last = f;}
    125  private:
     126private:
    126127  float     diff;           //!< difference from the last value
    127128  float     last;           //!< the last calculated value
  • trunk/src/util/animation/animation_player.cc

    r9406 r9869  
    2222
    2323
    24 
     24ObjectListDefinition(AnimationPlayer);
    2525/**
    2626 *  standard constructor
     
    2828AnimationPlayer::AnimationPlayer ()
    2929{
    30   this->setClassID(CL_ANIMATION_PLAYER, "AnimationPlayer");
     30  this->registerObject(this, AnimationPlayer::_objectList);
    3131  this->setName("AnimationPlayer");
    3232
  • trunk/src/util/animation/animation_player.h

    r5777 r9869  
    2828   eveything else will be done by the AnimationPlayer itself.\n
    2929*/
    30 class AnimationPlayer : public BaseObject {
     30class AnimationPlayer : public BaseObject
     31{
     32  ObjectListDeclaration(AnimationPlayer);
    3133
    32  public:
     34public:
    3335  /** @returns a Pointer to the only object of this Class */
    3436  inline static AnimationPlayer* getInstance() { if (!singletonRef) singletonRef = new AnimationPlayer();  return singletonRef; };
     
    5052  void debug();
    5153
    52  private:
     54private:
    5355  /* singleton */
    5456  AnimationPlayer();
  • trunk/src/util/game_rules.cc

    r9494 r9869  
    1717#include "game_rules.h"
    1818
    19 #include "util/loading/load_param.h"
     19#include "util/loading/load_param_xml.h"
    2020#include "util/loading/factory.h"
    2121
     
    2828
    2929
    30 
     30ObjectListDefinition(GameRules);
    3131
    3232/**
     
    3535GameRules::GameRules(const TiXmlElement* root)
    3636{
    37   this->setClassID(CL_GAME_RULES, "GameRules");
     37  this->registerObject(this, GameRules::_objectList);
    3838}
    3939
  • trunk/src/util/game_rules.h

    r9008 r9869  
    2323class GameRules : virtual public BaseObject
    2424{
     25  ObjectListDeclaration(GameRules);
    2526
    2627  public:
  • trunk/src/util/hud.cc

    r9406 r9869  
    3434#include "playable.h"
    3535
     36ObjectListDefinition(Hud);
    3637/**
    3738 * standard constructor
     
    4041Hud::Hud ()
    4142{
    42   this->setClassID(CL_HUD, "Hud");
     43  this->registerObject(this, Hud::_objectList);
    4344
    4445  //this->setSize2D(
     
    184185  if (State::getPlayer() && State::getPlayer()->getPlayable() && State::getObjectManager())
    185186  {
    186     printf("UPDATING RADAR\n");
     187    PRINTF(4)("UPDATING RADAR\n");
    187188    this->_radar->setCenterNode(State::getPlayer()->getPlayable());
    188     this->_radar->addEntityList(&State::getObjectManager()->getObjectList((OM_LIST)(State::getPlayer()->getPlayable()->getOMListNumber()+1)), Color(.4, .4, 1.0));
    189     this->_radar->addEntityList(&State::getObjectManager()->getObjectList(OM_GROUP_02), Color(1.0, .2, .2));
     189    this->_radar->addEntityList(&State::getObjectManager()->getEntityList((OM_LIST)(State::getPlayer()->getPlayable()->getOMListNumber()+1)), Color(.4, .4, 1.0));
     190    this->_radar->addEntityList(&State::getObjectManager()->getEntityList(OM_GROUP_02), Color(1.0, .2, .2));
    190191    this->_radar->setAbsCoor2D(0.8 * this->resX, 0.01 * this->resY);
    191192    this->_radar->setWidgetSize(0.2 * this->resX, 0.2 * this->resY);
  • trunk/src/util/hud.h

    r8995 r9869  
    2323class Hud : public Element2D, public EventListener
    2424{
     25  ObjectListDeclaration(Hud);
    2526
    2627public:
  • trunk/src/util/kill_target.cc

    r9406 r9869  
    2222
    2323
    24 
    25 CREATE_FACTORY(KillTarget, CL_KILL_TARGET);
     24#include "class_id_DEPRECATED.h"
     25ObjectListDefinitionID(KillTarget, CL_KILL_TARGET);
     26CREATE_FACTORY(KillTarget);
    2627
    2728
     
    3233KillTarget::KillTarget (const TiXmlElement* root)
    3334        : MissionGoal(root) {
    34     this->setClassID(CL_KILL_TARGET, "KillTarget");
     35  this->registerObject(this, KillTarget::_objectList);
    3536
    3637    if( root != NULL)
  • trunk/src/util/kill_target.h

    r7464 r9869  
    1717class KillTarget : public MissionGoal
    1818{
     19  ObjectListDeclaration(KillTarget);
    1920
    2021  public:
  • trunk/src/util/mission_goal.cc

    r9406 r9869  
    2424
    2525
    26 
     26ObjectListDefinition(MissionGoal);
    2727/**
    2828 * standard constructor
     
    3131MissionGoal::MissionGoal (const TiXmlElement* root)
    3232{
    33    this->setClassID(CL_MISSION_GOAL, "MissionGoal");
     33  this->registerObject(this, MissionGoal::_objectList);
    3434
    3535   this->missionState = MS_PASSIVE;
  • trunk/src/util/mission_goal.h

    r7464 r9869  
    2626//! A class representing a mission goal
    2727class MissionGoal : public BaseObject {
     28  ObjectListDeclaration(MissionGoal);
    2829
    2930 public:
  • trunk/src/util/multiplayer_team_deathmatch.cc

    r9656 r9869  
    2424#include "render2D/image_plane.h"
    2525#include "state.h"
    26 #include "class_list.h"
    2726
    2827#include "player.h"
     
    3332#include "shared_network_data.h"
    3433#include "terrain.h"
    35 #include "class_list.h"
    3634#include "space_ships/space_ship.h"
    3735
     
    5048
    5149
    52 
    53 
    54 CREATE_FACTORY(MultiplayerTeamDeathmatch, CL_MULTIPLAYER_TEAM_DEATHMATCH);
    55 
    56 
     50#include "class_id_DEPRECATED.h"
     51
     52ObjectListDefinitionID(MultiplayerTeamDeathmatch, CL_MULTIPLAYER_TEAM_DEATHMATCH);
     53CREATE_FACTORY(MultiplayerTeamDeathmatch);
    5754/**
    5855 * constructor
    5956 */
    6057MultiplayerTeamDeathmatch::MultiplayerTeamDeathmatch(const TiXmlElement* root)
    61   : NetworkGameRules(root)
    62 {
    63   this->setClassID(CL_MULTIPLAYER_TEAM_DEATHMATCH, "MultiplayerTeamDeathmatch");
     58    : NetworkGameRules(root)
     59{
     60  this->registerObject(this, MultiplayerTeamDeathmatch::_objectList);
    6461
    6562  this->bLocalPlayerDead = false;
     
    114111
    115112  LoadParam(root, "death-penalty-timeout", this, MultiplayerTeamDeathmatch, setDeathPenaltyTimeout)
    116       .describe("sets the time in seconds a player has to wait for respawn");
     113  .describe("sets the time in seconds a player has to wait for respawn");
    117114
    118115  LoadParam(root, "max-kills", this, MultiplayerTeamDeathmatch, setMaxKills)
    119       .describe("sets the maximal kills for winning condition");
     116  .describe("sets the maximal kills for winning condition");
    120117
    121118  LoadParam(root, "num-teams", this, MultiplayerTeamDeathmatch, setNumTeams)
    122       .describe("sets number of teams");
     119  .describe("sets number of teams");
    123120
    124121}
     
    192189  }
    193190
    194 //   if( PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() ) )
    195 //   {
    196 //     PRINTF(0)("prefered team id: %i, noteam: %i\n", PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() )->getPreferedTeamId(), TEAM_NOTEAM);
    197 //   }
     191  //   if( PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() ) )
     192  //   {
     193  //     PRINTF(0)("prefered team id: %i, noteam: %i\n", PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() )->getPreferedTeamId(), TEAM_NOTEAM);
     194  //   }
    198195
    199196  // check if the menu should be removed and the game state should be entered
     
    273270  if( unlikely( this->bLocalPlayerDead))
    274271  {
    275 
    276272  }
    277273}
     
    308304{
    309305  if ( team == TEAM_NOTEAM || team == TEAM_SPECTATOR )
    310     return CL_SPECTATOR;
     306    return ObjectListBase::retrieveIdentity("Spectator");
    311307
    312308  if ( team == 0 || team == 1 )
    313     return CL_TURBINE_HOVER;
     309    return ObjectListBase::retrieveIdentity("TurbineHover");
    314310
    315311  assert( false );
     
    317313
    318314
    319 std::string MultiplayerTeamDeathmatch::getPlayableModelFileName( int userId, int team, ClassID classId )
     315std::string MultiplayerTeamDeathmatch::getPlayableModelFileName( int userId, int team, const ClassID& classId )
    320316{
    321317  if (classId == CL_TURBINE_HOVER)
    322    return "models/ships/hoverglider_mainbody.obj";
     318    return "models/ships/hoverglider_mainbody.obj";
    323319  if ( team == 0 )
    324320    return "models/creatures/doom_guy.md2";
     
    329325}
    330326
    331 std::string MultiplayerTeamDeathmatch::getPlayableModelTextureFileName( int userId, int team, ClassID classId )
     327std::string MultiplayerTeamDeathmatch::getPlayableModelTextureFileName( int userId, int team, const ClassID& classId )
    332328{
    333329  if ( classId == CL_FPS_PLAYER )
     
    342338}
    343339
    344 float MultiplayerTeamDeathmatch::getPlayableScale( int userId, int team, ClassID classId )
    345 {
    346   if ( classId == CL_FPS_PLAYER )
     340float MultiplayerTeamDeathmatch::getPlayableScale( int userId, int team, const ClassID& classId )
     341{
     342  if ( classId == ObjectListBase::retrieveIdentity(CL_FPS_PLAYER))
    347343  {
    348344    return 10.0f;
     
    362358    teamScore[i] = 0;
    363359
    364 
    365   const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS );
    366 
    367   if ( !list )
    368     return;
    369 
    370   for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
    371   {
    372     PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it);
     360  for (ObjectList<PlayerStats>::const_iterator it = PlayerStats::objectList().begin();
     361       it != PlayerStats::objectList().end();
     362       ++it)
     363  {
     364    PlayerStats & stats = *(*it);
    373365
    374366    if ( stats.getTeamId() >= 0 )
     
    390382    playersInTeam[i] = 0;
    391383
    392   const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS );
    393 
    394   if ( !list )
    395     return 0;
    396 
    397   for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
    398   {
    399     PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it);
     384  for (ObjectList<PlayerStats>::const_iterator it = PlayerStats::objectList().begin();
     385       it != PlayerStats::objectList().end();
     386       ++it)
     387  {
     388    PlayerStats & stats = *(*it);
    400389
    401390    if ( stats.getTeamId() >= 0 )
     
    453442void MultiplayerTeamDeathmatch::handleTeamChanges( )
    454443{
    455   const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS );
    456 
    457   if ( !list )
    458     return;
    459 
    460   //first server players with choices
    461   for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
    462   {
    463     PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it);
     444  for (ObjectList<PlayerStats>::const_iterator it = PlayerStats::objectList().begin();
     445       it != PlayerStats::objectList().end();
     446       ++it)
     447  {
     448    PlayerStats & stats = *(*it);
    464449
    465450    if ( stats.getTeamId() != stats.getPreferedTeamId() )
     
    473458
    474459  //now serve player who want join a random team
    475   for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
    476   {
    477     PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it);
     460  for (ObjectList<PlayerStats>::const_iterator it = PlayerStats::objectList().begin();
     461       it != PlayerStats::objectList().end();
     462       ++it)
     463  {
     464    PlayerStats & stats = *(*it);
    478465
    479466    if ( stats.getTeamId() != stats.getPreferedTeamId() )
     
    587574    if ( event.bPressed )
    588575      this->bShowTeamChange = true;
    589   } else if ( event.type == SDLK_F1 )
     576  }
     577  else if ( event.type == SDLK_F1 )
    590578  {
    591579    if ( this->statsBox && !this->bLocalPlayerDead && event.bPressed )
     
    683671void MultiplayerTeamDeathmatch::hideStats( )
    684672{
    685     if ( statsBox )
    686     {
    687       delete statsBox;
    688       statsBox = NULL;
    689     }
     673  if ( statsBox )
     674  {
     675    delete statsBox;
     676    statsBox = NULL;
     677  }
    690678}
    691679
     
    822810void MultiplayerTeamDeathmatch::respawnPlayable( Playable * playable, int teamId, float delay )
    823811{
    824   const std::list<BaseObject*> * list = ClassList::getList( CL_SPAWNING_POINT );
    825 
    826   assert( list );
    827812
    828813  std::vector<SpawningPoint*> spList;
    829814
    830   for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
    831   {
    832     SpawningPoint * sp = dynamic_cast<SpawningPoint*>(*it);
     815  for (ObjectList<SpawningPoint>::const_iterator it = SpawningPoint::objectList().begin();
     816       it != SpawningPoint::objectList().end();
     817       ++it)
     818  {
     819    SpawningPoint * sp = (*it);
    833820
    834821    if ( sp->getTeamId() == teamId )
     
    838825  if ( spList.size() == 0 )
    839826  {
    840     for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
    841     {
    842       SpawningPoint * sp = dynamic_cast<SpawningPoint*>(*it);
     827    for (ObjectList<SpawningPoint>::const_iterator it = SpawningPoint::objectList().begin();
     828         it != SpawningPoint::objectList().end();
     829         ++it)
     830    {
     831      SpawningPoint * sp = (*it);
    843832
    844833      if ( sp->getTeamId() < 0 )
  • trunk/src/util/multiplayer_team_deathmatch.h

    r9235 r9869  
    3030class MultiplayerTeamDeathmatch : public NetworkGameRules, public EventListener
    3131{
     32  ObjectListDeclaration(MultiplayerTeamDeathmatch);
    3233
    3334  public:
     
    3940    virtual int getTeamForNewUser();
    4041    virtual ClassID getPlayableClassId( int userId, int team );
    41     virtual std::string getPlayableModelTextureFileName( int userId, int team, ClassID classId );
    42     virtual std::string getPlayableModelFileName( int userId, int team, ClassID classId );
    43     virtual float getPlayableScale( int userId, int team, ClassID classId );
     42    virtual std::string getPlayableModelTextureFileName( int userId, int team, const ClassID& classId );
     43    virtual std::string getPlayableModelFileName( int userId, int team, const ClassID& classId );
     44    virtual float getPlayableScale( int userId, int team, const ClassID& classId );
    4445
    4546    virtual void registerSpawn( WorldEntity * we );
     
    5051    inline void setDeathPenaltyTimeout(float time) { this->deathTimeout = time; }
    5152    inline void setMaxKills(int kills) { this->maxKills = kills; }
    52    
     53
    5354    inline void setNumTeams( int numTeams ){ this->numTeams = numTeams; }
    5455    inline int getNumTeams(){ return this->numTeams; }
    55    
     56
    5657    int getRandomTeam();
    57    
     58
    5859    virtual void process(const Event &event);
    59    
     60
    6061    void onKill( WorldEntity * victim, WorldEntity * killer );
    6162    void onRespawn( int userId );
    62    
     63
    6364    virtual void handleChatMessage( int userId, const std::string & message, int messageType );
    64    
     65
    6566    void respawnPlayable( Playable * playable, int teamId, float delay );
    6667
     
    8485
    8586    OrxGui::GLGuiBox* box;
    86    
     87
    8788    OrxGui::GLGuiInputLine* input;
    88    
     89
    8990    void calculateTeamScore();
    9091    void nextGameState();
     
    9293    void teamChange( int userId );
    9394    void assignPlayable();
    94    
     95
    9596    void onButtonSpectator();
    9697    void onButtonRandom();
     
    99100    void onButtonCancel();
    100101    void onButtonExit();
    101    
     102
    102103    void onInputEnter( const std::string & text );
    103    
     104
    104105    OrxGui::GLGuiBox* statsBox;
    105106    OrxGui::GLGuiTable* table;
    106107    void tickStatsTable();
    107    
     108
    108109    void showStats();
    109110    void hideStats();
  • trunk/src/util/network_game_rules.cc

    r9406 r9869  
    2222
    2323
     24ObjectListDefinition(NetworkGameRules);
    2425
    2526/**
     
    2728 */
    2829NetworkGameRules::NetworkGameRules ( const TiXmlElement* root )
    29   : GameRules( root )
     30    : GameRules( root )
    3031{
    31   this->setClassID( CL_NETWORK_GAME_RULES, "NetworkGameRules");
     32  this->registerObject(this, NetworkGameRules::_objectList);
    3233}
    3334
     
    3738 */
    3839NetworkGameRules::~NetworkGameRules ()
    39 {
    40 }
     40{}
    4141
    4242
    43 std::string NetworkGameRules::getPlayableModelTextureFileName( int userId, int team, ClassID classId )
     43std::string NetworkGameRules::getPlayableModelTextureFileName( int userId, int team, const ClassID& classId )
    4444{
    4545  return "";
    4646}
    4747
    48 std::string NetworkGameRules::getPlayableModelFileName( int uesrId, int team, ClassID classId )
     48std::string NetworkGameRules::getPlayableModelFileName( int uesrId, int team, const ClassID& classId )
    4949{
    5050  return "models/ships/reap_#.obj";
     
    5353ClassID NetworkGameRules::getPlayableClassId( int userId, int team )
    5454{
    55   return CL_SPACE_SHIP;
     55  const ObjectListBase* objList = ObjectListBase::getObjectList("SpaceShip");
     56  if (objList != NULL)
     57    return objList->identity();
     58  else
     59    return ClassID();
    5660}
    5761
     
    6872
    6973
    70 float NetworkGameRules::getPlayableScale( int userId, int team, ClassID classId )
     74float NetworkGameRules::getPlayableScale( int userId, int team, const ClassID& classId )
    7175{
    7276  return 1.0f;
  • trunk/src/util/network_game_rules.h

    r9235 r9869  
    1515class NetworkGameRules : public GameRules
    1616{
     17  ObjectListDeclaration(NetworkGameRules);
    1718
    1819  public:
    1920    NetworkGameRules( const TiXmlElement* root );
    2021    virtual ~NetworkGameRules();
    21    
     22
    2223    virtual int getTeamForNewUser();
    2324    virtual ClassID getPlayableClassId( int userId, int team );
    24     virtual std::string getPlayableModelFileName( int userId, int team, ClassID classId );
    25     virtual std::string getPlayableModelTextureFileName( int userId, int team, ClassID classId );
    26     virtual float getPlayableScale( int userId, int team, ClassID classId );
    27    
     25    virtual std::string getPlayableModelFileName( int userId, int team, const ClassID& classId );
     26    virtual std::string getPlayableModelTextureFileName( int userId, int team, const ClassID& classId );
     27    virtual float getPlayableScale( int userId, int team, const ClassID& classId );
     28
    2829    virtual PlayerStats * getNewPlayerStats( int userId ){ return new PlayerStats( userId ); }
    29    
     30
    3031    virtual void handleChatMessage( int userId, const std::string & message, int messageType ) = 0;
    31    
     32
    3233    void shellSay( const std::string & message );
    3334
  • trunk/src/util/object_manager.cc

    r9656 r9869  
    1717
    1818#include "object_manager.h"
    19 #include "class_list.h"
    2019
    2120#include "world_entity.h"
     
    3029    ->defaultValues("", 0);
    3130
     31ObjectListDefinition(ObjectManager);
    3232/**
    3333 * @brief standard constructor
     
    3535ObjectManager::ObjectManager ()
    3636{
    37    this->setClassID(CL_OBJECT_MANAGER, "ObjectManager");
     37  this->registerObject(this, ObjectManager::_objectList);
    3838   this->setName("ObjectManager");
    3939
     
    6363{
    6464  for (unsigned int i = 0; i < OM_SIZE; ++i)
    65     while(!this->objectLists[i].empty())
    66       delete this->objectLists[i].front();
     65    while(!this->entityLists[i].empty())
     66      delete this->entityLists[i].front();
    6767
    6868  // delete reflection list
     
    8383
    8484  if (likely(entity->getOMListNumber() != OM_INIT))
    85     this->objectLists[entity->getOMListNumber()].erase(entity->getEntityIterator());
     85    this->entityLists[entity->getOMListNumber()].erase(entity->getEntityIterator());
    8686
    8787  if (likely(omList != OM_INIT))
    8888  {
    89     this->objectLists[omList].push_back(entity);
    90     entity->getEntityIterator() = --this->objectLists[omList].end();
     89    this->entityLists[omList].push_back(entity);
     90    entity->getEntityIterator() = --this->entityLists[omList].end();
    9191    entity->getOMListNumber() = omList;
    9292  }
     
    111111 * @returns a new List with a list of WorldEntities of distance Radius from center
    112112 */
    113 void ObjectManager::distanceFromObject(EntityList& entities, const PNode& center, float radius, ClassID classID)
    114 {
    115   const std::list<BaseObject*>* objectList = ClassList::getList(classID);
    116   if (objectList != NULL)
     113  /*
     114void ObjectManager::distanceFromObject(EntityList& entities, const PNode& center, float radius, const ClassID& classID)
     115{
     116  TODO FIXME
     117
     118  const std::list<BaseObject*>* entityList = ClassList::getList(classID);
     119  if (entityList != NULL)
    117120  {
    118121
    119122    std::list<BaseObject*>::const_iterator node;
    120     for (node = objectList->begin(); node != objectList->end(); node++)
     123    for (node = entityList->begin(); node != entityList->end(); node++)
    121124      if ((dynamic_cast<PNode*>(*node)->getAbsCoor() - center.getAbsCoor()).len() < radius)
    122125        entities.push_back(dynamic_cast<WorldEntity*>(*node));
    123126  }
    124127}
     128  */
    125129
    126130
     
    134138  if (omList != OM_INIT || omList == OM_SIZE)
    135139  {
    136     PRINT(0)(" +ObjectManager-LIST: '%s'==size='%d'==---\n", ObjectManager::OMListToString((OM_LIST)omList).c_str(), this->objectLists[omList].size());
     140    PRINT(0)(" +ObjectManager-LIST: '%s'==size='%d'==---\n", ObjectManager::OMListToString((OM_LIST)omList).c_str(), this->entityLists[omList].size());
    137141  //  if (level >= 1)
    138142    {
    139143      ObjectManager::EntityList::const_iterator entity;
    140       for (entity = this->objectLists[omList].begin(); entity != this->objectLists[omList].end(); entity++)
     144      for (entity = this->entityLists[omList].begin(); entity != this->entityLists[omList].end(); entity++)
    141145      {
    142146        PRINT(0)(" | %s::%s\n",(*entity)->getClassCName(), (*entity)->getCName());
  • trunk/src/util/object_manager.h

    r9656 r9869  
    7373class ObjectManager : public BaseObject
    7474{
     75  ObjectListDeclaration(ObjectManager);
    7576public:
    7677  typedef std::list<WorldEntity*> EntityList;      //!< A type definition to make it easy to use EntityLists.
     
    8687
    8788  /** @returns the List (listnumber) of objects. @param listNumber the List to get. */
    88   EntityList& getObjectList(OM_LIST listNumber) { return this->objectLists[listNumber]; }
     89  EntityList& getEntityList(OM_LIST listNumber) { return this->entityLists[listNumber]; }
    8990  /** @returns a constant LIST of Objects. @param listNumber the objectList to returns */
    90   const EntityList& getObjectList(OM_LIST listNumber) const { return this->objectLists[listNumber]; }
     91  const EntityList& getEntityList(OM_LIST listNumber) const { return this->entityLists[listNumber]; }
    9192
    92   static void distanceFromObject(EntityList& entities, const PNode& center, float radius, ClassID classID);
     93  template <class T> static void distanceFromObject(EntityList& entities, const PNode& center, float radius, ObjectList<T>& list);
    9394
    9495  void debug(OM_LIST omList, unsigned int level = 0) const;
     
    111112  const std::list<BaseObject>*            pNodeList;                //!< The List of PNodes.
    112113
    113   EntityList                              objectLists[OM_SIZE];     //!< The ObjectLists.
     114  EntityList                              entityLists[OM_SIZE];     //!< The ObjectLists.
    114115
    115116  static const std::string                objectManagerListNames[]; //!< Names of all the lists
  • trunk/src/util/singleplayer_shootemup.cc

    r9406 r9869  
    2525
    2626
    27 
    28 CREATE_FACTORY(SingleplayerShootemup, CL_SINGLEPLAYER_SHOOTEMUP);
    29 
    30 
     27#include "class_id_DEPRECATED.h"
     28ObjectListDefinitionID(SingleplayerShootemup, CL_SINGLEPLAYER_SHOOTEMUP);
     29CREATE_FACTORY(SingleplayerShootemup);
    3130
    3231/**
     
    3635  : GameRules(root)
    3736{
    38   this->setClassID(CL_SINGLEPLAYER_SHOOTEMUP, "SingleplayerShootemup");
     37  this->registerObject(this, SingleplayerShootemup::_objectList);
    3938
    4039  if( root != NULL)
  • trunk/src/util/singleplayer_shootemup.h

    r7464 r9869  
    1818class SingleplayerShootemup : public GameRules
    1919{
    20 
     20  ObjectListDeclaration(SingleplayerShootemup);
    2121  public:
    2222    SingleplayerShootemup(const TiXmlElement* root = NULL);
  • trunk/src/util/track/pilot_node.cc

    r7868 r9869  
    2424
    2525
     26ObjectListDefinition(PilotNode);
    2627/**
    2728 *  standard constructor
     
    2930PilotNode::PilotNode ()
    3031{
    31    this->setClassID(CL_PILOT_PARENT, "PilotNode");
     32  this->registerObject(this, PilotNode::_objectList);
    3233   this->setName("PilotNode");
    3334
  • trunk/src/util/track/pilot_node.h

    r5039 r9869  
    1515//! The PilotNode is a node that enables the is driven by the Mouse
    1616class PilotNode : public WorldEntity, public EventListener {
     17  ObjectListDeclaration(PilotNode);
    1718
    1819 public:
  • trunk/src/util/track/track_node.cc

    r9406 r9869  
    2222
    2323
    24 
     24ObjectListDefinition(TracNode);
    2525/**
    2626 *  standard constructor
     
    2828TrackNode::TrackNode ()
    2929{
    30   this->setClassID(CL_TRACK_NODE, "TrackNode");
     30  this->registerObject(this, TracNode::_objectList);
    3131  this->setName("TrackNode");
    3232
  • trunk/src/util/track/track_node.h

    r5405 r9869  
    1 /*! 
     1/*!
    22 * @file track_node.h
    33  *  Definition of the TrackNode are located here
    4    
    5     the TrackNode is the node, that follows the Track (and the TrackManager) 
     4
     5    the TrackNode is the node, that follows the Track (and the TrackManager)
    66    through the level.
    7     Under normal confitions the Plyaer(s) are 
     7    Under normal confitions the Plyaer(s) are
    88*/
    99
     
    1818
    1919//! A node that follows the track.
    20 class TrackNode : public PNode 
     20class TrackNode : public PNode
    2121{
    22 
     22  ObjectListDeclaratrion(TracNode);
    2323 public:
    2424  TrackNode ();
Note: See TracChangeset for help on using the changeset viewer.