Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Nov 24, 2005, 12:13:22 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the WorldEntities into the Trunk.
Merged with command:
svn merge branches/world_entities/ trunk/ -r5516:HEAD

conflics from world_entities changed in favor of branches/world_entity
all other conflict in favor of the trunk

File:
1 edited

Legend:

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

    r5500 r5750  
    8181  public:
    8282    // INITIALISATION //
    83     Weapon (WeaponManager* weaponManager = NULL);
     83    Weapon ();
    8484    virtual ~Weapon ();
    8585
     
    9393    ///////////////////
    9494
    95     /** @param weaponManager sets the WeaponManager for this Weapon (NULL if free)) */
    96     inline void setWeaponManager(WeaponManager* weaponManager) { this->weaponManager = weaponManager; };
    97     /** @returns the WeaponManager of this Weapon (or NULL if it is free) */
    98     inline WeaponManager* getWeaponManager() const { return this->weaponManager; };
    99 
    10095    /** @returns true if the Weapon is Active  (this is used to check if the weapon must be drawn)*/
    101     inline bool isActive() const { return (this->currentState == WS_INACTIVE)?false:true; };
     96    inline bool isActive() const { return (this->currentState == WS_INACTIVE)? false : true; };
    10297    /** @returns true if the weapon must be drawn */
    103     inline bool isVisible() const { return (this->currentState != WS_INACTIVE || !this->hideInactive)?true:false; };
     98    inline bool isVisible() const { return (this->currentState != WS_INACTIVE || !this->hideInactive) ? true : false; };
    10499    /** @returns true if the Weapon is chargeable */
    105100    inline bool isChargeable() const { return this->chargeable; };
     
    120115
    121116
     117    // EMISSION
    122118    void setEmissionPoint(const Vector& point);
    123119    /** @see void setEmissionPoint(const Vector& point); */
     
    126122    inline const Vector& getEmissionPoint() const { return this->emissionPoint.getAbsCoor(); };
    127123
     124    // STATE CHANGES //
    128125    /** @param state the State to time @param duration the duration of the State */
    129126    inline void setStateDuration(const char* state, float duration) { setStateDuration(charToState(state), duration); };
     
    131128    inline void setStateDuration(WeaponState state, float duration) { /*(state < WS_STATE_COUNT)?*/this->times[state] = duration; };
    132129    /** @param state The state to query @returns the Time the queried State takes to complete */
    133     inline float getStateDuration(WeaponState state) const { return (state < WS_STATE_COUNT)?this->times[state]:0.0; };
     130    inline float getStateDuration(WeaponState state) const { return (state < WS_STATE_COUNT)? this->times[state] : 0.0; };
    134131    /** @returns true if the time of the currentState is elapsed, false otherwise */
    135     inline bool stateTimeElapsed() const { return (this->stateDuration > this->times[currentState])?true:false; };
     132    inline bool stateTimeElapsed() const { return (this->stateDuration > this->times[currentState])? true : false; };
    136133    /** @returns the current State of the Weapon */
    137134    inline WeaponState getCurrentState() const { return this->currentState; };
     
    149146    // FLOW
    150147    void tickW(float dt); //!< this is a function that must be called by the weaponManager, or any other weaponHandler, all other functions are handled from within
     148
    151149    virtual void tick(float dt) {};
    152150    virtual void draw() const;
     
    194192    // it is all about energy
    195193    float                energy;                           //!< The energy stored in the weapons secondary buffers (reserve)
    196     float                energyLoaded;                     //!< The energy stored in the weapons primary buffers (firewithout reload)
     194    float                energyLoaded;                     //!< The energy stored in the weapons primary buffers (fire without reload)
    197195    float                energyMax;                        //!< The maximal energy that can be stored in the secondary buffers (reserveMax)
    198196    float                energyLoadedMax;                  //!< The maximal energy that can be stored in the primary buffers
     
    220218    ClassID              projectile;                      //!< the projectile used for this weapon (since they should be generated via macro and the FastFactory, only the ClassID must be known.)
    221219    FastFactory*         projectileFactory;               //!< A factory, that produces and handles the projectiles.
    222 
    223     WeaponManager*       weaponManager;                   //!< The weaponManager this weapon is connected to. if NULL it is assumed, that the weapon is freely connected to an entity without a binding WeaponManager.
    224220  };
    225221
Note: See TracChangeset for help on using the changeset viewer.