Changeset 4954 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons/weapon_manager.h
- Timestamp:
- Jul 25, 2005, 2:16:23 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/weapon_manager.h
r4953 r4954 1 1 /*! 2 \file weapon.h 3 * a weapon that a player can use 4 5 A Player has a list of weapons, that can be choosen to shoot projectiles 6 (projectiles.{cc,h}) at ennemies. These weapons can be shooted sequentially 7 or (if able) combined. Therefore you can choose the weapon mode = choose 8 a weapon. 9 10 A weapon is characterized by: 11 o firing-rate: the initial firing rate of a weapon (1/s = Herz) 12 o slowdown-factor: this is a factor d: exp(-d*x), d is element of all positive R. it determines how fast the firing-rate will slow down. if no slowdown: d=0, the bigger d is, the faster the weapon will slow down! 13 o energy-consumption: this determines the energy that has to be used to produce this projectile = costs per projectile 14 15 Furthermore there are some other attributes, that will help to represent a firing 16 weapon in this world: 17 o sound file/ressource: this is a pointer to the sound-file/ressource. however it may be represented 18 o shooting animation 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... 2 * @file weapon_manager.h 3 * every big WorldEntity has the ability to carry many different Weapons. 4 * for this to be easy there is the WeaponManager, that handels these weapons, 5 * and changes between them. 6 * 7 * 8 * 9 * @TODO 1. WeaponManager should also handle a List of availiableWeapons. 10 * @TODO 2. Weapons should now Types the counteract to capabilities, so we know where we can put them on the ship. 27 11 */ 28 12 … … 90 74 // setting up the WeaponManager with the following functions 91 75 void setSlotPosition(int slot, const Vector& position); 92 void setSlotCapability(long slotCapability); 76 /** @param slot the slot to get the relative position from @returns the relative position of the Carrier to the Slot */ 77 const Vector& getSlotPosition(int slot) const { return this->currentSlotConfig[slot].position.getRelCoor(); }; 78 void setSlotCapability(int slot, long slotCapability); 79 /** @param slot the slot to get the capabilities from @returns the capabilies */ 80 long getSlotCapability(int slot) const { return this->currentSlotConfig[slot].capability; }; 81 93 82 void setParent(PNode* parent); 83 /** @returns the Parent (carrier) of this WeaponManager */ 84 PNode* getParent() const { return this->parent; }; 94 85 95 86 void addWeapon(Weapon* weapon, int configID = -1, int slotID = -1); 96 87 void removeWeapon(Weapon* weapon, int configID = -1); 97 88 98 void nextWeaponConf ();89 void nextWeaponConfig(); 99 90 void previousWeaponConfig(); 100 91 void changeWeaponConfig(int weaponConfig); … … 113 104 114 105 private: 115 PNode* parent; //!< The parent, this WeaponManager is connected to.106 PNode* parent; //!< The parent, this WeaponManager is connected to. 116 107 117 int slotCount; //!< number of weapon slots the ship has.118 int currentConfigID; //!< the currently selected config.119 Weapon* configs[WM_MAX_CONFIGS][WM_MAX_SLOTS]; //!< An array of predefined configurations and assigned weapon.120 WM_Slot currentSlotConfig[WM_MAX_SLOTS]; //!< The currentConfigureation.108 int slotCount; //!< number of weapon slots the ship has. 109 int currentConfigID; //!< the currently selected config. 110 Weapon* configs[WM_MAX_CONFIGS][WM_MAX_SLOTS]; //!< An array of predefined configurations and assigned weapon. 111 WM_Slot currentSlotConfig[WM_MAX_SLOTS]; //!< The currentConfigureation. 121 112 122 Weapon* availiableWeapons[WM_MAX_LOADED_WEAPONS]; 113 Weapon* availiableWeapons[WM_MAX_LOADED_WEAPONS]; //!< The availiable Weapons of this WeaponManager 123 114 124 115 bool weaponChange; 125 116 126 Crosshair* crosshair; //!< an aim.127 tAnimation<Crosshair>* crossHairSizeAnim; //!< An animation for the crosshair (scaling)117 Crosshair* crosshair; //!< an aim. 118 tAnimation<Crosshair>* crossHairSizeAnim; //!< An animation for the crosshair (scaling) 128 119 };
Note: See TracChangeset
for help on using the changeset viewer.