Changeset 6243 in orxonox.OLD for trunk/src/world_entities/space_ships
- Timestamp:
- Dec 21, 2005, 3:41:11 PM (19 years ago)
- Location:
- trunk/src/world_entities/space_ships
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/space_ships/space_ship.cc
r6241 r6243 31 31 #include "key_mapper.h" 32 32 #include "event_handler.h" 33 34 #include "power_ups/weapon_power_up.h" 35 #include "power_ups/param_power_up.h" 33 36 34 37 #include "graphics_engine.h" … … 432 435 else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed) 433 436 this->getWeaponManager()->previousWeaponConfig(); 434 435 437 else if( event.type == SDLK_w) 436 438 this->bUp = event.bPressed; //this->shiftCoor(0,.1,0); … … 445 447 //this->setAbsDir(mouseDir); 446 448 } 449 } 450 451 /** 452 * 453 */ 454 bool SpaceShip::pickup(PowerUp* powerUp) 455 { 456 if(powerUp->isA(CL_WEAPON_POWER_UP)) { 457 Weapon* weapon = dynamic_cast<WeaponPowerUp*>(powerUp)->getWeapon(); 458 WeaponManager* manager = this->getWeaponManager(); 459 int slot = manager->getNextFreeSlot(0, weapon->getCapability()); 460 if(slot >= 0) { 461 manager->addWeapon(weapon, 0, slot); 462 return true; 463 } 464 } 465 else if(powerUp->isA(CL_PARAM_POWER_UP)) { 466 ParamPowerUp* ppu = dynamic_cast<ParamPowerUp*>(powerUp); 467 switch(ppu->getType()) { 468 case PARAM_SHIELD: 469 break; 470 } 471 } 472 return false; 447 473 } 448 474 -
trunk/src/world_entities/space_ships/space_ship.h
r6222 r6243 8 8 9 9 #include "playable.h" 10 #include "extendable.h" 10 11 11 12 … … 14 15 class Event; 15 16 16 class SpaceShip : public Playable 17 class SpaceShip : public Playable, public Extendable 17 18 { 18 19 … … 41 42 42 43 virtual void process(const Event &event); 43 44 bool pickup(PowerUp* powerUp); 44 45 45 46
Note: See TracChangeset
for help on using the changeset viewer.