Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9869 in orxonox.OLD for trunk/src/world_entities/spawning_point.cc


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..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/spawning_point.cc

    r9656 r9869  
    2222#include "world_entity.h"
    2323
    24 #include "class_list.h"
    25 
    2624#include "compiler.h"
    2725
     
    3533#include "converter.h"
    3634
    37 CREATE_FACTORY( SpawningPoint, CL_SPAWNING_POINT );
    38 
     35#include "class_id_DEPRECATED.h"
     36ObjectListDefinitionID(SpawningPoint, CL_SPAWNING_POINT);
     37CREATE_FACTORY( SpawningPoint);
    3938/**
    4039 *  constructor
     
    5251void SpawningPoint::init()
    5352{
    54   this->setClassID(CL_SPAWNING_POINT, "SpawningPoint");
     53  this->registerObject(this, SpawningPoint::_objectList);
    5554  PRINTF(0)("Created SpawningPoint\n");
    5655
     
    8483  /* load teamId */
    8584  LoadParam(root, "teamId", this, SpawningPoint, setTeamId)
    86       .describe("sets teamId");
     85  .describe("sets teamId");
    8786}
    8887
     
    108107void SpawningPoint::spawn(Playable* entity)
    109108{
    110   const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYABLE );
    111 
    112109  bool found = false;
    113110
    114   if ( !list )
    115     return;
    116 
    117   for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
     111  for (ObjectList<Playable>::const_iterator it = Playable::objectList().begin();
     112       it != Playable::objectList().end();
     113       ++it)
    118114  {
    119115    if ( *it == entity )
     
    162158      this->spawn(it->entity);
    163159
    164       const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYABLE );
    165 
    166160      bool found = false;
    167161
    168       if ( !list )
    169         return;
    170 
    171       for ( std::list<BaseObject*>::const_iterator it2 = list->begin(); it2 != list->end(); it2++ )
     162      for (ObjectList<Playable>::const_iterator it2 = Playable::objectList().begin();
     163           it2 != Playable::objectList().end();
     164           ++it2)
    172165      {
    173166        if ( *it2 == it->entity )
     
    202195 */
    203196void SpawningPoint::draw() const
    204 {
    205 }
     197{}
    206198
    207199void SpawningPoint::sendRespawnMessage( int uniqueId )
     
    243235  Playable      * playable = NULL;
    244236
    245   const std::list<BaseObject*> * list = ClassList::getList( CL_SPAWNING_POINT );
    246 
    247   if ( list )
    248   {
    249     for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
    250     {
    251       PRINTF(0)("%d:%d\n", dynamic_cast<SpawningPoint*>(*it)->getUniqueID(), spUniqueId);
    252       if ( dynamic_cast<SpawningPoint*>(*it)->getUniqueID() == spUniqueId )
    253       {
    254         sp = dynamic_cast<SpawningPoint*>(*it);
    255         break;
    256       }
     237  for (ObjectList<SpawningPoint>::const_iterator it = SpawningPoint::objectList().begin();
     238       it != SpawningPoint::objectList().end();
     239       ++it)
     240  {
     241    PRINTF(0)("%d:%d\n", (*it)->getUniqueID(), spUniqueId);
     242    if ( (*it)->getUniqueID() == spUniqueId )
     243    {
     244      sp = (*it);
     245      break;
    257246    }
    258247  }
     
    264253  }
    265254
    266   list = ClassList::getList( CL_PLAYABLE );
    267 
    268   if ( list )
    269   {
    270     for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
    271     {
    272       if ( dynamic_cast<Playable*>(*it)->getUniqueID() == uniqueId )
    273       {
    274         playable = dynamic_cast<Playable*>(*it);
    275         break;
    276       }
     255  for (ObjectList<Playable>::const_iterator it = Playable::objectList().begin();
     256       it != Playable::objectList().end();
     257       ++it)
     258  {
     259    if ( (*it)->getUniqueID() == uniqueId )
     260    {
     261      playable = (*it);
     262      break;
    277263    }
    278264  }
Note: See TracChangeset for help on using the changeset viewer.