- Timestamp:
- Nov 26, 2008, 7:42:29 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/weapon2/src/orxonox/objects/weaponSystem/WeaponSet.cc
r2232 r2288 35 35 36 36 #include "WeaponSet.h" 37 #include "WeaponPack.h" 37 38 38 39 namespace orxonox … … 44 45 this->parentWeaponSystem_ = 0; 45 46 46 /* will be made with XML47 for (int i=0;i<k;i++)48 {49 attachWeaponSlot(new WeaponSlot(this));50 }51 */52 47 } 53 48 … … 56 51 } 57 52 58 void WeaponSet::attachWeapon Slot(WeaponSlot *wSlot)53 void WeaponSet::attachWeaponPack(WeaponPack *wPack) 59 54 { 60 this->weaponSlots_.push_back(wSlot); 55 if (this->parentWeaponSystem_->getWeaponSlotSize()>0 && wPack->getSize()>0 && ( wPack->getSize() <= this->parentWeaponSystem_->getWeaponSlotSize() ) ) 56 { 57 //should be possible to choose which slot to use 58 for ( int i=0; i < wPack->getSize() ; i++ ) 59 { 60 this->parentWeaponSystem_->getWeaponSlotPointer(i)->attachWeapon( wPack->getWeaponPointer(i) ); 61 } 62 } 61 63 } 62 64 65 /* this function will be in WeaponPack 63 66 void WeaponSet::fire() 64 67 { 65 68 for (int i=0; i < (int) this->weaponSlots_.size(); i++) 66 69 { 70 COUT(0) << "WeaponSlot::fire"<< i << std::endl; 67 71 this->weaponSlots_[i]->fire(); 68 72 } 69 73 } 70 71 WeaponSlot * WeaponSet::getWeaponSlotPointer(unsigned int n) 72 { 73 if (n < this->weaponSlots_.size()) 74 return this->weaponSlots_[n]; 75 else 76 return 0; 77 } 78 74 */ 79 75 80 76 void WeaponSet::XMLPort(Element& xmlelement, XMLPort::Mode mode)
Note: See TracChangeset
for help on using the changeset viewer.