diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-24 22:12:31 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-24 22:12:31 +0100 |
commit | 24e3f0ea7c5ce90af1276dca49644b5e1ac799f6 (patch) | |
tree | 465dd020c1700511a1697267268b3d975caefd48 /src/crepe/api/EventHandler.hpp | |
parent | 6287d4e9068d8bd27a9e62643f54adb69e84befd (diff) | |
parent | be5ccbe24086d5d4fb407f268c649dcbc36eda6b (diff) |
merge
Diffstat (limited to 'src/crepe/api/EventHandler.hpp')
-rw-r--r-- | src/crepe/api/EventHandler.hpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/crepe/api/EventHandler.hpp b/src/crepe/api/EventHandler.hpp index 9c47da2..050e57e 100644 --- a/src/crepe/api/EventHandler.hpp +++ b/src/crepe/api/EventHandler.hpp @@ -1,3 +1,4 @@ +#pragma once #include <typeindex> @@ -8,19 +9,12 @@ namespace crepe { // Implementation of EventHandlerWrapper constructor template <typename EventType> EventHandlerWrapper<EventType>::EventHandlerWrapper(const EventHandler<EventType> & handler) - : m_handler(handler), - m_handler_type(m_handler.target_type().name()) {} + : handler(handler) {} // Implementation of EventHandlerWrapper::call template <typename EventType> bool EventHandlerWrapper<EventType>::call(const Event & e) { - return m_handler(static_cast<const EventType &>(e)); -} - -// Implementation of EventHandlerWrapper::get_type -template <typename EventType> -std::string EventHandlerWrapper<EventType>::get_type() const { - return m_handler_type; + return this->handler(static_cast<const EventType &>(e)); } } //namespace crepe |