aboutsummaryrefslogtreecommitdiff
path: root/src/events/Event.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/events/Event.hpp')
-rw-r--r--src/events/Event.hpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/events/Event.hpp b/src/events/Event.hpp
new file mode 100644
index 0000000..a0853d6
--- /dev/null
+++ b/src/events/Event.hpp
@@ -0,0 +1,19 @@
+#pragma once
+
+#include <QtCore>
+#include <lua.hpp>
+
+#define SET_FIELD(NAME, TYPE, VALUE) \
+ lua_pushstring(state, NAME); \
+ lua_push##TYPE(state, VALUE); \
+ lua_settable(state, -3);
+
+class Event {
+public:
+ QString kind = "-";
+
+ virtual void lua_push(lua_State *state) const {
+ lua_newtable(state);
+ SET_FIELD("type", string, kind.toStdString().c_str())
+ };
+};