1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

Mine roads (#808)

* Create dirt roads to mines if there are no roads in a zone.
This commit is contained in:
DjWarmonger
2022-09-04 08:54:06 +02:00
committed by Andrii Danylchenko
parent 99a9680f62
commit f81d869b4a
7 changed files with 43 additions and 5 deletions

View File

@ -77,6 +77,21 @@ const rmg::Area & ObjectManager::getVisitableArea() const
return objectsVisitableArea;
}
std::vector<CGObjectInstance*> ObjectManager::getMines() const
{
std::vector<CGObjectInstance*> mines;
for (auto object : objects)
{
if (object->ID == Obj::MINE)
{
mines.push_back(object);
}
}
return mines;
}
int3 ObjectManager::findPlaceForObject(const rmg::Area & searchArea, rmg::Object & obj, std::function<float(const int3)> weightFunction, OptimizeType optimizer) const
{
float bestWeight = 0.f;