isInside method

bool isInside(
  1. dynamic x,
  2. dynamic y
)

Determine whether the position is inside the grid. XXX: grid.isInside(x, y) is wierd to read. It should be (x, y) is inside grid, but I failed to find a better name for this method. @param {number} x @param {number} y @return {boolean}

Implementation

bool isInside(x, y) {
  return (x >= 0 && x < this.width) && (y >= 0 && y < this.height);
}