summaryrefslogtreecommitdiff
path: root/game/gamestate.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-03-15 23:40:04 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-03-15 23:40:04 +0000
commit125c9867da9cc58f0a250c7316f06755b1cc18ac (patch)
treea6ad259e48cd0d58b4755b3e662a9eeda2a21391 /game/gamestate.cpp
parentRoute Walker returns Link::Nexts, not vector links (diff)
downloadilt-125c9867da9cc58f0a250c7316f06755b1cc18ac.tar.bz2
ilt-125c9867da9cc58f0a250c7316f06755b1cc18ac.tar.xz
ilt-125c9867da9cc58f0a250c7316f06755b1cc18ac.zip
Create GameState, the single global for the root of everything
Diffstat (limited to 'game/gamestate.cpp')
-rw-r--r--game/gamestate.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/game/gamestate.cpp b/game/gamestate.cpp
new file mode 100644
index 0000000..fcd4248
--- /dev/null
+++ b/game/gamestate.cpp
@@ -0,0 +1,15 @@
+#include "gamestate.h"
+#include <cassert>
+
+GameState * gameState {nullptr};
+
+GameState::GameState()
+{
+ assert(!gameState);
+ gameState = this;
+}
+
+GameState::~GameState()
+{
+ gameState = nullptr;
+}