Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6222 in orxonox.OLD for trunk/src/world_entities/player.cc


Ignore:
Timestamp:
Dec 21, 2005, 1:49:06 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the christmas branche to the trunk
merged with command:
svn merge -r6165:HEAD christmas_branche/ ../trunk/
no conflicts

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore set to
      Makefile.in
      Makefile
      configure
      *.kdevelop
      Doxyfile
      config.log
      config.h
      config.status
      stamp-h1
      autom4te.cache
      aclocal.m4
  • trunk/src

    • Property svn:ignore set to
      .deps
      orxonox
      Makefile
      Makefile.in

  • trunk/src/world_entities/player.cc

    r5915 r6222  
    1919#include "event_handler.h"
    2020
     21
     22#include "class_list.h"
     23#include "state.h"
     24
    2125using namespace std;
    2226
     
    2832{
    2933  this->init();
     34
     35  EventHandler::getInstance()->subscribe(this, ES_GAME, SDLK_l);
    3036}
    3137
     
    7985 void Player::process(const Event &event)
    8086 {
     87   if (event.type == SDLK_l && event.bPressed)
     88   {
     89     /// FIXME this should be in the ObjectManager
     90     const std::list<BaseObject*>* objectList = ClassList::getList(CL_PLAYABLE);
     91     if (objectList != NULL)
     92     {
     93       list<BaseObject*>::const_iterator node;
     94       for (node = objectList->begin(); node != objectList->end(); node++)
     95         if (this->controllable != (*node) && (dynamic_cast<PNode*>(*node)->getAbsCoor() - this->controllable->getAbsCoor()).len() < 10.0)
     96       {
     97         this->controllable->leave();
     98         this->disconnectControllable();
     99         this->setControllable(dynamic_cast<Playable*>(*node));
     100         this->controllable->enter();
     101         State::getCamera()->setParentSoft(this->controllable);
     102         State::getCameraTarget()->setParentSoft(this->controllable);
     103
     104         break;
     105       }
     106     }
     107   }
     108
    81109   if (likely(this->controllable != NULL))
    82110     this->controllable->process(event);
Note: See TracChangeset for help on using the changeset viewer.