Distributes events to event handlers. More...
Public Member Functions | |
addHandler (IEventHandler inHandler, int inEventType=all_events) | |
add a new handler for some event type, or for all events if no type specified. More... | |
blockEvent (int inEventType) | |
temporarily ignore all events of a particular type. More... | |
clear () | |
remove all handlers More... | |
removeHandler (IEventHandler inHandler, int inEventType=all_events) | |
remove a handler for some event type, or for all events (see note) if no type specified. More... | |
unblockEvent (int inEventType) | |
stop ignoring events of a particular type More... | |
Distributes events to event handlers.
The EventEmitter expects the game developer to implement IEventHandler subclasses and register them to handle various events they are interested in.
addHandler | ( | IEventHandler | inHandler, |
int | inEventType = all_events |
||
) |
add a new handler for some event type, or for all events if no type specified.
inHandler | the IEventHandler object which will handle the events |
inEventType | the type of event to handle |
blockEvent | ( | int | inEventType | ) |
temporarily ignore all events of a particular type.
Events that are blocked are NOT cached for later, they are just dropped.
inEventType | the type of event to block |
clear | ( | ) |
remove all handlers
removeHandler | ( | IEventHandler | inHandler, |
int | inEventType = all_events |
||
) |
remove a handler for some event type, or for all events (see note) if no type specified.
If the handler is listed multiple times it will only remove it once.
It is safe to call remove handler from within an event handler's handleEvent() call.
inHandler | the object to handle events |
inEventType | the type of event to stop handling |
removeHandler(handler, all_events)
will do nothing. Basically, all_events is a special event type that matches all event types when considering whether to invoke a handler or not. unblockEvent | ( | int | inEventType | ) |
stop ignoring events of a particular type
inEventType | the type of event to unblock |