Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6547 in orxonox.OLD for trunk/src/world_entities/space_ships


Ignore:
Timestamp:
Jan 18, 2006, 2:12:53 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the WeaponManager back to the trunk

Location:
trunk/src/world_entities/space_ships
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/space_ships/space_ship.cc

    r6532 r6547  
    123123  PRINTF(4)("SPACESHIP INIT\n");
    124124
    125   //EventHandler::getInstance()->grabEvents(true);
     125  EventHandler::getInstance()->grabEvents(true);
    126126
    127127  bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
     
    450450     //this->setAbsDir(mouseDir);
    451451  }
    452 }
    453 
    454 /**
    455  *
    456  */
    457 bool SpaceShip::pickup(PowerUp* powerUp)
    458 {
    459   if(powerUp->isA(CL_WEAPON_POWER_UP)) {
    460     Weapon* weapon = dynamic_cast<WeaponPowerUp*>(powerUp)->getWeapon();
    461     WeaponManager* manager = this->getWeaponManager();
    462     int slot = manager->getNextFreeSlot(0, weapon->getCapability());
    463     if(slot >= 0) {
    464       manager->addWeapon(weapon, 0, slot);
    465       return true;
    466     }
    467   }
    468   else if(powerUp->isA(CL_PARAM_POWER_UP)) {
    469     ParamPowerUp* ppu = dynamic_cast<ParamPowerUp*>(powerUp);
    470     switch(ppu->getType()) {
    471       case PARAM_SHIELD:
    472         break;
    473     }
    474   }
    475   return false;
    476452}
    477453
  • trunk/src/world_entities/space_ships/space_ship.h

    r6512 r6547  
    1515class Event;
    1616
    17 class SpaceShip : public Playable, public Extendable
     17class SpaceShip : public Playable
    1818{
    1919
     
    3939
    4040    virtual void process(const Event &event);
    41     bool pickup(PowerUp* powerUp);
    4241
    4342    virtual int       writeBytes(const byte* data, int length, int sender);
Note: See TracChangeset for help on using the changeset viewer.