61 enum class DispatchType { FRAME, EVENT };
62 Fireable(DispatchType type = DispatchType::EVENT);
68 virtual bool occurred(
const std::optional<sf::Event>& event) {
return false; }
69 virtual bool occurred() {
return false; }
70 virtual bool filter(
const std::optional<sf::Event>& event, Core* component);
72 template<
typename EnumType>
73 static void addCallback(EnumType eventEnum,
74 EventReceiver* component,
75 EventCallback callback,
76 bool overwrite =
true);
80 static void _register(Fireable* f);
81 static void _unregister(Fireable* f);
83 inline static std::vector<Fireable*> _fireables;
84 inline static std::vector<Fireable*> _fireables_frame;
85 inline static Cleanup _cleanup;
87 virtual void fire(
const std::optional<sf::Event>& event) = 0;
88 virtual void fire() = 0;
93 friend struct ml::exports::FireableRegistrar;