Changeset 7337 in orxonox.OLD for trunk/src/world_entities/playable.cc
- Timestamp:
- Apr 19, 2006, 12:24:20 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/playable.cc
r7193 r7337 39 39 40 40 Playable::Playable() 41 : weaponMan(this) 41 42 { 42 43 this->setClassID(CL_PLAYABLE, "Playable"); … … 44 45 45 46 this->toList(OM_GROUP_01); 46 this->weaponMan = new WeaponManager(this);47 47 48 48 // the reference to the Current Player is NULL, because we dont have one at the beginning. … … 64 64 Playable::~Playable() 65 65 { 66 delete this->weaponMan;67 68 66 // THE DERIVED CLASS MUST UNSUBSCRIBE THE PLAYER THROUGH 69 67 // this->setPlayer(NULL); … … 77 75 WorldEntity::loadParams(root); 78 76 79 LoadParam(root, "abs-dir", this, Playable, set AbsDirPlay);77 LoadParam(root, "abs-dir", this, Playable, setStartDirection); 80 78 } 81 79 82 80 void Playable::addWeapon(Weapon* weapon, int configID, int slotID) 83 81 { 84 this->weaponMan ->addWeapon(weapon, configID, slotID);82 this->weaponMan.addWeapon(weapon, configID, slotID); 85 83 86 84 this->weaponConfigChanged(); … … 90 88 void Playable::removeWeapon(Weapon* weapon) 91 89 { 92 this->weaponMan ->removeWeapon(weapon);90 this->weaponMan.removeWeapon(weapon); 93 91 94 92 this->weaponConfigChanged(); … … 98 96 void Playable::nextWeaponConfig() 99 97 { 100 this->weaponMan ->nextWeaponConfig();98 this->weaponMan.nextWeaponConfig(); 101 99 this->weaponConfigChanged(); 102 100 } … … 105 103 void Playable::previousWeaponConfig() 106 104 { 107 this->weaponMan ->previousWeaponConfig();105 this->weaponMan.previousWeaponConfig(); 108 106 this->weaponConfigChanged(); 109 107 } … … 259 257 { 260 258 if(powerUp->isA(CL_WEAPON_POWER_UP)) { 261 return dynamic_cast<WeaponPowerUp*>(powerUp)->process( this->getWeaponManager());259 return dynamic_cast<WeaponPowerUp*>(powerUp)->process(&this->getWeaponManager()); 262 260 } 263 261 else if(powerUp->isA(CL_PARAM_POWER_UP)) { … … 305 303 void Playable::tick(float dt) 306 304 { 307 this->weaponMan ->tick(dt);305 this->weaponMan.tick(dt); 308 306 if (this->bFire) 309 weaponMan ->fire();307 weaponMan.fire(); 310 308 } 311 309
Note: See TracChangeset
for help on using the changeset viewer.