Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/new_class_id/src/world_entities/weapons/ammo_container.h @ 9705

Last change on this file since 9705 was 9705, checked in by bensch, 18 years ago

adapted many more classes

File size: 1.0 KB
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
13class Weapon;
14
15#define DEFAULT_MAX_ENERGY 100
16
17//! A class for Storing energy of Projectiles.
18class AmmoContainer : public BaseObject {
19  NewObjectListDeclaration(AmmoContainer);
20
21 public:
22  AmmoContainer(const NewClassID& id, float maxEnergy = DEFAULT_MAX_ENERGY);
23  virtual ~AmmoContainer();
24
25  bool operator=(int projectileType) const { return (this->projectileType == projectileType); };
26  NewClassID 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   NewClassID projectileType;
45};
46
47#endif /* _AMMO_CONTAINER_H */
Note: See TracBrowser for help on using the repository browser.