/*! \file weapon.h \brief a weapon that a player can use A Player has a list of weapons, that can be choosen to shoot projectiles (projectiles.{cc,h}) at ennemies. These weapons can be shooted sequentially or (if able) combined. Therefore you can choose the weapon mode = choose a weapon. A weapon is characterized by: o firing-rate: the initial firing rate of a weapon (1/s = Herz) 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! o energy-consumption: this determines the energy that has to be used to produce this projectile = costs per projectile Furthermore there are some other attributes, that will help to represent a firing weapon in this world: o sound file/ressource: this is a pointer to the sound-file/ressource. however it may be represented o shooting animation a player defines one or more weapon configurations. a player has got one to eight weapon slots: places where weapons can be attached to. a weapon configuration is a matching between weapons and slots. Since its clear how many weapons a player will have, there is no list of weapons: its hard coded and limited to 8 slots and 4 configs. More would be a waste of memory and time you need to customize and change to a weapon config... */ #ifndef _WEAPON_H #define _WEAPON_H #include "world_entity.h" #define W_MAX_SLOTS 8 #define W_MAX_CONFS 4 class Projectile; class Weapon; typedef enum { SHOOT, EMPTY, RELOAD, SPECIAL1, SPECIAL2, SPECIAL3 } weaponSoundType; //! 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 typedef enum slotID {W_SLOT0=0, W_SLOT1, W_SLOT2, W_SLOT3, W_SLOT4, W_SLOT5, W_SLOT6, W_SLOT7}; //! this is an identifier for the weapon config typedef enum configID {W_CONFIG0=0, W_CONFIG1, W_CONFIG2, W_CONFIG3}; //! this is a weapon Configuration: it has up to 8 slots typedef struct weaponConfig { Weapon* slot1; //* worldEntities; float localTime; float idleTime; float slowDownFactor; private: bool enabled; Projectile* projectile; //WeaponSound sound; }; #endif /* _WEAPON_H */