bitcraft / pyscroll

make scrolling games with animated maps in pygame
GNU General Public License v3.0
172 stars 28 forks source link

typing #59

Closed JaskRendix closed 8 months ago

JaskRendix commented 8 months ago

PR:

and updates:

    tile_size = None             # (int, int): size of each tile in pixels
    map_size = None              # (int, int): size of map in tiles
    visible_tile_layers = None   # list of visible layer integers

into

    # (int, int): size of each tile in pixels
    tile_size: Vector2DInt = (0,0) (or tuple[int, int])
    # (int, int): size of map in tiles
    map_size: Vector2DInt = (0,0) (or tuple[int, int])
    # list of visible layer integers
    visible_tile_layers: list[int] = [] (or Iterable[int] or Iterable[Any]?)

the alternative is to disseminate multiple asserts around the code

        self._tile_view = None        # this rect represents each tile on the buffer

        self._tile_view = Rect(
            0, 0, 0, 0
        )  # this rect represents each tile on the buffer

same as above (asserts)