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) {
return true; }
72 template<
typename EnumType>
73 static void addCallback(EnumType eventEnum,
74 EventReceiver* component,
75 EventCallback callback);
79 static void _register(Fireable* f);
80 static void _unregister(Fireable* f);
82 inline static std::vector<Fireable*> _fireables;
83 inline static std::vector<Fireable*> _fireables_frame;
84 inline static Cleanup _cleanup;
86 virtual void fire(
const std::optional<sf::Event>& event) = 0;
87 virtual void fire() = 0;
92 friend struct ml::exports::FireableRegistrar;