Changeset 4834 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons/weapon_manager.cc
- Timestamp:
- Jul 11, 2005, 5:47:23 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/weapon_manager.cc
r4833 r4834 19 19 #include "weapon_manager.h" 20 20 #include "weapon.h" 21 21 #include "crosshair.h" 22 23 #include "load_param.h" 24 #include "factory.h" 22 25 #include "vector.h" 23 26 #include "list.h" … … 53 56 this->configs[i].slots[j] = NULL; 54 57 } 55 } 56 58 59 // crosshair being a PNode it must not be deleted (this is because PNodes delete themselves.) 60 //delete this->crosshair; 61 } 62 63 /** 64 * initializes the WeaponManager 65 */ 57 66 void WeaponManager::init() 58 67 { … … 66 75 } 67 76 this->currConfID = W_CONFIG0; 68 77 this->crosshair = new Crosshair(); 78 } 79 80 /** 81 * 82 * @param root the XML-element to load from 83 */ 84 void WeaponManager::loadParams(const TiXmlElement* root) 85 { 86 static_cast<BaseObject*>(this)->loadParams(root); 87 88 LoadParam<WeaponManager>(root, "slot-count", this, &WeaponManager::setSlotCount) 89 .describe("how many slots(cannons) the WeaponManager can handle"); 90 91 LOAD_PARAM_START_CYCLE; 92 93 LoadParam<WeaponManager>(root, "Weapons", this, &WeaponManager::loadWeapons) 94 .describe("loads Weapons"); 95 // LoadParam<WeaponManager>(root, "Weapon", this, &WeaponManager::addWeapon); 96 97 LOAD_PARAM_END_CYCLE; 98 } 99 100 /** 101 * loads a Weapon onto the WeaponManager 102 * @param root the XML-element to load the Weapons from 103 */ 104 void WeaponManager::loadWeapons(const TiXmlElement* root) 105 { 106 LOAD_PARAM_START_CYCLE; 107 108 Weapon* newWeapon = dynamic_cast<Weapon*>(Factory::getFirst()->fabricate(element)); 109 110 111 112 LOAD_PARAM_END_CYCLE; 113 } 114 115 116 /** 117 * sets the number of Slots the WeaponManager has 118 * @param nrOfSlots the number of slots 119 */ 120 void WeaponManager::setSlotCount(int nrOfSlots) 121 { 122 this->nrOfSlots = nrOfSlots; 69 123 } 70 124 … … 100 154 } 101 155 102 156 /** 157 * removes a Weapon from the WeaponManager 158 */ 103 159 void WeaponManager::removeWeapon(Weapon* weapon, int configID) 104 160 { … … 163 219 if( firingWeapon != NULL) firingWeapon->fire(); 164 220 } 221 this->crosshair->setRotationSpeed(-500); 165 222 } 166 223 … … 178 235 if( w != NULL) w->tick(dt); 179 236 } 237 238 crosshair->tick(dt); 239 crosshair->setRotationSpeed(5); 180 240 } 181 241 … … 193 253 w->draw(); 194 254 } 255 crosshair->draw(); 195 256 } 196 257
Note: See TracChangeset
for help on using the changeset viewer.