From 066e5987c515dfc34537d73ca9d2a81ddd1f9e1b Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 21 Oct 2018 13:37:27 +0800 Subject: =?UTF-8?q?*=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Game/je_game.h | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'src/libjin/Game/je_game.h') diff --git a/src/libjin/Game/je_game.h b/src/libjin/Game/je_game.h index 8fe4b51..6f7ad6d 100644 --- a/src/libjin/Game/je_game.h +++ b/src/libjin/Game/je_game.h @@ -12,6 +12,9 @@ namespace JinEngine namespace Core { + /// + /// Game class. + /// class Game : public Subsystem { public: @@ -21,6 +24,9 @@ namespace JinEngine typedef void(*onUpdate)(int dt); typedef void(*onDraw)(); + /// + /// Game setting. + /// struct Setting : SettingBase { onEvent eventHandler; @@ -29,12 +35,31 @@ namespace JinEngine onLoad loader; }; + /// + /// Main game loop. + /// void run(); - inline void stop() { _running = false; }; - inline bool running() { return _running; }; + + /// + /// Stop game. + /// + inline void stop() + { + _running = false; + }; + + /// + /// Return if game is running. + /// + /// @return True if game is running, otherwise return false. + /// + inline bool running() + { + return _running; + }; private: - + Game(); ~Game() {}; @@ -55,4 +80,4 @@ namespace JinEngine } // namespace Core } // namespace JinEngine -#endif // __JE_CORE_GAME_H +#endif // __JE_CORE_GAME_H \ No newline at end of file -- cgit v1.1-26-g67d0