Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 23, 2006, 2:02:22 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: ammoContainer added

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/weapons/ammo_container.h

    r6653 r6655  
    44*/
    55
    6 #ifndef _PROTO_CLASS_H
    7 #define _PROTO_CLASS_H
     6#ifndef _AMMO_CONTAINER_H
     7#define _AMMO_CONTAINER_H
    88
    99#include "base_object.h"
    1010
     11
    1112// 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(ClassID projectileType, float maxEnergy = DEFAULT_MAX_ENERGY);
     22  virtual ~AmmoContainer();
     23
     24  ClassID getProjectileType() const { return this->projectileType; };
    1225
    1326
     27  float increaseEnergy(float energy);
     28  float decreaseEnergy(float energy);
    1429
    15 //! A class for ...
    16 class ProtoClass : public BaseObject {
     30  float getMaxEnergy() const { return this->maxEnergy; };
    1731
    18  public:
    19   ProtoClass();
    20   virtual ~ProtoClass();
     32  void increaseMaxEnergy(float increase);
     33
     34  bool weaponValid(const Weapon* weapon);
     35  void fillWeapon(Weapon* weapon);
    2136
    2237
    2338 private:
     39   float  energy;
     40   float  maxEnergy;
    2441
     42   ClassID projectileType;
    2543};
    2644
    27 #endif /* _PROTO_CLASS_H */
     45#endif /* _AMMO_CONTAINER_H */
Note: See TracChangeset for help on using the changeset viewer.