aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/EventHandler.hpp
blob: 050e57e9869e9bee362fa886a1a39ffb3304a2c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once

#include <typeindex>

#include "EventHandler.h"

namespace crepe {

// Implementation of EventHandlerWrapper constructor
template <typename EventType>
EventHandlerWrapper<EventType>::EventHandlerWrapper(const EventHandler<EventType> & handler)
	: handler(handler) {}

// Implementation of EventHandlerWrapper::call
template <typename EventType>
bool EventHandlerWrapper<EventType>::call(const Event & e) {
	return this->handler(static_cast<const EventType &>(e));
}

} //namespace crepe