From 125c9867da9cc58f0a250c7316f06755b1cc18ac Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 15 Mar 2021 23:40:04 +0000 Subject: Create GameState, the single global for the root of everything --- game/gamestate.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 game/gamestate.cpp (limited to 'game/gamestate.cpp') 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 + +GameState * gameState {nullptr}; + +GameState::GameState() +{ + assert(!gameState); + gameState = this; +} + +GameState::~GameState() +{ + gameState = nullptr; +} -- cgit v1.2.3