Changeset 1494 for code/branches/network/src/orxonox/objects/weapon
- Timestamp:
- May 31, 2008, 11:24:44 PM (17 years ago)
- Location:
- code/branches/network/src/orxonox/objects/weapon
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/orxonox/objects/weapon/AmmunitionDump.cc
- Property svn:eol-style set to native
-
code/branches/network/src/orxonox/objects/weapon/AmmunitionDump.h
- Property svn:eol-style set to native
-
code/branches/network/src/orxonox/objects/weapon/BarrelGun.cc
- Property svn:eol-style set to native
-
code/branches/network/src/orxonox/objects/weapon/BarrelGun.h
- Property svn:eol-style set to native
-
code/branches/network/src/orxonox/objects/weapon/BaseWeapon.cc
- Property svn:eol-style set to native
-
code/branches/network/src/orxonox/objects/weapon/BaseWeapon.h
- Property svn:eol-style set to native
r1056 r1494 1 1 /* 2 2 * ORXONOX - the hottest 3D action shooter ever to exist 3 * > www.orxonox.net < 4 * 3 * > www.orxonox.net < * 5 4 * 6 5 * License notice: … … 26 25 * 27 26 */ 28 29 30 #ifndef _BaseWeapon_H__ 31 #define _BaseWeapon_H__ 32 33 #include "OrxonoxPrereqs.h" 34 35 #include <OgrePrerequisites.h> 36 37 #include "../Model.h" 38 39 40 namespace orxonox { 41 class _OrxonoxExport BaseWeapon : public Model 42 { 43 public: 44 enum Action { 45 NOTHING = 0, 46 RELOAD = 1, 47 CHANGE_AMMO = 2, 48 SPECIAL = 3 49 }; 50 51 protected: 52 enum State { 53 IDLE = 0, 54 PRIMARY_FIRE = 1, 55 SECONDARY_FIRE = 2, 56 RELOADING = 3, 57 CHANGING_AMMO = 4, 58 }; 59 60 public: 61 BaseWeapon(); 62 virtual ~BaseWeapon(); 63 64 bool addAction(const Action); 65 66 void primaryFireRequest(); 67 68 void secondaryFireRequest(); 69 70 int getAmmoState(); 71 72 void setAmmoDump(AmmunitionDump*); 73 74 inline virtual void loadParams(TiXmlElement* xmlElem) { Model::loadParams(xmlElem); }; 75 76 virtual void tick(float dt); 77 78 protected: 79 virtual void primaryFire() = 0; 80 81 virtual void primaryFiring(float) = 0; 82 83 virtual void secondaryFire() = 0; 84 85 virtual void secondaryFiring(float) = 0; 86 87 virtual void registerAllVariables() { }; 88 89 public: 90 91 protected: 92 Ogre::SceneManager *sceneMgr_; 93 94 int bulletCounter_; 95 BulletManager *bulletManager_; 96 97 AmmunitionDump *ammoDump_; 98 99 bool primaryFireRequest_; 100 bool secondaryFireRequest_; 101 102 float totalTime_; 103 float actionStartTime_; 104 105 State currentState_; 106 bool secondaryFired_; 107 108 Action nextAction_; 109 bool actionAdded_; 110 float timeSinceNextActionAdded_; 111 static float nextActionValidityPeriod_s; 112 113 // weapon properties 114 int leftAmmo_; 115 float primaryFirePower_; 116 float secondaryFirePower_; 117 float primaryFiringRate_; 118 float secondaryFiringRate_; 119 Real primaryBulletSpeed_; 120 Real secondaryBulletSpeed_; 121 122 int magazineSize_; 123 124 }; 125 } 126 127 #endif /* _BaseWeapon_H__ */ 27 #ifndef _BaseWeapon_H__#define _BaseWeapon_H__#include "OrxonoxPrereqs.h"#include <OgrePrerequisites.h>#include "../Model.h"namespace orxonox { class _OrxonoxExport BaseWeapon : public Model { public: enum Action { NOTHING = 0, RELOAD = 1, CHANGE_AMMO = 2, SPECIAL = 3 }; protected: enum State { IDLE = 0, PRIMARY_FIRE = 1, SECONDARY_FIRE = 2, RELOADING = 3, CHANGING_AMMO = 4, }; public: BaseWeapon(); virtual ~BaseWeapon(); bool addAction(const Action); void primaryFireRequest(); void secondaryFireRequest(); int getAmmoState(); void setAmmoDump(AmmunitionDump*); inline virtual void loadParams(TiXmlElement* xmlElem) { Model::loadParams(xmlElem); }; virtual void tick(float dt); protected: virtual void primaryFire() = 0; virtual void primaryFiring(float) = 0; virtual void secondaryFire() = 0; virtual void secondaryFiring(float) = 0; virtual void registerAllVariables() { }; public: protected: Ogre::SceneManager *sceneMgr_; int bulletCounter_; BulletManager *bulletManager_; AmmunitionDump *ammoDump_; bool primaryFireRequest_; bool secondaryFireRequest_; float totalTime_; float actionStartTime_; State currentState_; bool secondaryFired_; Action nextAction_; bool actionAdded_; float timeSinceNextActionAdded_; static float nextActionValidityPeriod_s; // weapon properties int leftAmmo_; float primaryFirePower_; float secondaryFirePower_; float primaryFiringRate_; float secondaryFiringRate_; Real primaryBulletSpeed_; Real secondaryBulletSpeed_; int magazineSize_; };}#endif /* _BaseWeapon_H__ */ -
code/branches/network/src/orxonox/objects/weapon/Bullet.cc
- Property svn:eol-style set to native
-
code/branches/network/src/orxonox/objects/weapon/Bullet.h
- Property svn:eol-style set to native
-
code/branches/network/src/orxonox/objects/weapon/BulletManager.cc
- Property svn:eol-style set to native
-
code/branches/network/src/orxonox/objects/weapon/BulletManager.h
- Property svn:eol-style set to native
-
code/branches/network/src/orxonox/objects/weapon/WeaponStation.cc
- Property svn:eol-style set to native
-
code/branches/network/src/orxonox/objects/weapon/WeaponStation.h
- Property svn:eol-style set to native
Note: See TracChangeset
for help on using the changeset viewer.