GridWalkable<E>.diagonal constructor

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

Creates a new lazily built weighted graph from a grid.

Each diagonal, or ordinal direction is connected to each node.

Implementation

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