Changeset 5886 for code/branches/core5
- Timestamp:
- Oct 6, 2009, 2:14:46 AM (15 years ago)
- Location:
- code/branches/core5/src/modules/objects/eventsystem
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/modules/objects/eventsystem/EventDispatcher.cc
r5882 r5886 32 32 #include "core/EventIncludes.h" 33 33 #include "core/XMLPort.h" 34 #include "EventTarget.h"35 34 36 35 namespace orxonox … … 46 45 { 47 46 if (this->isInitialized()) 48 for (std::list< EventTarget*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)47 for (std::list<BaseObject*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it) 49 48 (*it)->destroy(); 50 49 } … … 59 58 void EventDispatcher::processEvent(Event& event) 60 59 { 61 for (std::list< EventTarget*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)60 for (std::list<BaseObject*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it) 62 61 (*it)->processEvent(event); 63 62 } 64 63 65 void EventDispatcher::addTarget( EventTarget* target)64 void EventDispatcher::addTarget(BaseObject* target) 66 65 { 67 66 this->targets_.push_back(target); 68 67 } 69 68 70 EventTarget* EventDispatcher::getTarget(unsigned int index) const69 BaseObject* EventDispatcher::getTarget(unsigned int index) const 71 70 { 72 71 unsigned int i = 0; 73 for (std::list< EventTarget*>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)72 for (std::list<BaseObject*>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); ++it) 74 73 { 75 74 if (i == index) -
code/branches/core5/src/modules/objects/eventsystem/EventDispatcher.h
r5738 r5886 47 47 virtual void processEvent(Event& event); 48 48 49 void addTarget( EventTarget* target);50 EventTarget* getTarget(unsigned int index) const;49 void addTarget(BaseObject* target); 50 BaseObject* getTarget(unsigned int index) const; 51 51 52 52 private: 53 std::list< EventTarget*> targets_;53 std::list<BaseObject*> targets_; 54 54 }; 55 55 }
Note: See TracChangeset
for help on using the changeset viewer.