| Line |   | 
|---|
| 1 | /*! | 
|---|
| 2 |  * @file proto_class.h | 
|---|
| 3 |  * @brief Definition of ... | 
|---|
| 4 | */ | 
|---|
| 5 |  | 
|---|
| 6 | #ifndef _AMMO_CONTAINER_H | 
|---|
| 7 | #define _AMMO_CONTAINER_H | 
|---|
| 8 |  | 
|---|
| 9 | #include "base_object.h" | 
|---|
| 10 |  | 
|---|
| 11 |  | 
|---|
| 12 | // FORWARD DECLARATION | 
|---|
| 13 | class Weapon; | 
|---|
| 14 |  | 
|---|
| 15 | #define DEFAULT_MAX_ENERGY 100 | 
|---|
| 16 |  | 
|---|
| 17 | //! A class for Storing energy of Projectiles. | 
|---|
| 18 | class AmmoContainer : public BaseObject { | 
|---|
| 19 |   ObjectListDeclaration(AmmoContainer); | 
|---|
| 20 |  | 
|---|
| 21 |  public: | 
|---|
| 22 |   AmmoContainer(const ClassID& id, float maxEnergy = DEFAULT_MAX_ENERGY); | 
|---|
| 23 |   virtual ~AmmoContainer(); | 
|---|
| 24 |  | 
|---|
| 25 |   bool operator=(int projectileType) const { return (this->projectileType == projectileType); }; | 
|---|
| 26 |   ClassID getProjectileType() const { return this->projectileType; }; | 
|---|
| 27 |  | 
|---|
| 28 |   float increaseEnergy(float energy); | 
|---|
| 29 |   float decreaseEnergy(float energy); | 
|---|
| 30 |  | 
|---|
| 31 |   float getStoredEnergy() const { return this->energy; }; | 
|---|
| 32 |   float getMaxEnergy() const { return this->maxEnergy; }; | 
|---|
| 33 |  | 
|---|
| 34 |   void increaseMaxEnergy(float increase); | 
|---|
| 35 |  | 
|---|
| 36 |   bool weaponValid(const Weapon* weapon); | 
|---|
| 37 |   void fillWeapon(Weapon* weapon); | 
|---|
| 38 |  | 
|---|
| 39 |  | 
|---|
| 40 |  private: | 
|---|
| 41 |    float  energy; | 
|---|
| 42 |    float  maxEnergy; | 
|---|
| 43 |  | 
|---|
| 44 |    ClassID projectileType; | 
|---|
| 45 | }; | 
|---|
| 46 |  | 
|---|
| 47 | #endif /* _AMMO_CONTAINER_H */ | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.