boolaccesible;//true if a hero can be on this node
intdist;//distance from the first node of searching; -1 is infinity
CPathNode*theNodeBefore;
int3coord;//coordiantes
boolvisited;
};
structCPath
{
std::vector<CPathNode>nodes;//just get node by node
int3startPos();// start point
int3endPos();//destination point
};
/**
*mainpathfinderclass
*/
classCPathfinder
{
private:
std::vector<std::vector<CPathNode>>graph;
voidprocessNode(CPathNode&dp,constCGHeroInstance*hero,std::queue<CPathNode>&mq,constCPathNode&cp,constint3&src,booldiagonal);//helper function for getPath
CPath*getPath(int3src,int3dest,constCGHeroInstance*hero,unsignedchartype=0);//calculates path between src and dest; returns pointer to CPath or NULL if path does not exists; type - type of calculation: 0 - positions are normal positions of hero; 1 - given places are tiles blocked by hero
CPath*getPath(constint3&src,constint3&dest,constCGHeroInstance*hero,int(*getDist)(int3&a,int3&b),unsignedchartype=0);//calculates path between src and dest; returns pointer to CPath or NULL if path does not exists; uses getDist to calculate distance; type - type of calculation: 0 - positions are normal positions of hero; 1 - given places are tiles blocked by hero
staticvoidconvertPath(CPath*path,unsignedintmode);//mode=0 -> from 'manifest' to 'object'