source:
orxonox.OLD/trunk/src/world_entities/weapons/ammo_container.h
@
7227
Last change on this file since 7227 was 6671, checked in by bensch, 19 years ago | |
---|---|
File size: 1016 bytes |
Rev | Line | |
---|---|---|
[4838] | 1 | /*! |
2 | * @file proto_class.h | |
3 | * @brief Definition of ... | |
[3245] | 4 | */ |
[1853] | 5 | |
[6655] | 6 | #ifndef _AMMO_CONTAINER_H |
7 | #define _AMMO_CONTAINER_H | |
[1853] | 8 | |
[3543] | 9 | #include "base_object.h" |
[1853] | 10 | |
[6655] | 11 | |
[4838] | 12 | // FORWARD DECLARATION |
[6655] | 13 | class Weapon; |
[3543] | 14 | |
[6655] | 15 | #define DEFAULT_MAX_ENERGY 100 |
[3543] | 16 | |
[6655] | 17 | //! A class for Storing energy of Projectiles. |
18 | class AmmoContainer : public BaseObject { | |
[2036] | 19 | |
[1904] | 20 | public: |
[6655] | 21 | AmmoContainer(ClassID projectileType, float maxEnergy = DEFAULT_MAX_ENERGY); |
22 | virtual ~AmmoContainer(); | |
[1853] | 23 | |
[6669] | 24 | bool operator=(ClassID projectileType) const { return (this->projectileType == projectileType); }; |
[6655] | 25 | ClassID getProjectileType() const { return this->projectileType; }; |
[3245] | 26 | |
[6655] | 27 | float increaseEnergy(float energy); |
28 | float decreaseEnergy(float energy); | |
29 | ||
[6671] | 30 | float getStoredEnergy() const { return this->energy; }; |
[6655] | 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 | ||
[3245] | 39 | private: |
[6655] | 40 | float energy; |
41 | float maxEnergy; | |
[3245] | 42 | |
[6655] | 43 | ClassID projectileType; |
[1853] | 44 | }; |
45 | ||
[6655] | 46 | #endif /* _AMMO_CONTAINER_H */ |
Note: See TracBrowser
for help on using the repository browser.