Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/ODE/src/world_entities/weapons/ammo_container.h @ 10726

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

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

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  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.