57 enum class DispatchType { FRAME, EVENT };
58 Fireable(DispatchType type = DispatchType::EVENT);
64 virtual bool occurred(
const std::optional<sf::Event>& event) {
return false; }
65 virtual bool occurred() {
return false; }
66 virtual bool filter(
const std::optional<sf::Event>& event, Core* component) {
return true; }
68 template<
typename EnumType>
69 static void addCallback(EnumType eventEnum,
70 EventReceiver* component,
73 struct Cleanup { ~Cleanup(); };
75 static void _register(Fireable* f);
76 static void _unregister(Fireable* f);
78 inline static std::vector<Fireable*> _fireables;
79 inline static std::vector<Fireable*> _fireables_frame;
80 inline static Cleanup _cleanup;
82 virtual void fire(
const std::optional<sf::Event>& event) = 0;
83 virtual void fire() = 0;