Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6215 in orxonox.OLD for branches/christmas_branche/src


Ignore:
Timestamp:
Dec 21, 2005, 11:42:12 AM (19 years ago)
Author:
bensch
Message:

christmas: changing the ship

Location:
branches/christmas_branche/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/christmas_branche/src/world_entities/playable.h

    r6162 r6215  
    2525    virtual ~Playable();
    2626
     27    virtual void enter() {};
     28    virtual void leave() {};
    2729
    2830    virtual void addWeapon(Weapon* weapon )  {}//= 0;
     
    3436
    3537    virtual void process(const Event &event) = 0;
    36    
     38
    3739
    3840
  • branches/christmas_branche/src/world_entities/player.cc

    r5915 r6215  
    1919#include "event_handler.h"
    2020
     21
     22#include "class_list.h"
     23
    2124using namespace std;
    2225
     
    2831{
    2932  this->init();
     33
     34  EventHandler::getInstance()->subscribe(this, ES_GAME, SDLK_l);
    3035}
    3136
     
    7984 void Player::process(const Event &event)
    8085 {
     86   if (event.type == SDLK_l && event.bPressed)
     87   {
     88     /// FIXME this should be in the ObjectManager
     89     const std::list<BaseObject*>* objectList = ClassList::getList(CL_PLAYABLE);
     90     if (objectList != NULL)
     91     {
     92       list<BaseObject*>::const_iterator node;
     93       for (node = objectList->begin(); node != objectList->end(); node++)
     94         if (this->controllable != (*node) && (dynamic_cast<PNode*>(*node)->getAbsCoor() - this->controllable->getAbsCoor()).len() < 10.0)
     95       {
     96         printf("strange\n");
     97         this->disconnectControllable();
     98         this->setControllable(dynamic_cast<Playable*>(*node));
     99         break;
     100       }
     101     }
     102   }
     103
    81104   if (likely(this->controllable != NULL))
    82105     this->controllable->process(event);
Note: See TracChangeset for help on using the changeset viewer.