def tile(self, x: int, y: int) -> Tile: """ :param x: x-coordinate of tile :type x: int :param y: y-coordinate of tile :type y: int :return: Tile at coordinate (x, y) :rtype: Tile """ grids = self.dungeon.grids(Point(x, y)) tile = Tile.from_grid(Point(x, y), grids) return tile
def tile(self, point: Point) -> Tile: tile = Tile.empty(point) if self.in_bounds(point): tile = Tile.from_grid(point, self.grids(point)) return tile
def __iter__(self) -> [Point, Dict[str, int]]: for y in range(self.height): for x in range(self.width): point = Point(x, y) yield point, Tile.from_grid(point, self.grids(point))