- Timestamp:
- Nov 19, 2008, 7:07:36 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/weapon2/src/orxonox/objects/weaponSystem/Weapon.cc
r2203 r2232 40 40 { 41 41 RegisterObject(Weapon); 42 this->weaponReadyToShoot_ = true; 42 this->bulletReadyToShoot_ = true; 43 this->magazineReadyToShoot_ = true; 43 44 this->setParentWeaponSystem(); 44 45 } … … 51 52 void Weapon::XMLPort(Element& xmlelement, XMLPort::Mode mode) 52 53 { 53 54 SUPER(Weapon, XMLPort, xmlelement, mode); 54 55 } 55 56 … … 58 59 59 60 } 60 void Weapon::timer() 61 62 63 void Weapon::bulletTimer() 61 64 { 62 this->reloadTimer_.setTimer( this->loadingTime_ , false , this , createExecutor(createFunctor(&Weapon::reloaded))); 65 this->bulletReloadTimer_.setTimer( this->bulletLoadingTime_ , false , this , createExecutor(createFunctor(&Weapon::bulletReloaded))); 66 } 67 void Weapon::magazineTimer() 68 { 69 this->magazineReloadTimer_.setTimer( this->magazineLoadingTime_ , false , this , createExecutor(createFunctor(&Weapon::magazineReloaded))); 63 70 } 64 71 65 void Weapon:: reloaded()66 { 72 void Weapon::bulletReloaded() 73 { this->bulletReadyToShoot_ = true; } 67 74 68 this->weaponReadyToShoot_ = true; 69 } 75 void Weapon::magazineReloaded() 76 { this->magazineReadyToShoot_ = true; } 77 70 78 71 79 void Weapon::attachNeededMunition(std::string munitionName) 72 80 { 73 //if munition type already exist attach it, else create a new one of this type and attach it to the weapon and to the WeaponSystem81 //if munition type already exists attach it, else create a new one of this type and attach it to the weapon and to the WeaponSystem 74 82 if ( this->parentWeaponSystem_->getMunitionType(munitionName) ) 75 83 this->munition_ = this->parentWeaponSystem_->getMunitionType(munitionName); … … 93 101 { return this->munition_; } 94 102 95 void Weapon::set LoadingTime(float loadingTime)96 { this-> loadingTime_ = loadingTime; }103 void Weapon::setBulletLoadingTime(float loadingTime) 104 { this->bulletLoadingTime_ = loadingTime; } 97 105 98 float Weapon::get LoadingTime()99 { return this-> loadingTime_; }106 float Weapon::getBulletLoadingTime() 107 { return this->bulletLoadingTime_; } 100 108 101 void Weapon::set WeaponReadyToShoot(bool b)102 { this-> weaponReadyToShoot_ = b; }109 void Weapon::setMagazineLoadingTime(float loadingTime) 110 { this->magazineLoadingTime_ = loadingTime; } 103 111 104 bool Weapon::getWeaponReadyToShoot() 105 { return this->weaponReadyToShoot_; } 106 Timer<Weapon> * Weapon::getTimer() 107 { return &this->reloadTimer_; } 112 float Weapon::getMagazineLoadingTime() 113 { return this->magazineLoadingTime_; } 114 115 void Weapon::setBulletReadyToShoot(bool b) 116 { this->bulletReadyToShoot_ = b; } 117 118 bool Weapon::getBulletReadyToShoot() 119 { return this->bulletReadyToShoot_; } 120 121 void Weapon::setMagazineReadyToShoot(bool b) 122 { this->magazineReadyToShoot_ = b; } 123 124 bool Weapon::getMagazineReadyToShoot() 125 { return this->magazineReadyToShoot_; } 126 127 Timer<Weapon> * Weapon::getBulletTimer() 128 { return &this->bulletReloadTimer_; } 129 130 Timer<Weapon> * Weapon::getMagazineTimer() 131 { return &this->magazineReloadTimer_; } 108 132 }
Note: See TracChangeset
for help on using the changeset viewer.