Changeset 3862 in orxonox.OLD for orxonox/trunk/src/world_entities/weapon.h
- Timestamp:
- Apr 18, 2005, 9:15:08 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapon.h
r3685 r3862 18 18 o shooting animation 19 19 20 21 a player defines one or more weapon configurations. a player has got one to eight 22 weapon slots: places where weapons can be attached to. a weapon configuration 23 is a matching between weapons and slots. 24 Since its clear how many weapons a player will have, there is no list of weapons: 25 its hard coded and limited to 8 slots and 4 configs. More would be a waste of 26 memory and time you need to customize and change to a weapon config... 20 27 */ 21 28 … … 26 33 #include "world_entity.h" 27 34 35 #define W_MAX_SLOTS 8 36 #define W_MAX_CONFS 4 37 28 38 class Projectile; 39 class Weapon; 29 40 30 41 typedef enum { … … 37 48 } weaponSoundType; 38 49 50 //! 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 51 typedef enum slotID {W_SLOT0=0, W_SLOT1, W_SLOT2, W_SLOT3, 52 W_SLOT4, W_SLOT5, W_SLOT6, W_SLOT7}; 53 54 //! this is an identifier for the weapon config 55 typedef enum configID {W_CONFIG0=0, W_CONFIG1, 56 W_CONFIG2, W_CONFIG3}; 57 58 //! this is a weapon Configuration: it has up to 8 slots 59 typedef struct weaponConfig { 60 Weapon* slot1; //<! standard right side weapon 61 Weapon* slot2; //<! standard left side weapon 62 Weapon* slot3; //<! custom 63 Weapon* slot4; //<! custom 64 Weapon* slot5; //<! custom 65 Weapon* slot6; //<! custom 66 Weapon* slot7; //<! custom 67 Weapon* slot8; //<! custom 68 }; 69 70 71 class WeaponManager { 72 public: 73 WeaponManager(int nrOfSlots = 2); 74 ~WeaponManager(); 75 76 void addWeapon(Weapon* weapon, slotID slot, configID config = W_CONFIG0); 77 void addWeaponConfig(weaponConfig* config); 78 79 void nextWeaponConf(); 80 void prevWeaponConf(); 81 void selectConfig(configID config); 82 83 private: 84 int nrOfConfigs; //<! number of configurations defined 85 int nrOfSlots; //<! number of weapon slots a ship has 86 weaponConfig* currentConfig; //<! the currently selected config 87 weaponConfig* configs[4]; //<! a list of four configurations 88 }; 39 89 40 90 class Weapon : public WorldEntity
Note: See TracChangeset
for help on using the changeset viewer.