4#ifndef TRAM_SDK_FRAMEWORK_EVENT_H
5#define TRAM_SDK_FRAMEWORK_EVENT_H
70 explicit operator bool() {
return listener != 0; }
Definition: entitycomponent.h:18
Smart wrapper class for Event listeners.
Definition: event.h:64
~EventListener()
Definition: event.cpp:222
listener_t listener
Definition: event.h:72
void make(event_t event, Entity *parent)
Definition: event.cpp:226
void clear()
Definition: event.cpp:236
Generic, type-safe union.
Definition: value.h:18
uint16_t event_t
Definition: event.h:15
uint32_t id_t
Definition: core.h:11
uint32_t listener_t
Definition: event.h:17
static void RemoveListener(listener_t listener_id)
Deregisters a listener.
Definition: event.cpp:155
static T * AllocateData()
Definition: event.h:49
static event_t GetLast()
Definition: event.cpp:87
static void Dispatch()
Dispatches events from the event queue.
Definition: event.cpp:181
static void Post(const Event &event)
Adds an event to the event queue.
Definition: event.cpp:209
event_t subtype
Definition: event.h:53
void * data
Definition: event.h:57
Type
Definition: event.h:25
@ TICK
Definition: event.h:31
@ KEYCHAR
Definition: event.h:29
@ KEYUP
Definition: event.h:28
@ LAST_EVENT
Definition: event.h:34
@ CURSORPOS
Definition: event.h:30
@ SELECTED
Definition: event.h:32
@ KEYDOWN
Definition: event.h:27
@ LOOK_AT
Definition: event.h:33
@ KEYPRESS
Definition: event.h:26
event_t type
Definition: event.h:52
static event_t Register(const char *name)
Registers a new event type.
Definition: event.cpp:59
Value * data_value
Definition: event.h:59
uint64_t data_int
Definition: event.h:58
static T * AllocateData(const T &data)
Definition: event.h:50
static name_t GetName(event_t type)
Definition: event.cpp:83
static listener_t AddListener(event_t type, EntityComponent *component)
Registers a listener.
Definition: event.cpp:102
static event_t GetType(name_t name)
Definition: event.cpp:68
id_t poster_id
Definition: event.h:54