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