@tamb/gamegrid
    Preparing search index...

    Function listOpenCells

    • Every cell the walk predicate accepts, row by row.

      Parameters

      • matrix: Cell[][]

        Board to scan.

      • isWalkable: IsWalkable

        Which cells count as open.

      Returns Coord[]

      Coordinates that can be entered.

      import { listOpenCells, walkableUnlessTypes } from "@tamb/gamegrid/npc";

      const matrix = [
      [{ type: "wall" }, { type: "floor" }],
      [{ type: "floor" }, { type: "water" }],
      ];
      const open = listOpenCells(matrix, walkableUnlessTypes(["wall", "water"]));
      // [[1, 0], [0, 1]]