1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00
This commit is contained in:
AlexVinS
2019-01-08 00:49:36 +03:00
parent f1cd4656ff
commit f0492ffa53
2 changed files with 5 additions and 3 deletions

View File

@@ -23,11 +23,11 @@ private:
CPlayerSpecificInfoCallback * cb; CPlayerSpecificInfoCallback * cb;
VCAI * ai; VCAI * ai;
std::shared_ptr<AINodeStorage> getOrCreateStorage(HeroPtr hero);
public: public:
AIPathfinder(CPlayerSpecificInfoCallback * cb, VCAI * ai); AIPathfinder(CPlayerSpecificInfoCallback * cb, VCAI * ai);
std::vector<AIPath> getPathInfo(HeroPtr hero, int3 tile); std::vector<AIPath> getPathInfo(HeroPtr hero, int3 tile);
bool isTileAccessible(HeroPtr hero, int3 tile); bool isTileAccessible(HeroPtr hero, int3 tile);
std::shared_ptr<AINodeStorage> getOrCreateStorage(HeroPtr hero);
void clear(); void clear();
void init(); void init();
}; };

View File

@@ -37,6 +37,7 @@ Goals::TGoalVec PathfindingManager::howToVisitTile(int3 tile)
Goals::TGoalVec result; Goals::TGoalVec result;
auto heroes = cb->getHeroesInfo(); auto heroes = cb->getHeroesInfo();
result.reserve(heroes.size());
for(auto hero : heroes) for(auto hero : heroes)
{ {
@@ -51,6 +52,7 @@ Goals::TGoalVec PathfindingManager::howToVisitObj(ObjectIdRef obj)
Goals::TGoalVec result; Goals::TGoalVec result;
auto heroes = cb->getHeroesInfo(); auto heroes = cb->getHeroesInfo();
result.reserve(heroes.size());
for(auto hero : heroes) for(auto hero : heroes)
{ {