#include <EventDispatcher.h>
template<typename EventBase>
class MxEngine::EventDispatcher< EventBase >
EventDispatcher class is used to handle all events inside MxEngine. Events can either be dispatch for Application (global) or for currently active scene. Note that events are NOT dispatched when developer console is opened and instead sheduled until it close
§ AddEvent()
template<typename EventBase>
Adds event to event queue. All such events will be dispatched in next frames in the order they were added
- Parameters
-
| event | event to shedule dispatch |
§ AddEventListener() [1/2]
template<typename EventBase>
template<typename EventType >
| void MxEngine::EventDispatcher< EventBase >::AddEventListener |
( |
const MxString & |
name, |
|
|
std::function< void(EventType &)> |
func |
|
) |
| |
|
inline |
adds new event listener to dispatcher (listener placed in waiting queue until next frame). Note that multiple listeners may have same name. If so, deleting by name will result in removing all of them
- Parameters
-
| name | name of listener (used for deleting listener) |
| func | listener callback functor |
§ AddEventListener() [2/2]
template<typename EventBase>
template<typename FunctionType >
adds new event listener to dispatcher (listener is placed in waiting queue until next frame). Note that multiple listeners may have same name. If so, deleting by name will result in removing all of them
- Parameters
-
| name | name of listener (used for deleting listener) |
| func | listener callback functor |
§ FlushEvents()
template<typename EventBase>
performs cache update, removing events from toRemoveCache list and adding events from toAddCache list
§ Invoke()
template<typename EventBase>
template<typename Event >
Immediately invokes event of specific type. Note that invokation also forces queues to be invalidated
- Parameters
-
§ InvokeAll()
template<typename EventBase>
Invokes all shedules events in the order they were added. Note that invoke also forces queues to be invalidated
§ RemoveEventListener()
template<typename EventBase>
removes all event listeners by their names (action is placed in waiting queue until next frame)
- Parameters
-
| name | name of listeners to be deleted |
The documentation for this class was generated from the following file: