2021-12-16 23:48:52 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <hex.hpp>
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace hex {
|
|
|
|
|
|
|
|
class Task {
|
|
|
|
public:
|
2022-01-24 20:53:17 +01:00
|
|
|
Task(const std::string &unlocalizedName, u64 maxValue);
|
2021-12-16 23:48:52 +01:00
|
|
|
~Task();
|
|
|
|
|
2022-01-09 21:27:59 +01:00
|
|
|
void setMaxValue(u64 maxValue);
|
2021-12-16 23:48:52 +01:00
|
|
|
void update(u64 currValue);
|
|
|
|
void finish();
|
|
|
|
|
2022-01-24 20:53:17 +01:00
|
|
|
[[nodiscard]] double getProgress() const;
|
2021-12-16 23:48:52 +01:00
|
|
|
|
2022-01-24 20:53:17 +01:00
|
|
|
[[nodiscard]] const std::string &getName() const;
|
2021-12-16 23:48:52 +01:00
|
|
|
|
2022-01-24 20:53:17 +01:00
|
|
|
[[nodiscard]] bool isPending() const;
|
2022-01-09 21:27:59 +01:00
|
|
|
|
2021-12-16 23:48:52 +01:00
|
|
|
private:
|
|
|
|
std::string m_name;
|
|
|
|
u64 m_maxValue, m_currValue;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|