containsPos method

bool containsPos(
  1. Pos pos
)

Returns whether a position is within the bounds of the grid.

Implementation

bool containsPos(Pos pos) {
  return pos.x >= 0 && pos.x < width && pos.y >= 0 && pos.y < height;
}