Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4354 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
May 28, 2005, 1:11:57 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: implemented event subscribe function

Location:
orxonox/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/defs/debug.h

    r4287 r4354  
    7474#define DEBUG_MODULE_ANIM               1
    7575#define DEBUG_MODULE_PARTICLE           1
     76#define DEBUG_MODULE_EVENT              3
    7677
    7778#define DEBUG_MODULE_NULL_PARENT        0
  • orxonox/trunk/src/util/event/event_handler.cc

    r4352 r4354  
    167167}
    168168
     169
     170void EventHandler::setState(elState state)
     171{
     172  this->state = state;
     173}
     174
     175void EventHandler::subscribeListener(EventListener* el, elState state, int eventType)
     176{
     177  if( likely(this->listeners[state][eventType] == NULL))
     178    this->listeners[state][eventType] = el;
     179  else
     180    PRINTF(0)("Someone tried to subscribe to event %i @ state %i but this event has already been subscribed\n", eventType, state);
     181}
     182
     183
     184void EventHandler::unsubscribeListener(EventListener* el, elState state)
     185{}
     186
     187void EventHandler::flush()
     188{}
  • orxonox/trunk/src/util/event/event_handler.h

    r4352 r4354  
    4949  void setState(elState state);
    5050
    51   void subscribeListener(EventListener* el, elState state);
     51  void subscribeListener(EventListener* el, elState state, int eventType);
    5252  void unsubscribeListener(EventListener* el, elState state);
     53  void unsubscribeListener(int eventType, elState state);
    5354  void flush();
    5455 
     
    6566  KeyBindings* keyAliases;
    6667  EventListener*** listeners;                         //!< a list of registered listeners
    67  
     68  elState state;
     69
    6870};
    6971
Note: See TracChangeset for help on using the changeset viewer.