- Timestamp:
- Apr 9, 2009, 3:18:11 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSystem.h
r2896 r2912 33 33 #include "OrxonoxPrereqs.h" 34 34 35 #include <set> 36 #include <map> 37 35 38 #include "core/BaseObject.h" 36 37 #include "WeaponSet.h"38 #include "WeaponPack.h"39 39 40 40 namespace orxonox 41 41 { 42 const unsigned int MAX_FIRE_MODES = 8; 42 43 43 44 class _OrxonoxExport WeaponSystem : public BaseObject … … 47 48 virtual ~WeaponSystem(); 48 49 49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 50 void attachWeaponSlot(WeaponSlot * wSlot); 51 WeaponSlot * getWeaponSlot(unsigned int index) const; 50 52 51 void attachWeaponSlot(WeaponSlot *wSlot); 52 void attachWeaponSet(WeaponSet *wSet); 53 //void fire(); 54 void fire(WeaponMode::Enum fireMode); 55 void attachWeaponPack(WeaponPack * wPack, unsigned int firemode); 56 WeaponSet * getWeaponSetPointer(unsigned int n); 57 WeaponSlot * getWeaponSlotPointer(unsigned int n); 58 WeaponPack * getWeaponPackPointer(unsigned int n); 59 void setNewMunition(std::string munitionType, Munition * munitionToAdd); 60 void setNewSharedMunition(std::string munitionType, Munition * munitionToAdd); 61 Munition * getMunitionType(std::string munitionType); 53 void attachWeaponSet(WeaponSet * wSet); 54 WeaponSet * getWeaponSet(unsigned int index) const; 62 55 63 inline void setParentPawn(Pawn *parentPawn) 64 { parentPawn_=parentPawn; } 65 inline Pawn * getParentPawn() 66 { return parentPawn_; } 56 void attachWeaponPack(WeaponPack * wPack, unsigned int wSetNumber); 57 WeaponPack * getWeaponPack(unsigned int index) const; 67 58 68 inline int getWeaponSlotSize() 59 void fire(unsigned int firemode); 60 61 void setNewMunition(const std::string& munitionType, Munition * munitionToAdd); 62 void setNewSharedMunition(const std::string& munitionType, Munition * munitionToAdd); 63 Munition * getMunitionType(const std::string& munitionType) const; 64 65 inline void setPawn(Pawn * pawn) 66 { this->pawn_ = pawn; } 67 inline Pawn * getPawn() const 68 { return this->pawn_; } 69 70 inline int getWeaponSlotSize() const 69 71 { return this->weaponSlots_.size(); } 70 72 73 static inline unsigned int getMaxFireModes() 74 { return MAX_FIRE_MODES; } 75 static inline unsigned int getFireModeMask(unsigned int firemode) 76 { return (0x1 << firemode); } 77 71 78 private: 72 std:: vector<WeaponSet *> weaponSets_;73 std:: vector<WeaponSlot *> weaponSlots_;74 std:: vector<WeaponPack *> weaponPacks_;79 std::map<unsigned int, WeaponSet *> weaponSets_; 80 std::set<WeaponSlot *> weaponSlots_; 81 std::set<WeaponPack *> weaponPacks_; 75 82 std::map<std::string, Munition *> munitionSet_; 76 Pawn * parentPawn_;83 Pawn * pawn_; 77 84 }; 78 85 }
Note: See TracChangeset
for help on using the changeset viewer.