Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 21, 2016, 4:47:39 PM (9 years ago)
Author:
sagerj
Message:

everything beneath weaponmode changed to push/release - wm modified only need to implement timer/ticker

Location:
code/branches/sagerjFS16/src/orxonox/weaponsystem
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • code/branches/sagerjFS16/src/orxonox/weaponsystem/Weapon.cc

    r11170 r11174  
    9999        Fire this Weapon with the the WeaponMode defined by @param mode
    100100    */
    101     void Weapon::fire(unsigned int mode)
     101    void Weapon::push(unsigned int mode)
    102102    {
    103103        // To avoid firing with more than one mode at the same time, we lock the weapon (reloading) for
     
    125125        {
    126126            float reloading_time = 0;
    127             if (it->second->fire(&reloading_time))
     127            if (it->second->push(&reloading_time))
    128128            {
    129129                this->bReloading_ = true;
  • code/branches/sagerjFS16/src/orxonox/weaponsystem/Weapon.h

    r11164 r11174  
    5252            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    5353
    54             void fire(unsigned int mode);
     54            void push(unsigned int mode);
    5555            void release(unsigned int mode);
    5656            void reload();
  • code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.cc

    r11170 r11174  
    168168    }
    169169
     170    bool WeaponMode::push(float* reloadTime)
     171    {
     172        if( this->chargeable_)
     173        {
     174            // setting up a timer for knowing how long the weapon was charged
     175            // and passes the value to this->cTime_
     176        } else {
     177            return fire(reloadTime);
     178        }
     179       
     180    }
     181
    170182    bool WeaponMode::release(float* reloadTime)
    171183    {
    172         this->release();
    173         return false;
     184        if( this->chargeable_)
     185        {
     186            return fire(reloadTime);
     187        }
    174188    }
    175189
  • code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.h

    r11170 r11174  
    5757            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    5858
     59            virtual bool push(float* reloadTime);
     60            virtual bool release(float* reloadTime);
    5961            virtual bool fire(float* reloadTime);
    60             virtual bool release(float* reloadTime);
    6162            bool reload();
    6263
     
    165166
    166167            virtual void fire() = 0;
    167             virtual void release() {};
    168168
    169169            unsigned int initialMunition_;
  • code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponPack.cc

    r11170 r11174  
    7474        Fire all weapons in this WeaponSet with the defined weaponmode.
    7575    */
    76     void WeaponPack::fire(unsigned int weaponmode)
     76    void WeaponPack::push(unsigned int weaponmode)
    7777    {
    7878        for (Weapon* weapon : this->weapons_)
    79             weapon->fire(weaponmode);
     79            weapon->push(weaponmode);
    8080    }
    8181
  • code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponPack.h

    r11164 r11174  
    4646            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    4747
    48             void fire(unsigned int weaponmode);
     48            void push(unsigned int weaponmode);
    4949            void release(unsigned int weaponmode);
    5050            void reload();
  • code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSet.cc

    r11170 r11174  
    6060    }
    6161
    62     void WeaponSet::fire()
     62    void WeaponSet::push()
    6363    {
    6464        // Fire all WeaponPacks with their defined weaponmode
    6565        for (const auto& mapEntry : this->weaponpacks_)
    6666            if (mapEntry.second != WeaponSystem::WEAPON_MODE_UNASSIGNED)
    67                 mapEntry.first->fire(mapEntry.second);
     67                mapEntry.first->push(mapEntry.second);
    6868    }
    6969
  • code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSet.h

    r11164 r11174  
    4646            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    4747
    48             void fire();
     48            void push();
    4949            void release();
    5050            void reload();
  • code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSystem.cc

    r11170 r11174  
    287287        Fires the @ref orxonox::WeaponSet with the specified firemode.
    288288    */
    289     void WeaponSystem::fire(unsigned int firemode)
     289    void WeaponSystem::push(unsigned int firemode)
    290290    {
    291291        std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.find(firemode);
    292292        if (it != this->weaponSets_.end() && it->second)
    293             it->second->fire();
     293            it->second->push();
    294294    }
    295295
  • code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSystem.h

    r11164 r11174  
    7474            void changeWeaponmode(WeaponPack * wPack, WeaponSet * wSet, unsigned int weaponmode);
    7575
    76             void fire(unsigned int firemode);
     76            void push(unsigned int firemode);
    7777            void release(unsigned int firemode);
    7878            void reload();
Note: See TracChangeset for help on using the changeset viewer.