Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Apr 18, 2005, 8:05:00 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: weapon change enhanced. weapon handling is now better and safer

File:
1 edited

Legend:

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

    r3878 r3881  
    8888
    8989 private:
    90   int nrOfConfigs;                      //<! number of configurations defined
    9190  int nrOfSlots;                        //<! number of weapon slots a ship has
    9291  int currConfID;                       //<! the currently selected config
     
    101100
    102101 public:
    103   Weapon (PNode* parent, Vector* coordinate, Quaternion* direction);
     102  Weapon (PNode* parent, const Vector& coordinate, const Quaternion& direction);
    104103  virtual ~Weapon ();
    105104 
     
    115114  bool isActive(void);
    116115
    117   void setWeaponIdleTime(float time);
    118   float getWeaponIdleTime(void);
    119   bool hasWeaponIdleTimeElapsed(void);
    120116
     117  /**
     118     \brief sets a weapon idle time
     119     \param idle time in ms
     120     
     121     a weapon idle time is the time spend after a shoot until the weapon can
     122     shoot again
     123  */
     124  inline void setWeaponIdleTime(float time) { this->idleTime = time; }
     125  /**
     126     \brief gets the weapon idle time
     127     \returns idle time in ms
     128     
     129     a weapon idle time is the time spend after a shoot until the weapon can
     130     shoot again
     131  */
     132  inline float getWeaponIdleTime(void) const { return this->idleTime;}
     133  /**
     134     \brief checks if the idle time is elapsed
     135     \return true if time is elapsed
     136     
     137     a weapon idle time is the time spend after a shoot until the weapon can
     138   shoot again
     139  */
     140  inline bool hasWeaponIdleTimeElapsed(void) const { return (this->localTime>this->idleTime)?true:false; }
     141
     142  /**
     143     \brief fires the weapon
     144     
     145     this is called from the player.cc, when fire-button is been pushed
     146  */
    121147  virtual void fire(void) = 0;
    122148  virtual void hit (WorldEntity* weapon, Vector* loc);
Note: See TracChangeset for help on using the changeset viewer.