Loading...
Searching...
No Matches
FrameDispatcher.h
Go to the documentation of this file.
1//
2// Created by Dave Smith on 3/22/26.
3//
4
5#ifndef FRAMEDISPATCHER_H
6#define FRAMEDISPATCHER_H
7#include "Fireable.h"
8
9
10namespace ml {
11
86class FrameDispatcher : public Fireable {
87public:
88 FrameDispatcher() : Fireable(DispatchType::FRAME) {}
89
99 bool occurred() override = 0;
100
108 void fire() override = 0;
109
110private:
112 void fire(const std::optional<sf::Event>& event) final override {}
114 bool occurred(const std::optional<sf::Event>& event) final override { return false; }
115};
116
117} // namespace ml
118
119
120
121#endif //FRAMEDISPATCHER_H
void fire() override=0
Deliver the per-frame callback to all matching components.
bool occurred() override=0
Return true when this dispatcher should fire this frame.
Definition Component.h:18