2013-07-22 06:54:09 +03:00
|
|
|
#ifndef __CLOCK_H__
|
|
|
|
#define __CLOCK_H__
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <SDL.h>
|
|
|
|
|
|
|
|
class Clock {
|
|
|
|
public:
|
2013-08-06 22:55:31 +03:00
|
|
|
Clock();
|
2013-07-22 06:54:09 +03:00
|
|
|
~Clock();
|
|
|
|
|
2013-08-06 22:55:31 +03:00
|
|
|
std::string getTime(bool is24 = true);
|
|
|
|
|
|
|
|
class Forwarder;
|
|
|
|
friend Forwarder;
|
2013-07-22 06:54:09 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
void addTimer(int timeout);
|
2013-08-06 22:55:31 +03:00
|
|
|
void resetTimer();
|
2013-07-22 06:54:09 +03:00
|
|
|
int update();
|
2013-08-06 22:55:31 +03:00
|
|
|
unsigned int clockCallback(unsigned int timeout);
|
2013-07-22 06:54:09 +03:00
|
|
|
|
|
|
|
SDL_TimerID timer;
|
|
|
|
unsigned int timeout_startms;
|
|
|
|
int minutes, hours;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __CLOCK_H__ */
|