Changeset 5965 in orxonox.OLD for branches/powerups/src/world_entities/space_ships
- Timestamp:
- Dec 7, 2005, 3:45:26 PM (19 years ago)
- Location:
- branches/powerups/src/world_entities/space_ships
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/powerups/src/world_entities/space_ships/space_ship.cc
r5955 r5965 17 17 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY 18 18 19 #include "space_ship.h" 20 19 21 #include "executor/executor.h" 20 #include "space_ship.h"21 22 22 23 #include "objModel.h" … … 30 31 #include "factory.h" 31 32 #include "key_mapper.h" 33 34 #include "power_ups/weapon_power_up.h" 32 35 33 36 using namespace std; … … 368 371 } 369 372 373 /** 374 * 375 */ 376 bool SpaceShip::pickup(PowerUp* powerUp) 377 { 378 if(powerUp->isA(CL_WEAPON_POWER_UP)) { 379 WeaponPowerUp* wpu = dynamic_cast<WeaponPowerUp*>(powerUp); 380 WeaponManager* manager = this->getWeaponManager(); 381 int slot = manager->getNextFreeSlot(0, wpu->getCapsNeeded()); 382 if(slot >= 0) { 383 manager->addWeapon(wpu->getWeapon(), 0, slot); 384 return true; 385 } 386 } 387 else if(powerUp->isA(CL_SHIELD_POWER_UP)) { 388 389 } 390 return false; 391 } 392 370 393 #include "weapons/aiming_turret.h" 371 394 // FIXME THIS MIGHT BE CONSIDERED EITHER A FEATURE, OR A BUG -
branches/powerups/src/world_entities/space_ships/space_ship.h
r5955 r5965 8 8 9 9 #include "playable.h" 10 #include "extendable.h" 10 11 11 12 template<class T> class tList; … … 13 14 class Event; 14 15 15 class SpaceShip : public Playable 16 class SpaceShip : public Playable, public Extendable 16 17 { 17 18 … … 37 38 38 39 virtual void process(const Event &event); 40 41 bool pickup(PowerUp* powerUp); 39 42 40 43
Note: See TracChangeset
for help on using the changeset viewer.