www.pudn.com > Tetris.rar > CGameTimer.h
#ifndef __CGAMETIMER_H #define __CGAMETIMER_H // INCLUDES #includeclass MGameTimerObserver; // CGameTime's purpose give a regular timer to CGameEngine class CGameTimer : public CBase { // Construct and destruct public: static CGameTimer* NewL(MGameTimerObserver& aObserver); ~CGameTimer(); private: CGameTimer(MGameTimerObserver& aObserver); void ConsturctL(); ///////////////////////////////////////////////////////////////////// // Other method public: void Start(); // start time void Cancel(); // cancel time void SetTickTime(TTimeIntervalMicroSeconds32 aTickTime); private: static TInt Period(TAny* aPtr); /// Called by Period /// @return boolean ETrue continues timer, EFalse stops. TInt DoCall(); ///////////////////////////////////////////////////////////////////// // data private: TTimeIntervalMicroSeconds32 iTick; MGameTimerObserver& iObserver; CPeriodic* iPeriodicTimer; // has a }; #endif