CoriEngine
Loading...
Searching...
No Matches
Cori::Core::EventDispatcher Class Reference

Used in OnEvent methods to dispatch and handle Events. More...

#include <Event.hpp>

Public Member Functions

 EventDispatcher (Event &event)
template<typename T>
bool Dispatch (EventFn< T > func)
 Binds dispatch function that will handle a specific Event type.

Detailed Description

Used in OnEvent methods to dispatch and handle Events.

Definition at line 69 of file Event.hpp.

Constructor & Destructor Documentation

◆ EventDispatcher()

Cori::Core::EventDispatcher::EventDispatcher ( Event & event)
inlineexplicit

Definition at line 73 of file Event.hpp.

Member Function Documentation

◆ Dispatch()

template<typename T>
bool Cori::Core::EventDispatcher::Dispatch ( EventFn< T > func)
inline

Binds dispatch function that will handle a specific Event type.

Template Parameters
TEvent type to dispatch.
Parameters
funcLambda or function bind.

If true is returned from the bound function the Event is considered handled, otherwise the said Event will be propagated down the LayerStack.

Returns
Returns the same value that is returned in the bound function.

Definition at line 85 of file Event.hpp.


The documentation for this class was generated from the following file: