Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 6, 2009, 4:51:08 AM (15 years ago)
Author:
landauf
Message:

Fixed an issue with the new event-system: even states which weren't declared are not loaded. While this is normally fine, it is a problem in EventDispatcher and EventTarget which have to pipe events to other objects and therefore have to support any state, not just the native ones.

Location:
code/branches/core5/src/modules/objects/eventsystem
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/modules/objects/eventsystem/EventDispatcher.cc

    r5886 r5887  
    5454
    5555        XMLPortObject(EventDispatcher, BaseObject, "targets", addTarget, getTarget, xmlelement, mode);
     56
     57        // since we need event sources mapped to any state, we have to parse XML by ourselves
     58        this->loadAllEventStates(xmlelement, mode, this, Class(EventDispatcher));
    5659    }
    5760
  • code/branches/core5/src/modules/objects/eventsystem/EventTarget.cc

    r5882 r5887  
    2929#include "EventTarget.h"
    3030#include "core/CoreIncludes.h"
     31#include "core/XMLPort.h"
    3132
    3233namespace orxonox
     
    4344    }
    4445   
     46    void EventTarget::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     47    {
     48        SUPER(EventTarget, XMLPort, xmlelement, mode);
     49
     50        // since we need event sources mapped to any state, we have to parse XML by ourselves
     51        this->loadAllEventStates(xmlelement, mode, this, Class(EventTarget));
     52    }
     53
    4554    void EventTarget::processEvent(Event& event)
    4655    {
  • code/branches/core5/src/modules/objects/eventsystem/EventTarget.h

    r5882 r5887  
    4343            virtual ~EventTarget();
    4444           
     45            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     46           
    4547            virtual void processEvent(Event& event);
    4648
Note: See TracChangeset for help on using the changeset viewer.