KarmaEngine
Game Engine for practical learning and research purposes
|
Class for dispatching events. More...
#include <Event.h>
Public Member Functions | |
EventDispatcher (Event &event) | |
A constructor. | |
template<typename T> | |
bool | Dispatch (EventFn< T > func) |
Routine for dispatching Events. | |
Class for dispatching events.
|
inline |
|
inline |
Routine for dispatching Events.
For a demonstration see the line
where KR_BIND_EVENT_FN is defined like so
Hence, we see that the dispatch function, usually called in OnEvent(), allows the execution of the bounded function (EventFn) with the supplied Event.
A way to read dispatcher call is like so
"I am present in so class with such routine (fn), hence I am dispatching supplied Event with a bounded function (KR_BIND_EVENT_FN(fn)) to be executed"