Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 10, 2008, 9:20:39 PM (16 years ago)
Author:
polakma
Message:

altfire now available

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/weapon2/src/orxonox/objects/weaponSystem/Weapon.cc

    r2393 r2398  
    4545        this->magazineReadyToShoot_ = true;
    4646        this->parentWeaponSystem_ = 0;
    47         this->parentWeaponSlot_ = 0;
     47        this->attachedToWeaponSlot_ = 0;
    4848        this->munition_ = 0;
    4949        this->bulletLoadingTime_ = 0;
     
    6161        SUPER(Weapon, XMLPort, xmlelement, mode);
    6262        XMLPortParam(Weapon, "munitionType", setMunitionType, getMunitionType, xmlelement, mode);
     63        XMLPortParam(Weapon, "bulletLoadingTime", setBulletLoadingTime, getBulletLoadingTime, xmlelement, mode);
     64        XMLPortParam(Weapon, "magazineLoadingTime", setMagazineLoadingTime, getMagazineLoadingTime, xmlelement, mode);
    6365    }
    6466
    6567    void Weapon::setWeapon()
    6668    {
    67 COUT(0) << "LaserGun::setWeapon" << std::endl;
    68         this->bulletLoadingTime_ = 0.5;
    69         this->magazineLoadingTime_ = 3.0;
    70         this->munition_->setMaxMagazines(100);
    71         this->munition_->setMaxBullets(6);
    7269        this->munition_->fillBullets();
    7370        this->munition_->fillMagazines();
     
    165162
    166163    void Weapon::setMunitionType(std::string munitionType)
    167     {   
    168 COUT(0) << "Weapon::setMunitionType (XMLPort) "<< munitionType << std::endl;
    169 this->munitionType_ = munitionType; }
     164    {   this->munitionType_ = munitionType; }
    170165
    171166    const std::string Weapon::getMunitionType()
    172167    {   return this->munitionType_;  }
     168
     169    void Weapon::setBulletLoadingTime(float loadingTime)
     170    {   this->bulletLoadingTime_ = loadingTime; }
     171
     172    const float Weapon::getBulletLoadingTime()
     173    {   return this->bulletLoadingTime_;  }
     174
     175    void Weapon::setMagazineLoadingTime(float loadingTime)
     176    {   this->magazineLoadingTime_ = loadingTime; }
     177
     178    const float Weapon::getMagazineLoadingTime()
     179    {   return this->magazineLoadingTime_;  }
     180
    173181
    174182    Munition * Weapon::getAttachedMunition(std::string munitionType)
     
    179187return this->munition_; }
    180188
    181 
    182 
    183     void Weapon::setBulletLoadingTime(float loadingTime)
    184     {   this->bulletLoadingTime_ = loadingTime;   }
    185 
    186     float Weapon::getBulletLoadingTime()
    187     {   return this->bulletLoadingTime_;  }
    188 
    189     void Weapon::setMagazineLoadingTime(float loadingTime)
    190     {   this->magazineLoadingTime_ = loadingTime;   }
    191 
    192     float Weapon::getMagazineLoadingTime()
    193     {   return this->magazineLoadingTime_;  }
    194 
    195 
    196     Timer<Weapon> * Weapon::getBulletTimer()
    197     {   return &this->bulletReloadTimer_;   }
    198 
    199     Timer<Weapon> * Weapon::getMagazineTimer()
    200     {   return &this->magazineReloadTimer_;   }
    201 
    202189    void Weapon::takeBullets() { };
    203190    void Weapon::createProjectile() { };
Note: See TracChangeset for help on using the changeset viewer.