Changeset 3870 in orxonox.OLD for orxonox/trunk/src/world_entities/weapon.h
- Timestamp:
- Apr 18, 2005, 3:37:42 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapon.h
r3862 r3870 34 34 35 35 #define W_MAX_SLOTS 8 36 #define W_MAX_CONF S 436 #define W_MAX_CONFIGS 4 37 37 38 38 class Projectile; … … 48 48 } weaponSoundType; 49 49 50 50 51 //! 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}; 52 #define W_SLOT0 0 53 #define W_SLOT1 1 54 #define W_SLOT2 2 55 #define W_SLOT3 3 56 #define W_SLOT4 4 57 #define W_SLOT5 5 58 #define W_SLOT6 6 59 #define W_SLOT7 7 60 #define W_FREE_SLOT 99 61 53 62 54 63 //! this is an identifier for the weapon config 55 typedef enum configID {W_CONFIG0=0, W_CONFIG1, 56 W_CONFIG2, W_CONFIG3}; 64 #define W_CONFIG0 0 65 #define W_CONFIG1 1 66 #define W_CONFIG2 2 67 #define W_CONFIG3 3 57 68 58 69 //! this is a weapon Configuration: it has up to 8 slots 59 70 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 71 bool bUsed; //<! is set to true, if this configuration is 72 Weapon* slots[8]; 68 73 }; 69 74 … … 74 79 ~WeaponManager(); 75 80 76 void addWeapon(Weapon* weapon, slotID slot, configID config = W_CONFIG0); 77 void addWeaponConfig(weaponConfig* config); 81 void addWeapon(Weapon* weapon, int slotID = W_FREE_SLOT, int configID = W_CONFIG1); 78 82 79 83 void nextWeaponConf(); 80 84 void prevWeaponConf(); 81 void selectConfig( configID config);85 void selectConfig(int configID); 82 86 83 87 private: 84 88 int nrOfConfigs; //<! number of configurations defined 85 89 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 90 int currConfID; //<! the currently selected config 91 weaponConfig configs[4]; //<! a list of four configurations 92 93 int getNextFreeSlot(); 88 94 }; 89 95
Note: See TracChangeset
for help on using the changeset viewer.