- Timestamp:
- Dec 10, 2008, 9:20:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/weapon2/src/orxonox/objects/weaponSystem/Weapon.cc
r2393 r2398 45 45 this->magazineReadyToShoot_ = true; 46 46 this->parentWeaponSystem_ = 0; 47 this-> parentWeaponSlot_ = 0;47 this->attachedToWeaponSlot_ = 0; 48 48 this->munition_ = 0; 49 49 this->bulletLoadingTime_ = 0; … … 61 61 SUPER(Weapon, XMLPort, xmlelement, mode); 62 62 XMLPortParam(Weapon, "munitionType", setMunitionType, getMunitionType, xmlelement, mode); 63 XMLPortParam(Weapon, "bulletLoadingTime", setBulletLoadingTime, getBulletLoadingTime, xmlelement, mode); 64 XMLPortParam(Weapon, "magazineLoadingTime", setMagazineLoadingTime, getMagazineLoadingTime, xmlelement, mode); 63 65 } 64 66 65 67 void Weapon::setWeapon() 66 68 { 67 COUT(0) << "LaserGun::setWeapon" << std::endl;68 this->bulletLoadingTime_ = 0.5;69 this->magazineLoadingTime_ = 3.0;70 this->munition_->setMaxMagazines(100);71 this->munition_->setMaxBullets(6);72 69 this->munition_->fillBullets(); 73 70 this->munition_->fillMagazines(); … … 165 162 166 163 void Weapon::setMunitionType(std::string munitionType) 167 { 168 COUT(0) << "Weapon::setMunitionType (XMLPort) "<< munitionType << std::endl; 169 this->munitionType_ = munitionType; } 164 { this->munitionType_ = munitionType; } 170 165 171 166 const std::string Weapon::getMunitionType() 172 167 { return this->munitionType_; } 168 169 void Weapon::setBulletLoadingTime(float loadingTime) 170 { this->bulletLoadingTime_ = loadingTime; } 171 172 const float Weapon::getBulletLoadingTime() 173 { return this->bulletLoadingTime_; } 174 175 void Weapon::setMagazineLoadingTime(float loadingTime) 176 { this->magazineLoadingTime_ = loadingTime; } 177 178 const float Weapon::getMagazineLoadingTime() 179 { return this->magazineLoadingTime_; } 180 173 181 174 182 Munition * Weapon::getAttachedMunition(std::string munitionType) … … 179 187 return this->munition_; } 180 188 181 182 183 void Weapon::setBulletLoadingTime(float loadingTime)184 { this->bulletLoadingTime_ = loadingTime; }185 186 float Weapon::getBulletLoadingTime()187 { return this->bulletLoadingTime_; }188 189 void Weapon::setMagazineLoadingTime(float loadingTime)190 { this->magazineLoadingTime_ = loadingTime; }191 192 float Weapon::getMagazineLoadingTime()193 { return this->magazineLoadingTime_; }194 195 196 Timer<Weapon> * Weapon::getBulletTimer()197 { return &this->bulletReloadTimer_; }198 199 Timer<Weapon> * Weapon::getMagazineTimer()200 { return &this->magazineReloadTimer_; }201 202 189 void Weapon::takeBullets() { }; 203 190 void Weapon::createProjectile() { };
Note: See TracChangeset
for help on using the changeset viewer.