diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/game.cpp | 27 | ||||
-rw-r--r-- | src/core/game.h | 29 |
2 files changed, 56 insertions, 0 deletions
diff --git a/src/core/game.cpp b/src/core/game.cpp new file mode 100644 index 0000000..6452f48 --- /dev/null +++ b/src/core/game.cpp @@ -0,0 +1,27 @@ +#include "game.h" + +namespace jin +{ +namespace core +{ + Game* Game::g_game = 0; + + Game::Game() :run(true) {}; + + Game* Game::get() + { + return g_game ? g_game : (g_game = new Game()); + } + + void Game::quit() + { + run = false; + } + + bool Game::running() + { + return run; + } +} +} + diff --git a/src/core/game.h b/src/core/game.h new file mode 100644 index 0000000..939d945 --- /dev/null +++ b/src/core/game.h @@ -0,0 +1,29 @@ +#ifndef __JIN_CORE_GAME_H +#define __JIN_CORE_GAME_H + +namespace jin +{ +namespace core +{ + class Game + { + public: + + void quit(); + + bool running(); + + static Game* get(); + + private: + + Game(); + + static Game* g_game; + + bool run; + }; +} +} + +#endif
\ No newline at end of file |