Interface for objects that react to events of a certain type. More...
#include <EventListener.h>
Public Member Functions | |
| virtual void | receive (ECSEngine &engine, const EventType &event)=0 |
| Called when the EventListener receives an event from the ECS engine. More... | |
Interface for objects that react to events of a certain type.
Objects which derive from EventListener will need to implement the receive method, which will be called when an event of the same type is emitted by the ECS engine, as long as the listener is subscribed to the list of listeners of that event type in the ECS engine.
Usually, systems will also be event listeners, so they can implement this interface.
|
pure virtual |
Called when the EventListener receives an event from the ECS engine.
| engine | Reference to the ECS engine the listener lives in. |
| event | The event that is emitted by the ECS engine and received by this. |
1.8.6