Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/world_entities/weapons/ammo_container.h @ 9941

Last change on this file since 9941 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
RevLine 
[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]13class Weapon;
[3543]14
[6655]15#define DEFAULT_MAX_ENERGY 100
[3543]16
[6655]17//! A class for Storing energy of Projectiles.
18class AmmoContainer : public BaseObject {
[9869]19  ObjectListDeclaration(AmmoContainer);
[2036]20
[1904]21 public:
[9869]22  AmmoContainer(const ClassID& id, float maxEnergy = DEFAULT_MAX_ENERGY);
[6655]23  virtual ~AmmoContainer();
[1853]24
[9869]25  bool operator=(int projectileType) const { return (this->projectileType == projectileType); };
[6655]26  ClassID getProjectileType() const { return this->projectileType; };
[3245]27
[6655]28  float increaseEnergy(float energy);
29  float decreaseEnergy(float energy);
30
[6671]31  float getStoredEnergy() const { return this->energy; };
[6655]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
[3245]40 private:
[6655]41   float  energy;
42   float  maxEnergy;
[3245]43
[6655]44   ClassID projectileType;
[1853]45};
46
[6655]47#endif /* _AMMO_CONTAINER_H */
Note: See TracBrowser for help on using the repository browser.