Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5886 for code/branches/core5


Ignore:
Timestamp:
Oct 6, 2009, 2:14:46 AM (15 years ago)
Author:
landauf
Message:

forgot some changes in r5882. EventDispatcher now really supports all kinds of objects in the "targets" section.

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  
    3232#include "core/EventIncludes.h"
    3333#include "core/XMLPort.h"
    34 #include "EventTarget.h"
    3534
    3635namespace orxonox
     
    4645    {
    4746        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)
    4948                (*it)->destroy();
    5049    }
     
    5958    void EventDispatcher::processEvent(Event& event)
    6059    {
    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)
    6261            (*it)->processEvent(event);
    6362    }
    6463
    65     void EventDispatcher::addTarget(EventTarget* target)
     64    void EventDispatcher::addTarget(BaseObject* target)
    6665    {
    6766        this->targets_.push_back(target);
    6867    }
    6968
    70     EventTarget* EventDispatcher::getTarget(unsigned int index) const
     69    BaseObject* EventDispatcher::getTarget(unsigned int index) const
    7170    {
    7271        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)
    7473        {
    7574            if (i == index)
  • code/branches/core5/src/modules/objects/eventsystem/EventDispatcher.h

    r5738 r5886  
    4747            virtual void processEvent(Event& event);
    4848
    49             void addTarget(EventTarget* target);
    50             EventTarget* getTarget(unsigned int index) const;
     49            void addTarget(BaseObject* target);
     50            BaseObject* getTarget(unsigned int index) const;
    5151
    5252        private:
    53             std::list<EventTarget*> targets_;
     53            std::list<BaseObject*> targets_;
    5454    };
    5555}
Note: See TracChangeset for help on using the changeset viewer.