Changeset 2354 for code/branches
- Timestamp:
- Dec 8, 2008, 2:36:47 PM (16 years ago)
- Location:
- code/branches/weapon2/src/orxonox/objects/weaponSystem
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/weapon2/src/orxonox/objects/weaponSystem/Weapon.cc
r2347 r2354 111 111 this->munitionType_ = munitionType; } 112 112 113 std::string Weapon::getMunitionType()113 const std::string Weapon::getMunitionType() 114 114 { return this->munitionType_; } 115 115 116 116 Munition * Weapon::getAttachedMunition(std::string munitionType) 117 117 { 118 COUT(0) << "Weapon::getAttachedMunition, parentWeaponSystem_="<< this->parentWeaponSystem_ << std::endl; 119 this-> parentWeaponSystem_->getMunitionType(munitionType);118 COUT(0) << "Weapon::getAttachedMunition, parentWeaponSystem_="<< this->parentWeaponSystem_ << std::endl; 119 this->munition_ = this->parentWeaponSystem_->getMunitionType(munitionType); 120 120 COUT(0) << "Weapon::getAttachedMunition, munition_="<< this->munition_ << std::endl; 121 121 return this->munition_; } -
code/branches/weapon2/src/orxonox/objects/weaponSystem/Weapon.h
r2337 r2354 71 71 72 72 void setMunitionType(std::string munitionType); 73 std::string getMunitionType();73 const std::string getMunitionType(); 74 74 75 75 inline void setParentWeaponSlot(WeaponSlot *parentWeaponSlot) -
code/branches/weapon2/src/orxonox/objects/weaponSystem/WeaponPack.cc
r2347 r2354 59 59 } 60 60 61 void WeaponPack::attachWeapon(Weapon *weapon)62 {63 this->weapons_.push_back(weapon);64 }65 66 61 void WeaponPack::fire() 67 62 { … … 86 81 void WeaponPack::setFireMode(unsigned int firemode) 87 82 { 83 COUT(0) << "WeaponPack::setFireMode " << std::endl; 88 84 this->firemode_ = firemode; 89 85 } … … 97 93 { 98 94 weapon->setParentWeaponSystem(this->parentWeaponSystem_); 99 COUT(0) << "WeaponPack::addWeapon " << weapon ->getMunitionType() << std::endl;95 COUT(0) << "WeaponPack::addWeapon " << weapon << " munition " << weapon->getMunitionType() << std::endl; 100 96 this->weapons_.push_back(weapon); 101 97 } 102 98 103 Weapon * WeaponPack::getWeapon(unsigned int index)99 const Weapon * WeaponPack::getWeapon(unsigned int index) 104 100 { 105 101 return weapons_[index]; -
code/branches/weapon2/src/orxonox/objects/weaponSystem/WeaponPack.h
r2337 r2354 52 52 Weapon * getWeaponPointer(unsigned int n); 53 53 int getSize(); 54 void attachWeapon(Weapon *weapon);55 54 56 55 void setFireMode(unsigned int firemode); … … 58 57 59 58 void addWeapon(Weapon * weapon); 60 Weapon * getWeapon(unsigned int index);59 const Weapon * getWeapon(unsigned int index); 61 60 62 61 void setWeaponSystemToAllWeapons(WeaponSystem * weaponSystem); -
code/branches/weapon2/src/orxonox/objects/weaponSystem/weapons/LaserGun.cc
r2347 r2354 83 83 void LaserGun::XMLPort(Element& xmlelement, XMLPort::Mode mode) 84 84 { 85 85 SUPER(LaserGun, XMLPort, xmlelement, mode); 86 XMLPortParam(LaserGun, "munitionType", setMunitionType, getMunitionType, xmlelement, mode); 86 87 } 87 88 89 void LaserGun::setMunitionType(std::string munitionType) 90 { 91 COUT(0) << "LaserGun::setMunitionType (XMLPort) "<< munitionType << std::endl; 92 this->munitionType_ = munitionType; } 88 93 94 const std::string LaserGun::getMunitionType() 95 { return this->munitionType_; } 89 96 90 97 } -
code/branches/weapon2/src/orxonox/objects/weaponSystem/weapons/LaserGun.h
r2331 r2354 52 52 void fire(); 53 53 54 void setMunitionType(std::string munitionType); 55 const std::string getMunitionType(); 56 54 57 private: 55 58 float speed_;
Note: See TracChangeset
for help on using the changeset viewer.