mirror of
https://github.com/geode-sdk/geode.git
synced 2025-04-24 05:14:40 -04:00
Add chainable listen function to EventHandler
This commit is contained in:
parent
6cb2662b0a
commit
c1cae85672
1 changed files with 5 additions and 0 deletions
|
@ -19,5 +19,10 @@ namespace geode::event::v2 {
|
|||
template <typename T>
|
||||
struct EventHandler : public EventListener<WrapFilter<T>> {
|
||||
EventHandler(std::function<bool(T*)> filterFunc) : EventListener<WrapFilter<T>>(WrapFilter(filterFunc)) {}
|
||||
|
||||
EventHandler& listen(std::function<ListenerResult(T*)> fn) {
|
||||
bind(fn);
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue