1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

CGameState: move two pathfinding-related functions to CPathfinderHelper

Both getMovementCost and getNeighbours have nothing to do with gamestate.
This commit is contained in:
ArseniyShestakov
2015-11-10 02:15:27 +03:00
parent d3c8ca7c1c
commit b2e1ee5363
8 changed files with 111 additions and 113 deletions

View File

@@ -421,7 +421,7 @@ float FuzzyHelper::evaluate (Goals::VisitTile & g)
//assert(cb->isInTheMap(g.tile));
float turns = 0;
float distance = cb->getMovementCost(g.hero.h, g.tile);
float distance = CPathfinderHelper::getCost(g.hero.h, g.tile);
if (!distance) //we stand on that tile
turns = 0;
else
@@ -530,4 +530,4 @@ float FuzzyHelper::evaluate (Goals::AbstractGoal & g)
void FuzzyHelper::setPriority (Goals::TSubgoal & g)
{
g->setpriority(g->accept(this)); //this enforces returned value is set
}
}