2015-02-07 03:05:28 +00:00
|
|
|
#ifndef MWGUI_TIMEADVANCER_H
|
|
|
|
#define MWGUI_TIMEADVANCER_H
|
|
|
|
|
2022-06-04 13:26:36 +00:00
|
|
|
#include <MyGUI_Delegate.h>
|
2015-02-07 03:05:28 +00:00
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
|
|
|
class TimeAdvancer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TimeAdvancer(float delay);
|
|
|
|
|
|
|
|
void run(int hours, int interruptAt = -1);
|
|
|
|
void stop();
|
|
|
|
void onFrame(float dt);
|
|
|
|
|
2021-03-29 17:44:23 +00:00
|
|
|
int getHours() const;
|
|
|
|
bool isRunning() const;
|
2015-02-07 03:05:28 +00:00
|
|
|
|
|
|
|
// signals
|
|
|
|
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
|
|
|
|
typedef MyGUI::delegates::CMultiDelegate2<int, int> EventHandle_IntInt;
|
|
|
|
|
|
|
|
EventHandle_IntInt eventProgressChanged;
|
|
|
|
EventHandle_Void eventInterrupted;
|
|
|
|
EventHandle_Void eventFinished;
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool mRunning;
|
|
|
|
|
|
|
|
int mCurHour;
|
|
|
|
int mHours;
|
|
|
|
int mInterruptAt;
|
|
|
|
|
|
|
|
float mDelay;
|
|
|
|
float mRemainingTime;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|