From 870fcdae66edc680cac55defb149e1434e865f37 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 14 Dec 2018 14:55:42 +0800 Subject: =?UTF-8?q?*=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/time/je_timer.h | 68 +++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'src/libjin/time/je_timer.h') diff --git a/src/libjin/time/je_timer.h b/src/libjin/time/je_timer.h index a918d63..1209827 100644 --- a/src/libjin/time/je_timer.h +++ b/src/libjin/time/je_timer.h @@ -12,15 +12,15 @@ namespace JinEngine { - namespace Time - { + namespace Time + { /// /// /// - class Timer : public Object - { - public: + class Timer : public Object + { + public: typedef std::function TimerCallback; @@ -58,32 +58,32 @@ namespace JinEngine /// /// /// - Timer(); + Timer(); /// /// /// - ~Timer(); + ~Timer(); /// /// /// - void update(float dt); + void update(float dt); /// /// /// - Handler* every(float dt, TimerCallback callback, void* paramters = nullptr, FinishCallback finish = nullptr); + Handler* every(float dt, TimerCallback callback, void* paramters = nullptr, FinishCallback finish = nullptr); /// /// /// - Handler* after(float dt, TimerCallback callback, void* paramters, FinishCallback finish); + Handler* after(float dt, TimerCallback callback, void* paramters, FinishCallback finish); /// /// /// - Handler* repeat(float dt, int count, TimerCallback callback, void* paramters, FinishCallback finish); + Handler* repeat(float dt, int count, TimerCallback callback, void* paramters, FinishCallback finish); /// /// @@ -95,43 +95,43 @@ namespace JinEngine /// void cancelAll(); - private: + private: - std::vector mHandlers; + std::vector mHandlers; - }; + }; /// /// /// - inline void sleep(int ms) - { - #if jin_time == jin_time_sdl - SDL_Delay(ms); - #endif - } + inline void sleep(int ms) + { + #if jin_time == jin_time_sdl + SDL_Delay(ms); + #endif + } /// /// /// - inline double getSecond() - { - #if jin_time == jin_time_sdl - return SDL_GetTicks() / 1000.f; - #endif - } + inline double getSecond() + { + #if jin_time == jin_time_sdl + return SDL_GetTicks() / 1000.f; + #endif + } /// /// /// - inline double getMilliSecond() - { - #if jin_time == jin_time_sdl - return SDL_GetTicks(); - #endif - } - - } // namespace Time + inline double getMilliSecond() + { + #if jin_time == jin_time_sdl + return SDL_GetTicks(); + #endif + } + + } // namespace Time } // namespace JinEngine #endif // defined(jin_time) -- cgit v1.1-26-g67d0