class to help create and manage all the event handlers
More...
#include <Event.hpp>
class to help create and manage all the event handlers
◆ addHandler()
template<class EventData = NoEventData>
create a new event handler for the given event type
- Template Parameters
-
EventData | type of the data to be send to subscribed functions when the event is published |
- Parameters
-
eventType | type of the event for the new event handler |
- Returns
- return a reference to the newly created event handler
◆ getHandler()
template<class EventData = NoEventData>
return an event handler by its type
- Template Parameters
-
EventData | type of the data to send to subscribed functions when the event is published |
- Parameters
-
eventType | type of the event handler to retrive |
- Returns
- returns a reference to the event handler obtained
◆ publish()
template<class EventData = NoEventData>
void GameEngine::EventManager::publish |
( |
const EventType |
eventType, |
|
|
EventData |
eventData |
|
) |
| |
|
inline |
call all the subscribed functions with the given eventData
- Template Parameters
-
EventData | type of the data to be send to subscribed functions when the event is published |
- Parameters
-
eventType | type of the event to publish |
eventData | data to be given to subscribed functions |
◆ removeHandler()
void GameEngine::EventManager::removeHandler |
( |
const EventType |
eventType | ) |
|
|
inline |
remove an event handler
- Parameters
-
eventType | event type of the handler to remove |
The documentation for this class was generated from the following file: