12 using callback_fn = std::function<void(event_type&)>;
16 EventPriority priority = EventPriority::Normal,
17 std::weak_ptr<mod::Mod> mod = mod::NativeMod::current()
20 callback(std::move(fn)) {}
24 void call(
Event& event)
override { callback(
static_cast<event_type&
>(event)); }
26 static std::shared_ptr<Listener> create(
28 EventPriority priority = EventPriority::Normal,
29 std::weak_ptr<mod::Mod> mod = mod::NativeMod::current()
31 return std::make_shared<Listener>(std::move(fn), priority, std::move(mod));