Lazarus
Engine for creating roguelikes in C++
 All Classes Namespaces Functions
Public Member Functions | List of all members
lz::EventListener< EventType > Class Template Referenceabstract

Interface for objects that react to events of a certain type. More...

#include <EventListener.h>

Inheritance diagram for lz::EventListener< EventType >:
__lz::BaseEventListener

Public Member Functions

virtual void receive (ECSEngine &engine, const EventType &event)=0
 Called when the EventListener receives an event from the ECS engine. More...
 

Detailed Description

template<typename EventType>
class lz::EventListener< EventType >

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.

See Also
ECSEngine
BaseSystem

Member Function Documentation

template<typename EventType>
virtual void lz::EventListener< EventType >::receive ( ECSEngine engine,
const EventType &  event 
)
pure virtual

Called when the EventListener receives an event from the ECS engine.

Parameters
engineReference to the ECS engine the listener lives in.
eventThe event that is emitted by the ECS engine and received by this.

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