Changeset 680 for code/branches/FICN/src/orxonox/objects/weapon_system
- Timestamp:
- Dec 24, 2007, 12:10:18 AM (17 years ago)
- Location:
- code/branches/FICN/src/orxonox/objects/weapon_system
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/objects/weapon_system/BaseWeapon.cc
r668 r680 47 47 //CreateFactory(BaseWeapon); 48 48 49 float BaseWeapon::nextActionValidityPeriod_ = 0.5;49 float BaseWeapon::nextActionValidityPeriod_s = 0.5; 50 50 51 51 BaseWeapon::BaseWeapon() 52 52 : sceneMgr_(Orxonox::getSingleton()->getSceneManager()), 53 bulletCounter_(0), primaryFireRequest_(false), currentState_(IDLE), 54 secondaryFireRequest_(false), 53 bulletCounter_(0), 55 54 bulletManager_(Orxonox::getSingleton()->getBulletMgr()), 56 secondaryFired_(false), 57 timeSinceNextActionAdded_(0), actionAdded_(false), nextAction_(NOTHING), 58 ammoDump_(NULL), totalTime_(0.0), leftAmmo_(0) 55 ammoDump_(NULL), 56 primaryFireRequest_(false), secondaryFireRequest_(false), 57 totalTime_(0.0f), actionStartTime_(0.0f), 58 currentState_(IDLE), secondaryFired_(false), 59 nextAction_(NOTHING), actionAdded_(false), 60 timeSinceNextActionAdded_(0.0f), 61 leftAmmo_(0) 59 62 { 60 63 RegisterObject(BaseWeapon); … … 102 105 } 103 106 104 if (currentState_ != IDLE)107 switch (currentState_) 105 108 { 106 switch (currentState_) 107 { 108 case PRIMARY_FIRE: 109 primaryFiring(totalTime_ - actionStartTime_); 110 break; 109 case IDLE: 110 break; 111 111 112 case SECONDARY_FIRE:113 secondaryFiring(totalTime_ - actionStartTime_);114 112 case PRIMARY_FIRE: 113 primaryFiring(totalTime_ - actionStartTime_); 114 break; 115 115 116 case RELOADING: 117 break; 116 case SECONDARY_FIRE: 117 secondaryFiring(totalTime_ - actionStartTime_); 118 break; 118 119 119 case CHANGING_AMMO: 120 break; 121 } 120 case RELOADING: 121 break; 122 123 case CHANGING_AMMO: 124 break; 122 125 } 123 126 … … 170 173 secondaryFireRequest_ = false; 171 174 172 if (totalTime_ - timeSinceNextActionAdded_ > nextActionValidityPeriod_ )175 if (totalTime_ - timeSinceNextActionAdded_ > nextActionValidityPeriod_s) 173 176 nextAction_ = NOTHING; 174 177 } -
code/branches/FICN/src/orxonox/objects/weapon_system/BaseWeapon.h
r673 r680 108 108 bool actionAdded_; 109 109 float timeSinceNextActionAdded_; 110 static float nextActionValidityPeriod_ ;110 static float nextActionValidityPeriod_s; 111 111 112 112 // weapon properties -
code/branches/FICN/src/orxonox/objects/weapon_system/BulletManager.cc
r668 r680 37 37 CreateFactory(BulletManager); 38 38 39 BulletManager::BulletManager() : bullets Index_(0), bulletsSize_(8)39 BulletManager::BulletManager() : bulletsSize_(8), bulletsIndex_(0) 40 40 { 41 41 RegisterObject(BulletManager); -
code/branches/FICN/src/orxonox/objects/weapon_system/WeaponStation.cc
r668 r680 42 42 43 43 WeaponStation::WeaponStation(int stationSize) 44 : s tationSize_(stationSize), lastActiveSlotIndex_(-1),45 slots_(new BaseWeapon*[stationSize])44 : slots_(new BaseWeapon*[stationSize]), 45 lastActiveSlotIndex_(-1), stationSize_(stationSize) 46 46 { 47 47 //slots_ = new BaseWeapon*[stationSize]; … … 59 59 bool WeaponStation::addWeapon(BaseWeapon *weapon) 60 60 { 61 if (lastActiveSlotIndex_ = stationSize_ - 1)61 if (lastActiveSlotIndex_ == stationSize_ - 1) 62 62 return false; 63 63
Note: See TracChangeset
for help on using the changeset viewer.