GlPortal Class Reference  0.1.1
Source code documentation of the free and open 3D action puzzle game.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Event.hpp
Go to the documentation of this file.
1 #ifndef EVENT_HPP
2 #define EVENT_HPP
3 
4 #include <string>
5 
6 #include <radix/util/Hash.hpp>
7 
8 namespace radix {
9 
10 using StaticEventType = const uint32_t;
11 using EventType = uint32_t;
12 using StaticEventTypeName = const char *const;
13 using EventTypeName = std::string;
14 
15 struct Event {
16  constexpr static EventType TypeNameHash(StaticEventTypeName etn) {
17  return (EventType) Hash32(etn);
18  }
19 
20  virtual const EventType getType() const = 0;
21  virtual const EventTypeName getTypeName() const = 0;
22 };
23 
24 } /* namespace radix */
25 
26 #endif /* EVENT_HPP */
27 
28 /*
29  * constexpr static EventType TypeNameHash(StaticEventTypeName etn) {
30  return static_cast<EventType>(Hash32(etn));
31  }
32 
33  virtual ~Event();
34 
35  virtual EventType getType() const = 0;
36  virtual const EventTypeName getTypeName() const = 0;*/
Definition: GameController.hpp:7
Definition: Event.hpp:15
virtual const EventTypeName getTypeName() const =0
const uint32_t StaticEventType
Definition: Event.hpp:10
std::string EventTypeName
Definition: Event.hpp:13
virtual const EventType getType() const =0
static constexpr EventType TypeNameHash(StaticEventTypeName etn)
Definition: Event.hpp:16
constexpr uint32_t Hash32(const char *str)
Definition: Hash.hpp:81
uint32_t EventType
Definition: Event.hpp:11
const char *const StaticEventTypeName
Definition: Event.hpp:12