Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

adapted many classes to the new ClassID System, now comes the hard part… Scripting… then Network… wow this will be so bad :/

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