Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5779 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Nov 26, 2005, 2:20:58 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: ClassList is now in std::list style
ShellCommand is now in std::list style

Location:
trunk/src/world_entities/weapons
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/weapons/aim.cc

    r5750 r5779  
    8181
    8282  this->text = new Text();
     83  this->text->setLayer(this->getLayer());
    8384  this->text->setParent2D(this);
    8485  this->text->setRelCoor2D(10, -50);
  • trunk/src/world_entities/weapons/guided_missile.cc

    r5772 r5779  
    6666
    6767  /* this is normaly done by World.cc by deleting the ParticleEngine */
    68   if (GuidedMissile::trailParticles != NULL && ClassList::getList(CL_TEST_BULLET)->getSize() <= 1)
     68  if (GuidedMissile::trailParticles != NULL && ClassList::getList(CL_TEST_BULLET)->size() <= 1)
    6969  {
    7070    if (ClassList::exists(GuidedMissile::trailParticles, CL_PARTICLE_SYSTEM))
     
    7272    GuidedMissile::trailParticles = NULL;
    7373  }
    74   if (GuidedMissile::explosionParticles != NULL && ClassList::getList(CL_TEST_BULLET)->getSize() <= 1)
     74  if (GuidedMissile::explosionParticles != NULL && ClassList::getList(CL_TEST_BULLET)->size() <= 1)
    7575  {
    7676    if (ClassList::exists(GuidedMissile::explosionParticles, CL_PARTICLE_SYSTEM))
  • trunk/src/world_entities/weapons/laser.cc

    r5769 r5779  
    6363
    6464  /* this is normaly done by World.cc by deleting the ParticleEngine */
    65   if (Laser::explosionParticles != NULL && ClassList::getList(CL_LASER)->getSize() <= 1)
     65  if (Laser::explosionParticles != NULL && ClassList::getList(CL_LASER)->size() <= 1)
    6666  {
    6767    //if (ClassList::exists(Laser::explosionParticles, CL_PARTICLE_SYSTEM))
  • trunk/src/world_entities/weapons/rocket.cc

    r5769 r5779  
    6262
    6363  /* this is normaly done by World.cc by deleting the ParticleEngine */
    64   if (Rocket::trailParticles != NULL && ClassList::getList(CL_TEST_BULLET)->getSize() <= 1)
     64  if (Rocket::trailParticles != NULL && ClassList::getList(CL_TEST_BULLET)->size() <= 1)
    6565  {
    6666    if (ClassList::exists(Rocket::trailParticles, CL_PARTICLE_SYSTEM))
     
    6868    Rocket::trailParticles = NULL;
    6969  }
    70   if (Rocket::explosionParticles != NULL && ClassList::getList(CL_TEST_BULLET)->getSize() <= 1)
     70  if (Rocket::explosionParticles != NULL && ClassList::getList(CL_TEST_BULLET)->size() <= 1)
    7171  {
    7272    if (ClassList::exists(Rocket::explosionParticles, CL_PARTICLE_SYSTEM))
  • trunk/src/world_entities/weapons/test_bullet.cc

    r5769 r5779  
    6262
    6363  /* this is normaly done by World.cc by deleting the ParticleEngine */
    64   if (TestBullet::trailParticles != NULL && ClassList::getList(CL_TEST_BULLET)->getSize() <= 1)
     64  if (TestBullet::trailParticles != NULL && ClassList::getList(CL_TEST_BULLET)->size() <= 1)
    6565  {
    6666    if (ClassList::exists(TestBullet::trailParticles, CL_PARTICLE_SYSTEM))
     
    6868    TestBullet::trailParticles = NULL;
    6969  }
    70   if (TestBullet::explosionParticles != NULL && ClassList::getList(CL_TEST_BULLET)->getSize() <= 1)
     70  if (TestBullet::explosionParticles != NULL && ClassList::getList(CL_TEST_BULLET)->size() <= 1)
    7171  {
    7272    if (ClassList::exists(TestBullet::explosionParticles, CL_PARTICLE_SYSTEM))
  • trunk/src/world_entities/weapons/weapon_manager.cc

    r5750 r5779  
    347347   if (this->targetIterator == NULL)
    348348   {
    349      tList<BaseObject>* npcList = ClassList::getList(CL_NPC);
     349     std::list<BaseObject*>* npcList = ClassList::getList(CL_NPC);
    350350     if (npcList != NULL)
    351351     {
    352        this->targetIterator = npcList->getIterator();
    353        this->targetIterator->firstElement();
     352       this->targetIterator = npcList->begin();
    354353     }
    355354     else
     
    357356   }
    358357
    359    PNode* retNode = dynamic_cast<PNode*>(targetIterator->nextElement());
    360    if (retNode == NULL && this->targetIterator->getList()->getSize() > 0)
    361      retNode =  dynamic_cast<PNode*>(targetIterator->firstElement());
     358   ///FIXME
     359//   this->targetIterator++;
     360   PNode* retNode = dynamic_cast<PNode*>((*targetIterator));
     361//   if (retNode == NULL && this->targetIterator->getList()->getSize() > 0)
     362//     retNode =  dynamic_cast<PNode*>(targetIterator->firstElement());
    362363
    363364   return retNode;
     
    372373PNode* WeaponManager::getDistanceTarget(const PNode* carrier, float distance)
    373374{
    374   tList<BaseObject>* npcList = ClassList::getList(CL_NPC);
     375  std::list<BaseObject*>* npcList = ClassList::getList(CL_NPC);
    375376  if (npcList != NULL)
    376377  {
    377     tIterator<BaseObject>* npcIT = npcList->getIterator();
    378     PNode* tmpNPC = dynamic_cast<PNode*>(npcIT->firstElement());
    379     while (tmpNPC != NULL)
    380     {
    381       if ((carrier->getAbsCoor() - tmpNPC->getAbsCoor()).len() < distance)
    382       {
    383         delete npcIT;
    384         return tmpNPC;
    385       }
    386       tmpNPC = dynamic_cast<PNode*>(npcIT->nextElement());
    387     }
    388     delete npcIT;
     378    list<BaseObject*>::iterator node;
     379    for (node= npcList->begin(); node != npcList->end(); node++)
     380      if ((carrier->getAbsCoor() - dynamic_cast<PNode*>(*node)->getAbsCoor()).len() < distance)
     381        return dynamic_cast<PNode*>(*node);
    389382  }
    390383  return this->getFixedTarget();
    391 
    392384}
    393385
  • trunk/src/world_entities/weapons/weapon_manager.h

    r5750 r5779  
    110110    tAnimation<Crosshair>*  crossHairSizeAnim;                        //!< An animation for the crosshair (scaling)
    111111
    112     tIterator<BaseObject>*  targetIterator;                           //!< An iterator for traversion lists of enemies.
     112    std::list<BaseObject*>::iterator  targetIterator;                           //!< An iterator for traversion lists of enemies.
    113113};
Note: See TracChangeset for help on using the changeset viewer.