You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
442 B
C++
33 lines
442 B
C++
5 years ago
|
/*
|
||
|
Timer test
|
||
|
|
||
|
project: RYZOM / TEST
|
||
|
*/
|
||
|
|
||
|
#include "game_share/timer.h"
|
||
|
|
||
|
class CTimerTest: public IServiceSingleton
|
||
|
{
|
||
|
public:
|
||
|
class CTimerTestTimerEvent:public CTimerEvent
|
||
|
{
|
||
|
public:
|
||
|
void timerCallback(CTimer* owner)
|
||
|
{
|
||
|
nlinfo("tick!");
|
||
|
// repeat every 20 ticks
|
||
|
owner->setRemaining(20,this);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
void init()
|
||
|
{
|
||
|
_Timer.setRemaining(20,new CTimerTestTimerEvent);
|
||
|
}
|
||
|
|
||
|
private:
|
||
|
CTimer _Timer;
|
||
|
};
|
||
|
|
||
|
static CTimerTest Test;
|