Changeset 10661 in orxonox.OLD for branches/vs-enhencements/src/world_entities/space_ships/space_ship.h
- Timestamp:
- May 24, 2007, 3:22:51 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/vs-enhencements/src/world_entities/space_ships/space_ship.h
r10660 r10661 73 73 inline void setEnergyShare(float shield, float weapon, float engine) 74 74 { float tmp = shield + weapon + engine; if (unlikely (tmp > 1)) { tmp = 1/tmp; } 75 // dirty saf ty hack, prevents total share being bigger than 1!!75 // dirty safety hack, prevents total share being bigger than 1!! 76 76 this->shieldEnergyShare = shield * tmp; 77 77 this->weaponEnergyShare = weapon * tmp; … … 82 82 inline void updateHealth() { this->setHealth(this->armorCur); this->setHealthMax(this->armorMax); }; 83 83 84 inline void setPriWM(int slot) { this->weaponMan.setSlotCount(slot); }; 85 inline void setSecWM(int slot) { this->secWeaponMan.setSlotCount(slot); }; 86 inline void createPriWMSlot( int slot, Vector location, long capability) { 87 this->weaponMan.setSlotPosition(slot, location); 88 this->weaponMan.setSlotCapability(slot, capability); }; 89 inline void createSecWMSlot( int slot, Vector location, long capability) { 90 this->secWeaponMan.setSlotPosition(slot, location); 91 this->secWeaponMan.setSlotCapability(slot, capability); }; 84 inline void setWMSlotCount(int wm, int slot) { 85 if (wm == 1) { this->weaponMan.setSlotCount(slot); } 86 if (wm == 2) { this->secWeaponMan.setSlotCount(slot); } 87 else return; }; 88 inline void createWeaponSlot(int wm, int slot, Vector location, long capability) { 89 if (wm == 1) { 90 this->weaponMan.setSlotPosition(slot, location); 91 this->weaponMan.setSlotCapability(slot, capability); } 92 if (wm == 2) { 93 this->secWeaponMan.setSlotPosition(slot, location); 94 this->secWeaponMan.setSlotCapability(slot, capability); } 95 else return; }; 96 97 void addWeaponToSlot(int wm, int config, int slot, const std::string& weaponName); 98 92 99 //Functions for GUI 93 100 inline float getShieldCur() { return this->shieldCur; }; //!< returns current shield value
Note: See TracChangeset
for help on using the changeset viewer.