1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

ThreadPool implementation. It runs, but dies from race conditions.

This commit is contained in:
Tomasz Zieliński
2023-05-06 18:54:19 +02:00
parent a952a9e279
commit a8545935c3
9 changed files with 413 additions and 13 deletions

View File

@@ -179,6 +179,30 @@ rmg::Path Zone::searchPath(const int3 & src, bool onlyStraight, const std::funct
return searchPath(rmg::Area({src}), onlyStraight, areafilter);
}
TRMGJob Zone::getNextJob()
{
for (auto& modificator : modificators)
{
if (modificator->hasJobs())
{
return modificator->getNextJob();
}
}
return TRMGJob();
}
bool Zone::hasJobs()
{
for (auto& modificator : modificators)
{
if (modificator->hasJobs())
{
return true;
}
}
return false;
}
void Zone::connectPath(const rmg::Path & path)
///connect current tile to any other free tile within zone
{