Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2008, 2:10:11 AM (15 years ago)
Author:
landauf
Message:

merged weapon2 branch to presentation

Location:
code/branches/presentation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation

  • code/branches/presentation/src/orxonox/objects/weaponSystem/WeaponSlot.cc

    r2098 r2493  
    3636
    3737
    38 
    3938namespace orxonox
    4039{
    41     WeaponSlot::WeaponSlot(BaseObject* creator) : BaseObject(creator)
     40    CreateFactory(WeaponSlot);
     41
     42    WeaponSlot::WeaponSlot(BaseObject* creator) : StaticEntity(creator)
    4243    {
    4344        RegisterObject(WeaponSlot);
    4445
    4546        this->unlimitedAmmo_ = false;
    46 
    4747        this->attachedWeapon_ = 0;
    48         this->parentWeaponSet_ = 0;
     48        this->setObjectMode(0x0);
    4949    }
    5050
     
    5353    }
    5454
    55     void WeaponSlot::attachWeapon(Weapon *weaponName)
    56     {
    57 
    58     }
    5955
    6056    /*sets the munition type
     
    6763    }
    6864
     65
    6966    void WeaponSlot::fire()
    7067    {
     68        if ( this->attachedWeapon_ )
     69//COUT(0) << "WeaponSlot::fire" << std::endl;
     70        this->attachedWeapon_->fire();
     71    }
    7172
    72     }
    7373
    7474    void WeaponSlot::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    7575    {
     76        SUPER(WeaponSlot, XMLPort, xmlelement, mode);
     77    }
    7678
     79    void WeaponSlot::attachWeapon(Weapon *weapon)
     80    {
     81        this->attachedWeapon_ = weapon;
     82        weapon->setAttachedToWeaponSlot(this);
     83//COUT(0) << "WeaponSlot::attachWeapon position=" << this->getWorldPosition() << std::endl;
     84        weapon->setPosition(this->getPosition());
     85    }
     86
     87    Weapon * WeaponSlot::getAttachedWeapon() const
     88    {
     89        return this->attachedWeapon_;
    7790    }
    7891}
Note: See TracChangeset for help on using the changeset viewer.