Last change
on this file since 10771 was
10698,
checked in by snellen, 18 years ago
|
merged adm, hud, vs-enhancements : beni's responsible for this commit. blame him!
|
File size:
1.7 KB
|
Line | |
---|
1 | /*! |
---|
2 | * @file weapon_slot.h |
---|
3 | */ |
---|
4 | |
---|
5 | |
---|
6 | #ifndef _WEAPON_SLOT_H |
---|
7 | #define _WEAPON_SLOT_H |
---|
8 | |
---|
9 | #include "p_node.h" |
---|
10 | #include "weapon.h" |
---|
11 | |
---|
12 | class Weapon; |
---|
13 | |
---|
14 | //! a class defining a Slot, where a Weapon can be stored inside. |
---|
15 | class WeaponSlot : public PNode |
---|
16 | { |
---|
17 | ObjectListDeclaration(WeaponSlot); |
---|
18 | |
---|
19 | public: |
---|
20 | |
---|
21 | WeaponSlot(); |
---|
22 | WeaponSlot(const TiXmlElement* root); |
---|
23 | virtual ~WeaponSlot(); |
---|
24 | |
---|
25 | virtual void loadParams(const TiXmlElement* root); |
---|
26 | |
---|
27 | void setWeaponClass(); |
---|
28 | |
---|
29 | long getCapability() { return this->capability; } |
---|
30 | void setCapability(long cap) { this->capability = cap; } |
---|
31 | |
---|
32 | inline Weapon* getCurrentWeapon() { return this->currentWeapon; } |
---|
33 | inline void setCurrentWeapon(Weapon* weapon) { this->currentWeapon = weapon; } |
---|
34 | |
---|
35 | inline Weapon* getNextWeapon() { return this->nextWeapon; } |
---|
36 | inline void setNextWeapon(Weapon* weapon) { this->nextWeapon = weapon; } |
---|
37 | |
---|
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); }; |
---|
40 | |
---|
41 | |
---|
42 | inline void setWeaponConfig(int slot, int side) { this->weaponSlot = slot; this->weaponSide = side; } |
---|
43 | inline int getWeaponSlot() { return this->weaponSlot; } |
---|
44 | inline int getWeaponSide() { return this->weaponSide; } |
---|
45 | |
---|
46 | |
---|
47 | private: |
---|
48 | |
---|
49 | int weaponSlot; |
---|
50 | int weaponSide; |
---|
51 | |
---|
52 | long capability; //!< the capabilities of the Slot @see WeaponSlotCapability. |
---|
53 | |
---|
54 | Weapon* currentWeapon; //!< The current weapon this slot is carrying. |
---|
55 | Weapon* nextWeapon; //!< either NULL or the next weapon that will be set (require currentWeapon to deactivate) |
---|
56 | }; |
---|
57 | |
---|
58 | |
---|
59 | #endif /* _WEAPON_SLOT_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.