diff --git a/src/utility/hexgrid.ts b/src/utility/hexgrid.ts index a71d5b104..63d0099f4 100644 --- a/src/utility/hexgrid.ts +++ b/src/utility/hexgrid.ts @@ -8,6 +8,7 @@ import * as arrayUtils from './arrayUtils'; import Game from '../game'; import { DEBUG } from '../debug'; import { HEX_WIDTH_PX } from './const'; +import { Point } from './pointfacade'; interface GridDefinition { numRows: number; @@ -241,6 +242,12 @@ export class HexGrid { } } + isInBounds({ x, y }: Point) { + return ( + y < this.game.grid.hexes.length && y >= 0 && x < this.game.grid.hexes[y].length && x >= 0 + ); + } + querySelf(o) { const game = this.game; const defaultOpt = {