1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-14 15:40:18 +00:00
OpenMW/apps/openmw/mwgui/timeadvancer.hpp

41 lines
825 B
C++
Raw Normal View History

#ifndef MWGUI_TIMEADVANCER_H
#define MWGUI_TIMEADVANCER_H
#include <MyGUI_Delegate.h>
namespace MWGui
{
class TimeAdvancer
{
2022-09-22 21:26:05 +03:00
public:
TimeAdvancer(float delay);
2022-09-22 21:26:05 +03:00
void run(int hours, int interruptAt = -1);
void stop();
void onFrame(float dt);
2022-09-22 21:26:05 +03:00
int getHours() const;
bool isRunning() const;
2022-09-22 21:26:05 +03:00
// signals
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
typedef MyGUI::delegates::MultiDelegate<int, int> EventHandle_IntInt;
2022-09-22 21:26:05 +03:00
EventHandle_IntInt eventProgressChanged;
EventHandle_Void eventInterrupted;
EventHandle_Void eventFinished;
2022-09-22 21:26:05 +03:00
private:
bool mRunning;
2022-09-22 21:26:05 +03:00
int mCurHour;
int mHours;
int mInterruptAt;
2022-09-22 21:26:05 +03:00
float mDelay;
float mRemainingTime;
};
}
#endif