Changeset 4892 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons/weapon.h
- Timestamp:
- Jul 19, 2005, 4:59:58 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/weapon.h
r4891 r4892 19 19 #define _WEAPON_H 20 20 21 #include "base_object.h"22 21 #include "world_entity.h" 23 22 … … 91 90 Projectile* getProjectile() { return this->projectile; }; 92 91 92 void setEmissionPoint(const Vector& point); 93 /** @see void setEmissionPoint(const Vector& point); */ 94 inline void setEmissionPoint(float x, float y, float z) { this->setEmissionPoint(Vector(x,y,z)); }; 95 93 96 /** @param state the State to time @param duration the duration of the State */ 94 97 inline void setStateDuration(const char* state, float duration) { setStateDuration(charToState(state), duration); }; … … 101 104 /** @returns the current State of the Weapon */ 102 105 inline WeaponState getCurrentState() const { return this->currentState; }; 106 103 107 /** @param energyMax the maximum energy the Weapon can have @param energyLoadedMax the maximum energy in the weapon buffers */ 104 108 inline void setMaximumEnergy(float energyMax, float energyLoadedMax = 0.0) { this->energyMax = energyMax; this->energyLoadedMax = energyLoadedMax; }; … … 108 112 void setActionSound(const char* action, const char* soundFile) { this->setActionSound(charToAction(action), soundFile); }; 109 113 110 virtual void destroy();111 114 112 115 … … 120 123 protected: 121 124 //! ACTION: these functions are handled by the Weapon itself, and must be called by requestAction(WeaponAction); 122 bool execute();123 virtual void activate();124 virtual void deactivate();125 virtual void fire() ;126 virtual void reload() ;127 virtual void charge();125 virtual void activate() {}; 126 virtual void deactivate() {}; 127 virtual void charge() {}; 128 virtual void fire() {}; 129 virtual void reload() {}; 130 virtual void destroy() {}; 128 131 129 132 … … 136 139 137 140 private: 141 /** executive functions, that handle timing with actions. 142 * This is for the action-functions in derived functions to be easy 143 * The main function is execute, that calls all the other functions 144 * for being fast, the Functions are private and as such will be inlined 145 * into the execute function. (this is work of the compiler) 146 */ 147 bool execute(); 148 bool activateW(); 149 bool deactivateW(); 150 bool chargeW(); 151 bool fireW(); 152 bool reloadW(); 153 138 154 bool nextActionValid() const; 139 155 … … 161 177 SoundBuffer* soundBuffers[WA_ACTION_COUNT]; //!< SoundBuffers for all actions @see WeaponAction. 162 178 179 PNode emissionPoint; //!< The point, where the projectiles are emitted. (this is coppled with the Weapon by default) 163 180 164 181 bool active; //!< states wheter the weapon is enabled or not
Note: See TracChangeset
for help on using the changeset viewer.