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:
committed by
Andrii Danylchenko
parent
99a9680f62
commit
f81d869b4a
@ -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;
|
||||
|
Reference in New Issue
Block a user