Changeset 10676 in orxonox.OLD for branches/vs-enhencements/src/world_entities/weapons/weapon_slot.h
- Timestamp:
- Jun 7, 2007, 5:10:52 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/vs-enhencements/src/world_entities/weapons/weapon_slot.h
r10672 r10676 9 9 #include "p_node.h" 10 10 #include "weapon.h" 11 #include "weapon_manager.h" 11 12 12 13 class Weapon; … … 31 32 32 33 inline Weapon* getCurrentWeapon() { return this->currentWeapon; } 33 inline void setCurrentWeapon( Weapon* weapon) { this->currentWeapon = weapon; }34 inline void setCurrentWeapon(int config) { this->currentWeapon = this->configs[config]; } 34 35 35 36 inline Weapon* getNextWeapon() { return this->nextWeapon; } 36 inline void setNextWeapon( Weapon* weapon) { this->nextWeapon = weapon; }37 inline void setNextWeapon(int config) { if (config == -1) this->nextWeapon = NULL; else this->nextWeapon = configs[config]; } 37 38 38 inline void setNextWeapon(const std::string& weaponName){this->nextWeapon = Weapon::createWeapon(weaponName); }; 39 inline void setCurrentWeapon(const std::string& weaponName){ this->currentWeapon = Weapon::createWeapon(weaponName); }; 39 inline void setNextToCurrent() {this->currentWeapon = this->nextWeapon; }; 40 // inline void setNextWeapon(const std::string& weaponName){this->nextWeapon = Weapon::createWeapon(weaponName); }; 41 // inline void setCurrentWeapon(const std::string& weaponName){ this->currentWeapon = Weapon::createWeapon(weaponName); }; 40 42 43 inline void addWeapon(const std::string& weaponName, int config) {this->configs[config] = Weapon::createWeapon(weaponName); } 44 inline void setWeapon(Weapon* weapon, int config) {this->configs[config] = weapon; }; 45 inline Weapon* getWeapon(int config) { if (config > WM_MAX_CONFIGS) return NULL; return this->configs[config]; }; 41 46 42 47 inline void setWeaponConfig(int slot, int side) { this->weaponSlot = slot; this->weaponSide = side; } … … 44 49 inline int getWeaponSide() { return this->weaponSide; } 45 50 51 void removeWeapon(Weapon* weapon); 46 52 47 53 private: … … 52 58 long capability; //!< the capabilities of the Slot @see WeaponSlotCapability. 53 59 60 Weapon* configs[WM_MAX_CONFIGS]; 61 54 62 Weapon* currentWeapon; //!< The current weapon this slot is carrying. 55 63 Weapon* nextWeapon; //!< either NULL or the next weapon that will be set (require currentWeapon to deactivate) 64 65 // int currentConfig; 66 // int nextConfig; 56 67 }; 57 68
Note: See TracChangeset
for help on using the changeset viewer.