1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-18 17:40:48 +02:00
vcmi/lib/LoadProgress.h

32 lines
468 B
C
Raw Normal View History

2022-08-30 23:24:12 +02:00
#ifndef LOADPROGRESS_H
#define LOADPROGRESS_H
#include "StdInc.h"
#include <atomic>
namespace Load
{
using Type = unsigned char;
class DLL_LINKAGE Progress
{
public:
Progress();
virtual ~Progress() = default;
Type get() const;
bool finished() const;
void set(Type);
void reset(int s = 100);
void finish();
void steps(int);
void stepsTill(int, Type);
void step(int count = 1);
private:
std::atomic<Type> _progress, _step;
};
}
#endif // LOADPROGRESS_H