contains method

bool contains(
  1. int cellX,
  2. int cellY
)

Whether (cellX, cellY) is inside this rectangle.

Implementation

bool contains(int cellX, int cellY) {
  return cellX >= left && cellX < right && cellY >= top && cellY < bottom;
}