ThreadPool stand-alone results

This commit is contained in:
MihailRis
2024-04-05 20:36:11 +03:00
parent c1ab97eb15
commit 68320629de
4 changed files with 25 additions and 13 deletions
+1 -5
View File
@@ -37,10 +37,6 @@ WorldConverter::~WorldConverter() {
delete wfile;
}
bool WorldConverter::hasNext() const {
return !tasks.empty();
}
void WorldConverter::convertRegion(fs::path file) {
int x, z;
std::string name = file.stem().string();
@@ -72,7 +68,7 @@ void WorldConverter::convertPlayer(fs::path file) {
}
void WorldConverter::convertNext() {
if (!hasNext()) {
if (tasks.empty()) {
throw std::runtime_error("no more regions to convert");
}
convert_task task = tasks.front();
+1 -2
View File
@@ -41,7 +41,6 @@ public:
);
~WorldConverter();
bool hasNext() const;
void convertNext();
void setOnComplete(runnable callback) {
@@ -50,7 +49,7 @@ public:
void update() override {
convertNext();
if (onComplete && !hasNext()) {
if (onComplete && tasks.empty()) {
onComplete();
}
}