contains method
Checks if the given point (x, y) is contained within this rectangle.
x The x-coordinate of the point to check.
y The y-coordinate of the point to check.
Returns true if the point is inside the rectangle, false otherwise.
Implementation
bool contains(final int x, final int y) {
return x >= left && x < right && y >= top && y < bottom;
}