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,
77 Core* core =
nullptr);
81 static void _register(Fireable* f);
82 static void _unregister(Fireable* f);
84 inline static std::vector<Fireable*> _fireables;
85 inline static std::vector<Fireable*> _fireables_frame;
86 inline static Cleanup _cleanup;
88 virtual void fire(
const std::optional<sf::Event>& event) = 0;
89 virtual void fire() = 0;
94 friend struct ml::exports::FireableRegistrar;