Lazarus
Engine for creating roguelikes in C++
 All Classes Namespaces Functions
EventListener.h
1 #pragma once
2 
3 namespace __lz // Meant for internal use only
4 {
6 {
7 public:
8  // Add virtual destructor to make class polymorphic
9  virtual ~BaseEventListener() = default;
10 };
11 }
12 
13 namespace lz
14 {
15 class ECSEngine;
16 
31 template <typename EventType>
33 {
34 public:
35  // Add virtual destructor to make class polymorphic
36  virtual ~EventListener() = default;
37 
44  virtual void receive(ECSEngine& engine, const EventType& event) = 0;
45 };
46 } // namespace lz
virtual void receive(ECSEngine &engine, const EventType &event)=0
Called when the EventListener receives an event from the ECS engine.
Interface for objects that react to events of a certain type.
Definition: EventListener.h:32
Definition: EventListener.h:5
Main driver to work with entities, components and systems.
Definition: ECSEngine.h:27