private UInt16 Grid(int x, int y) { if (x >= 0 && x < mapWidth && y >= 0 && y < mapHeight) return grid[x, y]; //All tiles stored outside of the map are empty return 0; }