private bool IsInBounds(int x, int y) { if (x < 0 || x >= Width) return false; if (y < 0 || y >= Height) return false; return true; }