Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/cleanup/src/world_entities/weapons/weapon_slot.h @ 10719

Last change on this file since 10719 was 10534, checked in by patrick, 18 years ago

mounting weapon slots

File size: 1.4 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
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
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
39  inline void setWeaponConfig(int slot, int side) { this->weaponSlot = slot; this->weaponSide = side; }
40  inline int getWeaponSlot() { return this->weaponSlot; }
41  inline int getWeaponSide() { return this->weaponSide; }
42
43
44private:
45
46  int           weaponSlot;
47  int           weaponSide;
48
49  long          capability;             //!< the capabilities of the Slot @see WeaponSlotCapability.
50
51  Weapon*       currentWeapon;          //!< The current weapon this slot is carrying.
52  Weapon*       nextWeapon;             //!< either NULL or the next weapon that will be set (require currentWeapon to deactivate)
53};
54
55
56#endif /* _WEAPON_SLOT_H */
Note: See TracBrowser for help on using the repository browser.