GridWalkable<E>.all8Directions constructor

GridWalkable<E>.all8Directions(
  1. Grid<E> grid, {
  2. double weight(
    1. E,
    2. E,
    3. Pos
    ) = _defaultWeight,
})

Creates a new lazily built weighted graph from a grid.

Both the cardinal and ordinal directions are connected to each node.

Implementation

factory GridWalkable.all8Directions(
  Grid<E> grid, {
  double Function(E, E, Pos) weight = _defaultWeight,
}) {
  return GridWalkable._(
    grid,
    Direction.all,
    weight,
  );
}