Changeset 11174 for code/branches/sagerjFS16/src/orxonox/weaponsystem
- Timestamp:
- Apr 21, 2016, 4:47:39 PM (9 years ago)
- Location:
- code/branches/sagerjFS16/src/orxonox/weaponsystem
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sagerjFS16/src/orxonox/weaponsystem/Weapon.cc
r11170 r11174 99 99 Fire this Weapon with the the WeaponMode defined by @param mode 100 100 */ 101 void Weapon:: fire(unsigned int mode)101 void Weapon::push(unsigned int mode) 102 102 { 103 103 // To avoid firing with more than one mode at the same time, we lock the weapon (reloading) for … … 125 125 { 126 126 float reloading_time = 0; 127 if (it->second-> fire(&reloading_time))127 if (it->second->push(&reloading_time)) 128 128 { 129 129 this->bReloading_ = true; -
code/branches/sagerjFS16/src/orxonox/weaponsystem/Weapon.h
r11164 r11174 52 52 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 53 53 54 void fire(unsigned int mode);54 void push(unsigned int mode); 55 55 void release(unsigned int mode); 56 56 void reload(); -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.cc
r11170 r11174 168 168 } 169 169 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 170 182 bool WeaponMode::release(float* reloadTime) 171 183 { 172 this->release(); 173 return false; 184 if( this->chargeable_) 185 { 186 return fire(reloadTime); 187 } 174 188 } 175 189 -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.h
r11170 r11174 57 57 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 58 58 59 virtual bool push(float* reloadTime); 60 virtual bool release(float* reloadTime); 59 61 virtual bool fire(float* reloadTime); 60 virtual bool release(float* reloadTime);61 62 bool reload(); 62 63 … … 165 166 166 167 virtual void fire() = 0; 167 virtual void release() {};168 168 169 169 unsigned int initialMunition_; -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponPack.cc
r11170 r11174 74 74 Fire all weapons in this WeaponSet with the defined weaponmode. 75 75 */ 76 void WeaponPack:: fire(unsigned int weaponmode)76 void WeaponPack::push(unsigned int weaponmode) 77 77 { 78 78 for (Weapon* weapon : this->weapons_) 79 weapon-> fire(weaponmode);79 weapon->push(weaponmode); 80 80 } 81 81 -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponPack.h
r11164 r11174 46 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 47 47 48 void fire(unsigned int weaponmode);48 void push(unsigned int weaponmode); 49 49 void release(unsigned int weaponmode); 50 50 void reload(); -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSet.cc
r11170 r11174 60 60 } 61 61 62 void WeaponSet:: fire()62 void WeaponSet::push() 63 63 { 64 64 // Fire all WeaponPacks with their defined weaponmode 65 65 for (const auto& mapEntry : this->weaponpacks_) 66 66 if (mapEntry.second != WeaponSystem::WEAPON_MODE_UNASSIGNED) 67 mapEntry.first-> fire(mapEntry.second);67 mapEntry.first->push(mapEntry.second); 68 68 } 69 69 -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSet.h
r11164 r11174 46 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 47 47 48 void fire();48 void push(); 49 49 void release(); 50 50 void reload(); -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSystem.cc
r11170 r11174 287 287 Fires the @ref orxonox::WeaponSet with the specified firemode. 288 288 */ 289 void WeaponSystem:: fire(unsigned int firemode)289 void WeaponSystem::push(unsigned int firemode) 290 290 { 291 291 std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.find(firemode); 292 292 if (it != this->weaponSets_.end() && it->second) 293 it->second-> fire();293 it->second->push(); 294 294 } 295 295 -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSystem.h
r11164 r11174 74 74 void changeWeaponmode(WeaponPack * wPack, WeaponSet * wSet, unsigned int weaponmode); 75 75 76 void fire(unsigned int firemode);76 void push(unsigned int firemode); 77 77 void release(unsigned int firemode); 78 78 void reload();
Note: See TracChangeset
for help on using the changeset viewer.