Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9869 in orxonox.OLD for trunk/src/world_entities/npcs/door.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/npcs/door.cc

    r9406 r9869  
    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_DEPRECATED.h"
     29ObjectListDefinitionID(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 (ObjectList<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 (ObjectList<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());
Note: See TracChangeset for help on using the changeset viewer.