@tamb/gamegrid
    Preparing search index...

    Type Alias IsWalkable

    IsWalkable: (matrix: Cell[][], x: number, y: number) => boolean

    Whether a cell can be entered. Out-of-range coordinates must return false.

    Type Declaration

      • (matrix: Cell[][], x: number, y: number): boolean
      • Parameters

        • matrix: Cell[][]

          Board the coordinate is read from.

        • x: number

          Column.

        • y: number

          Row.

        Returns boolean

        True when a step may land on that cell.

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

    const isWalkable = walkableUnlessTypes(["wall", "water"]);
    import type { IsWalkable } from "@tamb/gamegrid/npc";

    const isWalkable: IsWalkable = (matrix, x, y) => matrix[y]?.[x]?.type === "floor";