Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4597 in orxonox.OLD for orxonox/trunk/src/world_entities/weapon.h


Ignore:
Timestamp:
Jun 11, 2005, 12:55:48 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: setClassID implemented in all files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/weapon.h

    r4504 r4597  
    1 /*! 
     1/*!
    22    \file weapon.h
    33    \brief a weapon that a player can use
     
    1212     o slowdown-factor: this is a factor d: exp(-d*x), d is element of all positive R. it determines how fast the firing-rate will slow down. if no slowdown: d=0, the bigger d is, the faster the weapon will slow down!
    1313     o energy-consumption: this determines the energy that has to be used to produce this projectile = costs per projectile
    14    
     14
    1515    Furthermore there are some other attributes, that will help to represent a firing
    1616    weapon in this world:
    1717     o sound file/ressource: this is a pointer to the sound-file/ressource. however it may be represented
    1818     o shooting animation
    19      
     19
    2020
    2121     a player defines one or more weapon configurations. a player has got one to eight
     
    3131#define _WEAPON_H
    3232
     33#include "base_object.h"
    3334#include "world_entity.h"
    3435
     
    7475//! this is a weapon Configuration: it has up to 8 slots
    7576typedef struct weaponConfig {
    76   bool bUsed;                       //<! is set to true, if this configuration is 
     77  bool bUsed;                       //<! is set to true, if this configuration is
    7778  Weapon* slots[8];
    7879};
    7980
    8081
    81 class WeaponManager {
     82class WeaponManager : public BaseObject {
    8283 public:
    8384  WeaponManager(int nrOfSlots = 2);
    8485  ~WeaponManager();
    85  
     86
    8687  void addWeapon(Weapon* weapon, int configID = W_CONFIG0, int slotID = W_FREE_SLOT);
    8788  void removeWeapon(Weapon* weapon, int configID = W_CONFIG0);
     
    9697  int currConfID;                       //<! the currently selected config
    9798  weaponConfig configs[4];              //<! a list of four configurations
    98  
     99
    99100  int getNextFreeSlot(int configID);
    100101};
    101102
    102 class Weapon : public WorldEntity 
     103class Weapon : public WorldEntity
    103104{
    104105  friend class World;
     
    107108  Weapon (PNode* parent, const Vector& coordinate, const Quaternion& direction);
    108109  virtual ~Weapon ();
    109  
     110
    110111  void enable(void);
    111112  void disable(void);
     
    123124     \brief sets a weapon idle time
    124125     \param idle time in ms
    125      
     126
    126127     a weapon idle time is the time spend after a shoot until the weapon can
    127128     shoot again
     
    131132     \brief gets the weapon idle time
    132133     \returns idle time in ms
    133      
     134
    134135     a weapon idle time is the time spend after a shoot until the weapon can
    135136     shoot again
     
    139140     \brief checks if the idle time is elapsed
    140141     \return true if time is elapsed
    141      
     142
    142143     a weapon idle time is the time spend after a shoot until the weapon can
    143144   shoot again
     
    147148  /**
    148149     \brief fires the weapon
    149      
     150
    150151     this is called from the player.cc, when fire-button is been pushed
    151152  */
     
    153154  virtual void hit (WorldEntity* weapon, Vector* loc);
    154155  virtual void destroy(void);
    155  
     156
    156157  virtual void tick(float time);
    157158  virtual void weaponIdle(void);
Note: See TracChangeset for help on using the changeset viewer.