Loading...
Searching...
No Matches
EventDispatcher.h
Go to the documentation of this file.
1//
2// Created by Dave Smith on 3/21/26.
3//
4
5#ifndef EVENTDISPATCHER_H
6#define EVENTDISPATCHER_H
7#include "Fireable.h"
8#include <optional>
9namespace ml {
10
88class EventDispatcher : public Fireable {
89private:
91 void fire() final override{};
93 bool occurred() final override{};
94
95public:
106 void fire(const std::optional<sf::Event> &event) override = 0;
107
119 bool occurred(const std::optional<sf::Event> &event) override = 0;
120};
121
122} // ml
123
124#endif //EVENTDISPATCHER_H
Base class for all per-event dispatchers in the Malena event system.
bool occurred(const std::optional< sf::Event > &event) override=0
Return true when the incoming SFML event should trigger this dispatcher.
void fire(const std::optional< sf::Event > &event) override=0
Deliver this event to all matching registered components.
Definition Component.h:18