aboutsummaryrefslogtreecommitdiff
path: root/src/core/game.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-05-17 18:45:24 +0800
committerchai <chaifix@163.com>2018-05-17 18:45:24 +0800
commitdf4b054b8e8d00f7817daaa4cbf6961712cd0b75 (patch)
tree03fae2233f3c17a91d22e61a139fcc62d6a50bf3 /src/core/game.h
parent34947d066b994c2ef9121a83497da344982d28e2 (diff)
v0.1.0
Diffstat (limited to 'src/core/game.h')
-rw-r--r--src/core/game.h21
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();