Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 17, 2005, 2:37:41 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: the energy system works

File:
1 edited

Legend:

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

    r4881 r4882  
    9999    inline WeaponState getCurrentState() const { return this->currentState; };
    100100
    101 
     101    inline void setMaximumEnergy(float energyMax, float energyLoadedMax = 0.0) { this->energyMax = energyMax; this->energyLoadedMax = energyLoadedMax; };
    102102
    103103    virtual void destroy();
    104104
    105105
    106 
     106    // FLOW
    107107    virtual void tick(float dt);
    108108    virtual void draw();
    109109
     110    void debug() const;
     111
    110112  protected:
     113    // utility:
    111114    static WeaponAction  charToAction(const char* action);
     115    static const char*   actionToChar(WeaponAction action);
    112116    static WeaponState   charToState(const char* state);
     117    static const char*   stateToChar(WeaponState state);
    113118
    114 
     119    //! ACTION: these functions are handled by the Weapon itself, and must be called by requestAction(WeaponAction);
    115120    bool execute();
    116121    virtual void activate();
     
    125130  protected:
    126131    SoundSource*         weaponSource;
     132    // it is all about energy
    127133    float                energy;
    128     int                  energyI;
     134    float                energyLoaded;
     135    float                energyMax;
     136    float                energyLoadedMax;
     137    float                minCharge;
     138    float                maxCharge;
    129139
    130140    ////////////
     
    138148    Animation3D*         animation[WS_STATE_COUNT];        //!< Animations for all the States (you can say yourself on what part of the gun this animation acts).
    139149
    140     float                minCharge;
    141     float                maxCharge;
    142150
    143151    bool                 hideInactive;                    //!< Hides the Weapon if it is inactive
Note: See TracChangeset for help on using the changeset viewer.