|
Last change
on this file since 7906 was
6671,
checked in by bensch, 20 years ago
|
|
WeaponManger now handles Ammo.
If a Weapon has NO ammo then the Ammo will be infinite
|
|
File size:
1016 bytes
|
| 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 | |
|---|
| 20 | public: |
|---|
| 21 | AmmoContainer(ClassID projectileType, float maxEnergy = DEFAULT_MAX_ENERGY); |
|---|
| 22 | virtual ~AmmoContainer(); |
|---|
| 23 | |
|---|
| 24 | bool operator=(ClassID projectileType) const { return (this->projectileType == projectileType); }; |
|---|
| 25 | ClassID getProjectileType() const { return this->projectileType; }; |
|---|
| 26 | |
|---|
| 27 | float increaseEnergy(float energy); |
|---|
| 28 | float decreaseEnergy(float energy); |
|---|
| 29 | |
|---|
| 30 | float getStoredEnergy() const { return this->energy; }; |
|---|
| 31 | float getMaxEnergy() const { return this->maxEnergy; }; |
|---|
| 32 | |
|---|
| 33 | void increaseMaxEnergy(float increase); |
|---|
| 34 | |
|---|
| 35 | bool weaponValid(const Weapon* weapon); |
|---|
| 36 | void fillWeapon(Weapon* weapon); |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | private: |
|---|
| 40 | float energy; |
|---|
| 41 | float maxEnergy; |
|---|
| 42 | |
|---|
| 43 | ClassID projectileType; |
|---|
| 44 | }; |
|---|
| 45 | |
|---|
| 46 | #endif /* _AMMO_CONTAINER_H */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.