Changeset 6215 in orxonox.OLD for branches/christmas_branche/src/world_entities
- Timestamp:
- Dec 21, 2005, 11:42:12 AM (19 years ago)
- Location:
- branches/christmas_branche/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/christmas_branche/src/world_entities/playable.h
r6162 r6215 25 25 virtual ~Playable(); 26 26 27 virtual void enter() {}; 28 virtual void leave() {}; 27 29 28 30 virtual void addWeapon(Weapon* weapon ) {}//= 0; … … 34 36 35 37 virtual void process(const Event &event) = 0; 36 38 37 39 38 40 -
branches/christmas_branche/src/world_entities/player.cc
r5915 r6215 19 19 #include "event_handler.h" 20 20 21 22 #include "class_list.h" 23 21 24 using namespace std; 22 25 … … 28 31 { 29 32 this->init(); 33 34 EventHandler::getInstance()->subscribe(this, ES_GAME, SDLK_l); 30 35 } 31 36 … … 79 84 void Player::process(const Event &event) 80 85 { 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 81 104 if (likely(this->controllable != NULL)) 82 105 this->controllable->process(event);
Note: See TracChangeset
for help on using the changeset viewer.