Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/world_entities/weapons/weapon_slot.h

Last change on this file 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
RevLine 
[10437]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"
[10698]10#include "weapon.h"
[10437]11
12class Weapon;
13
14//! a class defining a Slot, where a Weapon can be stored inside.
15class WeaponSlot : public PNode
16{
17  ObjectListDeclaration(WeaponSlot);
18
19public:
20
21  WeaponSlot();
22  WeaponSlot(const TiXmlElement* root);
23  virtual ~WeaponSlot();
24
[10440]25  virtual void loadParams(const TiXmlElement* root);
[10437]26
[10440]27  void setWeaponClass();
28
[10437]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
[10698]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); };
[10534]40
[10698]41
[10534]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
[10438]47private:
[10437]48
[10534]49  int           weaponSlot;
50  int           weaponSide;
51
[10437]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.