Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7756 in orxonox.OLD for trunk/src/lib/event/event_handler.h


Ignore:
Timestamp:
May 21, 2006, 6:42:09 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: Multiple Event Subscription Method
@patrick, do you approve of this, or do you think, that it is too much??

This is something i proposed some time ago, and it is nice, because one can overload the Commandos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/event/event_handler.h

    r7256 r7756  
    1212#include "event_def.h"
    1313#include <stack>
     14#include <vector>
    1415
    1516// FORWARD DECLARATION
     
    3839  void flush(elState state);
    3940  /** @returns true, if the @param state has @param eventType subscribed?? */
    40   inline bool isSubscribed(elState state, int eventType) { return(listeners[state][eventType] == NULL)?false:true; };
     41  bool isSubscribed(elState state, int eventType);
    4142
    4243
     
    5455
    5556 private:
    56   static EventHandler*       singletonRef;                    //!< the singleton reference
     57  static EventHandler*         singletonRef;                    //!< the singleton reference
    5758
    58   EventListener*             listeners[ES_NUMBER][EV_NUMBER]; //!< a list of registered listeners.
    59   elState                    state;                           //!< the state of the event handlder.
    60   std::stack<short>          stateStack;                      //!< a stack for the States we are in.
    61   KeyMapper*                 keyMapper;                       //!< reference to the key mapper.
     59  std::vector<EventListener*>  listeners[ES_NUMBER][EV_NUMBER]; //!< a list of registered listeners.
     60  elState                      state;                           //!< the state of the event handlder.
     61  std::stack<short>            stateStack;                      //!< a stack for the States we are in.
     62  KeyMapper                    keyMapper;                       //!< reference to the key mapper.
    6263
    63   bool                       bUNICODE;                        //!< If unicode should be enabled.
    64   bool                       eventsGrabbed;                   //!< If the events should be grabbed
     64  bool                         bUNICODE;                        //!< If unicode should be enabled.
     65  bool                         eventsGrabbed;                   //!< If the events should be grabbed
    6566};
    6667
Note: See TracChangeset for help on using the changeset viewer.