mirror of
https://github.com/wu736139669/SmallGame_Cocos2dx.git
synced 2026-08-05 06:23:09 +00:00
36 lines
438 B
C++
36 lines
438 B
C++
|
|
#ifndef __CGameTimer_H__
|
|
#define __CGameTimer_H__
|
|
|
|
#include "GameCommon.h"
|
|
|
|
class CGameTimer
|
|
{
|
|
DECLARE_SINGLETON(CGameTimer, ms_instance)
|
|
|
|
public:
|
|
|
|
// 构造函数
|
|
CGameTimer();
|
|
// 析构函数
|
|
~CGameTimer();
|
|
// 获取当前时间
|
|
unsigned int GetNowTime() const;
|
|
// 重置时间
|
|
void ResetTime();
|
|
// 更新
|
|
void Update(unsigned int deltaTime);
|
|
|
|
private:
|
|
|
|
unsigned int mTimeCounter; // 记时
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif |