#ifndef INOTIFY_UPDATE
#define INOTIFY_UPDATE

#include <QtGui>
#include <ctime>

class NotifyWidget : public QWidget {
	Q_OBJECT
private:
	unsigned long gameSecondsPerActualSecond;
public:
	virtual void notifyUpdate() = 0;

	NotifyWidget(QWidget * parent);

	clock_t updateTime;

	double getDifferenceFromUpdateTime();

	void rememberUpdateTime();

	template<class T>
	static T getUpdatedValue(T oldValue, double gradient, double difference) {
		T result = difference * gradient + oldValue;
		return result;
	}

	void setGameSecondsPerActualSecond(unsigned long value);
};

#endif