Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

renamed newclassid to classid and newobjectlist to objectlist

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 {
[9715]19  ObjectListDeclaration(AmmoContainer);
[2036]20
[1904]21 public:
[9715]22  AmmoContainer(const ClassID& id, float maxEnergy = DEFAULT_MAX_ENERGY);
[6655]23  virtual ~AmmoContainer();
[1853]24
[9684]25  bool operator=(int projectileType) const { return (this->projectileType == projectileType); };
[9715]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
[9715]44   ClassID projectileType;
[1853]45};
46
[6655]47#endif /* _AMMO_CONTAINER_H */
Note: See TracBrowser for help on using the repository browser.