From 6c8446cddb37df732fc9e5fc21f98e31968ce634 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 1 Feb 2008 19:34:47 +0000 Subject: interface cleanup --- src/core/gameinterface.cc | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/core/gameinterface.cc (limited to 'src/core/gameinterface.cc') diff --git a/src/core/gameinterface.cc b/src/core/gameinterface.cc new file mode 100644 index 0000000..964da2d --- /dev/null +++ b/src/core/gameinterface.cc @@ -0,0 +1,37 @@ +/* + core/game.cc + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 +*/ + +#include "core/gameinterface.h" + +#include + +#include + +namespace core { + +GameInterface *GameInterface::gameinterface_instance = 0; + +GameInterface::GameInterface() +{ + if (gameinterface_instance) { + std::cerr << "multiple singleton instances: core::GameInterface" << std::endl; + exit(2); + } + gameinterface_instance = this; +} + +GameInterface::~GameInterface() +{ + gameinterface_instance = 0; +} + +GameInterface *GameInterface::instance() +{ + return gameinterface_instance; +} + +} + -- cgit v1.2.3