diff options
author | chai <chaifix@163.com> | 2018-05-17 18:45:24 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-05-17 18:45:24 +0800 |
commit | df4b054b8e8d00f7817daaa4cbf6961712cd0b75 (patch) | |
tree | 03fae2233f3c17a91d22e61a139fcc62d6a50bf3 /src/core/game.h | |
parent | 34947d066b994c2ef9121a83497da344982d28e2 (diff) |
v0.1.0
Diffstat (limited to 'src/core/game.h')
-rw-r--r-- | src/core/game.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/core/game.h b/src/core/game.h index 939d945..d56b249 100644 --- a/src/core/game.h +++ b/src/core/game.h @@ -9,12 +9,21 @@ namespace core { public: - void quit(); - - bool running(); - - static Game* get(); - + 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(); |