/// <summary> /// Expands the path search until a path is found, and returns that path. /// Returned path is *reversed* and given target to source. /// </summary> public List <CPos> FindPath(PathSearch search) { while (search.CanExpand) { var p = search.Expand(); if (search.IsTarget(p)) { return(MakePath(search.Graph, p)); } } return(NoPath); }