Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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/util/event
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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.