Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6123 in orxonox.OLD for branches/objectmanager/src/world_entities


Ignore:
Timestamp:
Dec 15, 2005, 2:14:53 AM (18 years ago)
Author:
bensch
Message:

orxonox/branches/objectmanager: all the WorldEntities regigister/unregister ath the ObjectManager as they should

Location:
branches/objectmanager/src/world_entities
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/objectmanager/src/world_entities/environment.cc

    r5994 r6123  
    6262{
    6363  this->setClassID(CL_ENVIRONMENT, "Environment");
     64  this->toList(OM_ENVIRON);
    6465}
    6566
  • branches/objectmanager/src/world_entities/power_ups/power_up.cc

    r6121 r6123  
    2828  this->setClassID(CL_POWER_UP, "PowerUp");
    2929  this->toList(OM_COMMON);
    30 
    3130}
    3231
  • branches/objectmanager/src/world_entities/weapons/bomb.cc

    r5994 r6123  
    180180void Bomb::deactivate()
    181181{
     182  this->toList(OM_NULL);
    182183  State::getWorldEntityList()->remove(this);
    183184  this->lifeCycle = 0.0f;
  • branches/objectmanager/src/world_entities/weapons/ground_turret.cc

    r5994 r6123  
    8989  {
    9090    this->left->setParent(this);
     91    this->left->toList(this->getOMListNumber());
    9192    this->left->setRelCoor(0,10,-5);
    9293  }
     
    9899  {
    99100    this->right->setParent(this);
     101    this->right->toList(this->getOMListNumber());
    100102    this->right->setRelCoor(0,10,5);
    101103  }
  • branches/objectmanager/src/world_entities/weapons/guided_missile.cc

    r6078 r6123  
    129129  this->lifeCycle = 0.0;
    130130
     131  this->toList(OM_NULL);
    131132//  GarbageCollector::getInstance()->collect(this);
    132133  State::getWorldEntityList()->remove(this);
  • branches/objectmanager/src/world_entities/weapons/laser.cc

    r6056 r6123  
    9797  ParticleEngine::getInstance()->breakConnections(this->emitter);
    9898  this->lifeCycle = 0.0;
     99  this->toList(OM_NULL);
    99100
    100 //  GarbageCollector::getInstance()->collect(this);
    101101  State::getWorldEntityList()->remove(this);
    102102  this->removeNode();
  • branches/objectmanager/src/world_entities/weapons/rocket.cc

    r6056 r6123  
    125125  ParticleEngine::getInstance()->breakConnections(this->emitter);
    126126  this->lifeCycle = 0.0;
     127  this->toList(OM_NULL);
    127128
    128129//  GarbageCollector::getInstance()->collect(this);
  • branches/objectmanager/src/world_entities/weapons/test_bullet.cc

    r5994 r6123  
    119119  ParticleEngine::getInstance()->breakConnections(this->emitter);
    120120  this->lifeCycle = 0.0;
     121  this->toList(OM_NULL);
    121122
    122123//  GarbageCollector::getInstance()->collect(this);
  • branches/objectmanager/src/world_entities/weapons/weapon.cc

    r6054 r6123  
    192192{
    193193  if (likely (this->projectileFactory != NULL))
    194     return dynamic_cast<Projectile*>(this->projectileFactory->resurrect());
     194  {
     195    Projectile* pj = dynamic_cast<Projectile*>(this->projectileFactory->resurrect());
     196    pj->toList((OM_LIST)(this->getOMListNumber()+1));
     197    return pj;
     198  }
    195199  else
    196200  {
  • branches/objectmanager/src/world_entities/weapons/weapon_manager.cc

    r6074 r6123  
    3535 * @param number of weapon slots of the model/ship <= 8 (limitied)
    3636 */
    37 WeaponManager::WeaponManager(PNode* parent)
     37WeaponManager::WeaponManager(WorldEntity* parent)
    3838{
    3939  this->init();
     
    155155 * a PNode.
    156156 */
    157 void WeaponManager::setParent(PNode* parent)
    158 {
    159   if (parent == NULL)
    160     parent = PNode::getNullParent();
     157void WeaponManager::setParent(WorldEntity* parent)
     158{
    161159  this->parent = parent;
    162160  if (this->parent != NULL)
     
    246244  //! @todo check if the weapon is already assigned to another config in another slot
    247245  this->configs[configID][slotID] = weapon;
     246  weapon->toList(parent->getOMListNumber());
    248247  if (this->parent != NULL)
    249     weapon->setParent(parent);
     248    this->parent->addChild(weapon);
    250249  PRINTF(3)("Added a new Weapon to the WeaponManager: config %i/ slot %i\n", configID, slotID);
    251250}
  • branches/objectmanager/src/world_entities/weapons/weapon_manager.h

    r6055 r6123  
    4545
    4646  public:
    47     WeaponManager(PNode* parent);
     47    WeaponManager(WorldEntity* parent);
    4848    WeaponManager(const TiXmlElement* root);
    4949    ~WeaponManager();
     
    6363    long getSlotCapability(int slot) const { return this->currentSlotConfig[slot].capability; };
    6464
    65     void setParent(PNode* parent);
     65    void setParent(WorldEntity* parent);
    6666    /** @returns the Parent (carrier) of this WeaponManager */
    6767    PNode* getParent() const { return this->parent; };
     
    9393
    9494  private:
    95     PNode*                  parent;                                   //!< The parent, this WeaponManager is connected to.
     95    WorldEntity*            parent;                                   //!< The parent, this WeaponManager is connected to.
    9696
    9797    int                     slotCount;                                //!< number of weapon slots the ship has.
Note: See TracChangeset for help on using the changeset viewer.