Changeset 4759 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons
- Timestamp:
- Jul 1, 2005, 11:51:28 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/weapon.h
r4758 r4759 37 37 #define W_MAX_CONFIGS 4 38 38 39 40 // FORWARD DECLARATION 39 41 class Projectile; 40 42 class Weapon; 41 43 class Animation3D; 44 class TiXmlElement; 42 45 43 46 typedef enum { 44 SHOOT,45 EMPTY,46 RELOAD,47 SPECIAL1,48 SPECIAL2,49 SPECIAL350 } weaponSoundType;47 W_SHOOT, 48 W_EMPTY, 49 W_RELOAD, 50 W_SPECIAL1, 51 W_SPECIAL2, 52 W_SPECIAL3 53 } WeaponSoundType; 51 54 52 55 53 56 //! this is an identifier for the slot. there are up to 8 weapon slots -> this means there can't be more than 8 weapons at the same time 54 #define W_SLOT0055 #define W_SLOT1156 #define W_SLOT2257 #define W_SLOT3358 #define W_SLOT4459 #define W_SLOT5560 #define W_SLOT6661 #define W_SLOT7762 #define W_FREE_SLOT9957 #define W_SLOT0 0 58 #define W_SLOT1 1 59 #define W_SLOT2 2 60 #define W_SLOT3 3 61 #define W_SLOT4 4 62 #define W_SLOT5 5 63 #define W_SLOT6 6 64 #define W_SLOT7 7 65 #define W_FREE_SLOT 99 63 66 64 67 65 68 //! this is an identifier for the weapon config 66 #define W_CONFIG0067 #define W_CONFIG1168 #define W_CONFIG2269 #define W_CONFIG3369 #define W_CONFIG0 0 70 #define W_CONFIG1 1 71 #define W_CONFIG2 2 72 #define W_CONFIG3 3 70 73 71 74 //! a weapon can be left or right sided 72 #define W_LEFT073 #define W_RIGHT175 #define W_LEFT 0 76 #define W_RIGHT 1 74 77 75 78 //! this is a weapon Configuration: it has up to 8 slots 76 79 typedef struct weaponConfig { 77 bool bUsed; //<! is set to true, if this configuration is78 Weapon* slots[8];80 bool bUsed; //<! is set to true, if this configuration is 81 Weapon* slots[8]; 79 82 }; 80 83 … … 83 86 public: 84 87 WeaponManager(int nrOfSlots = 2); 88 WeaponManager(const TiXmlElement* root); 85 89 ~WeaponManager(); 90 91 void init(); 92 void loadParams(const TiXmlElement* root); 86 93 87 94 void addWeapon(Weapon* weapon, int configID = W_CONFIG0, int slotID = W_FREE_SLOT); … … 94 101 95 102 private: 96 int nrOfSlots;//<! number of weapon slots a ship has97 int currConfID;//<! the currently selected config98 weaponConfig configs[4]; //<! a list of four configurations103 int nrOfSlots; //<! number of weapon slots a ship has 104 int currConfID; //<! the currently selected config 105 weaponConfig configs[4]; //<! a list of four configurations 99 106 100 107 int getNextFreeSlot(int configID); … … 107 114 public: 108 115 Weapon (PNode* parent, const Vector& coordinate, const Quaternion& direction); 116 Weapon(const TiXmlElement* root); 109 117 virtual ~Weapon (); 118 119 void init(); 120 void loadParams(const TiXmlElement* root); 110 121 111 122 void enable(); … … 122 133 123 134 /** 124 \brief sets a weapon idle time135 \brief sets a weapons idle time 125 136 \param idle time in ms 126 137 … … 132 143 \brief gets the weapon idle time 133 144 \returns idle time in ms 134 135 a weapon idle time is the time spend after a shoot until the weapon can 136 shoot again 137 */ 145 */ 138 146 inline float getWeaponIdleTime() const { return this->idleTime;} 139 147 /**
Note: See TracChangeset
for help on using the changeset viewer.