Changeset 5750 in orxonox.OLD for trunk/src/world_entities/weapons/weapon.h
- Timestamp:
- Nov 24, 2005, 12:13:22 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/weapons/weapon.h
r5500 r5750 81 81 public: 82 82 // INITIALISATION // 83 Weapon ( WeaponManager* weaponManager = NULL);83 Weapon (); 84 84 virtual ~Weapon (); 85 85 … … 93 93 /////////////////// 94 94 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 100 95 /** @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; }; 102 97 /** @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; }; 104 99 /** @returns true if the Weapon is chargeable */ 105 100 inline bool isChargeable() const { return this->chargeable; }; … … 120 115 121 116 117 // EMISSION 122 118 void setEmissionPoint(const Vector& point); 123 119 /** @see void setEmissionPoint(const Vector& point); */ … … 126 122 inline const Vector& getEmissionPoint() const { return this->emissionPoint.getAbsCoor(); }; 127 123 124 // STATE CHANGES // 128 125 /** @param state the State to time @param duration the duration of the State */ 129 126 inline void setStateDuration(const char* state, float duration) { setStateDuration(charToState(state), duration); }; … … 131 128 inline void setStateDuration(WeaponState state, float duration) { /*(state < WS_STATE_COUNT)?*/this->times[state] = duration; }; 132 129 /** @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; }; 134 131 /** @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; }; 136 133 /** @returns the current State of the Weapon */ 137 134 inline WeaponState getCurrentState() const { return this->currentState; }; … … 149 146 // FLOW 150 147 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 151 149 virtual void tick(float dt) {}; 152 150 virtual void draw() const; … … 194 192 // it is all about energy 195 193 float energy; //!< The energy stored in the weapons secondary buffers (reserve) 196 float energyLoaded; //!< The energy stored in the weapons primary buffers (fire without reload)194 float energyLoaded; //!< The energy stored in the weapons primary buffers (fire without reload) 197 195 float energyMax; //!< The maximal energy that can be stored in the secondary buffers (reserveMax) 198 196 float energyLoadedMax; //!< The maximal energy that can be stored in the primary buffers … … 220 218 ClassID projectile; //!< the projectile used for this weapon (since they should be generated via macro and the FastFactory, only the ClassID must be known.) 221 219 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.224 220 }; 225 221
Note: See TracChangeset
for help on using the changeset viewer.