diff options
author | chai <chaifix@163.com> | 2018-05-17 19:12:18 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-05-17 19:12:18 +0800 |
commit | 9edf2ba9fe8524976d2f298767fff0149e8c0d41 (patch) | |
tree | 38d74676a57de508a40ac581286255c2a18dce12 /src/libjin/core | |
parent | 70cdd89e887641b7423e5d4d05928d14ee014aba (diff) |
change file tree
Diffstat (limited to 'src/libjin/core')
-rw-r--r-- | src/libjin/core/game.cpp | 14 | ||||
-rw-r--r-- | src/libjin/core/game.h | 38 |
2 files changed, 52 insertions, 0 deletions
diff --git a/src/libjin/core/game.cpp b/src/libjin/core/game.cpp new file mode 100644 index 0000000..1c47d87 --- /dev/null +++ b/src/libjin/core/game.cpp @@ -0,0 +1,14 @@ +#include "game.h" + +namespace jin +{ +namespace core +{ + + Game* Game::g_game = 0; + + Game::Game() :run(true) {}; + +} +} + diff --git a/src/libjin/core/game.h b/src/libjin/core/game.h new file mode 100644 index 0000000..d56b249 --- /dev/null +++ b/src/libjin/core/game.h @@ -0,0 +1,38 @@ +#ifndef __JIN_CORE_GAME_H +#define __JIN_CORE_GAME_H + +namespace jin +{ +namespace core +{ + class Game + { + public: + + static inline Game* get() + { + return g_game ? g_game : (g_game = new Game()); + } + + inline void quit() + { + run = false; + } + + inline bool running() + { + return run; + } + + private: + + Game(); + + static Game* g_game; + + bool run; + }; +} +} + +#endif
\ No newline at end of file |