ThreadPool stand-alone results
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user