// BreadthFirstMapAt returns the cost associated to a position in the last
// computed breadth first map. It returns the last maxCost + 1 if the position
// is out of range, the same as in-range unreachable positions.
// BreadthFirstMapAt uses a cached breadth first map, that will be invalidated
// in case a new one is computed using the same PathFinder.
BreadthFirstMapAt returns the cost associated to a position in the last
computed breadth first map. It returns the last maxCost + 1 if the position
is out of range, the same as in-range unreachable positions.
BreadthFirstMapAt uses a cached breadth first map, that will be invalidated
in case a new one is computed using the same PathFinder.
// BreadthFirstMapAt returns the cost associated to a position in the last // computed breadth first map . It returns the last maxCost + 1 if the position // is out of range the same as in - range unreachable positions . // BreadthFirstMapAt uses a cached breadth first map that will be invalidated // in case a new one is computed using the same PathFinder .
func (pr *PathRange) BreadthFirstMapAt(p gruid.Point) int {
	if !p.In(pr.Rg) || pr.BfMap == nil {
		return pr.BfUnreachable
	}
	cost := pr.BfMap[pr.idx(p)]
	if cost == 0 {
		return pr.BfUnreachable
	}
	return cost - 1
}
func ( pr * PathRange ) BreadthFirstMapAt ( p gruid . Point ) int { if ! p . In ( pr . Rg ) || pr . BfMap == nil { return pr . BfUnreachable } cost := pr . BfMap [ pr . idx ( p ) ] if cost == 0 { return pr . BfUnreachable } return cost - 1 }
BreadthFirstMapAt returns the cost associated to a position in the last
computed breadth first map.
BreadthFirstMapAt returns the cost associated to a position in the last computed breadth first map .