asUnweighted method

Walkable<Pos> asUnweighted({
  1. Iterable<Pos> directions = Direction.cardinal,
})

Returns a view of this grid as an unweighted walkable.

The view is a Walkable where nodes are positions in the grid, and edges are pairs of elements at each position. The directions are the relative positions of the neighbors to connect each node to, which by default are the four cardinal directions (north, east, south, west).

Implementation

Walkable<Pos> asUnweighted({
  Iterable<Pos> directions = Direction.cardinal,
}) {
  return asWeighted(
    directions: directions,
    weight: _eachWeightIs1,
  ).asUnweighted();
}