Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
BaseEvent.hpp
1#pragma once
2
3#include "EventType.hpp"
4
5namespace Grindstone {
6 namespace Events {
7 struct BaseEvent {
8 virtual EventType GetEventType() const = 0;
9 virtual const char* GetName() const = 0;
10 virtual const char* ToString() const {
11 return GetName();
12 };
13 }; // struct BaseEvent
14 } // namespace Events
15} // namespace Grindstone
16
17#define SETUP_EVENT(type) static EventType GetStaticType() { return EventType::type; }\
18 virtual EventType GetEventType() const override { return EventType::type; }\
19 virtual const char* GetName() const override { return #type; }
Definition BaseEvent.hpp:7