Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 19, 2005, 12:20:58 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: remake of the Projectile and TestBullet

File:
1 edited

Legend:

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

    r4885 r4890  
    2828class TiXmlElement;
    2929
    30 //! An enumerator defining actions a Weapon can take
     30//! An enumerator defining Actions a Weapon can take
    3131typedef enum {
    3232  WA_NONE          =    0,    //!< No Action taken
     
    8080
    8181    void requestAction(WeaponAction action);
     82    float increaseEnergy(float energyToAdd);
    8283
    8384    /** @returns true if the Weapon is Active */
     
    117118
    118119  protected:
    119     // utility:
    120     static WeaponAction  charToAction(const char* action);
    121     static const char*   actionToChar(WeaponAction action);
    122     static WeaponState   charToState(const char* state);
    123     static const char*   stateToChar(WeaponState state);
    124 
    125120    //! ACTION: these functions are handled by the Weapon itself, and must be called by requestAction(WeaponAction);
    126121    bool execute();
     
    131126    virtual void charge();
    132127
     128
     129    // utility:
     130    static WeaponAction  charToAction(const char* action);
     131    static const char*   actionToChar(WeaponAction action);
     132    static WeaponState   charToState(const char* state);
     133    static const char*   stateToChar(WeaponState state);
    133134  private:
    134135    bool nextActionValid() const;
    135136
     137
     138
    136139  protected:
    137     SoundSource*         soundSource;
     140    SoundSource*         soundSource;                      //!< A SoundSource to play sound from (this is connected to the PNode of the Weapon)
    138141    // it is all about energy
    139     float                energy;
    140     float                energyLoaded;
    141     float                energyMax;
    142     float                energyLoadedMax;
    143     float                minCharge;
    144     float                maxCharge;
     142    float                energy;                           //!< The energy stored in the weapons secondary buffers (reserve)
     143    float                energyLoaded;                     //!< The energy stored in the weapons primary buffers (firewithout reload)
     144    float                energyMax;                        //!< The maximal energy that can be stored in the secondary buffers (reserveMax)
     145    float                energyLoadedMax;                  //!< The maximal energy that can be stored in the primary buffers
     146    float                minCharge;                        //!< The minimal energy to be loaded onto one projectile if chargeable otherwise the power consumed by one projectile
     147    float                maxCharge;                        //!< The maximal energy to be loaded onto one projectile (this is only availible if chargeable is enabled)
    145148
    146149    ////////////
     
    156159
    157160
     161    bool                 active;                          //!< states wheter the weapon is enabled or not
    158162    bool                 hideInactive;                    //!< Hides the Weapon if it is inactive
     163    bool                 chargeable;                      //!< if the Weapon is charcheable
    159164
    160     bool                 active;                          //!< states wheter the weapon is enabled or not
    161165    Projectile*          projectile;                      //!< the projectile used for this weapon
    162166  };
Note: See TracChangeset for help on using the changeset viewer.