This commit is contained in:
Yohann D'ANELLO
2020-11-06 21:15:09 +01:00
parent 2e667cdebe
commit 0bd26a1bd0
5 changed files with 54 additions and 31 deletions

View File

@ -1,21 +1,25 @@
import curses
from typing import Any
from .mapdisplay import MapDisplay
from .texturepack import TexturePack
from ..game import Game
class Display:
def __init__(self, game, screen):
def __init__(self, game: Game, screen: Any):
self.screen = screen
self.game = game
lines = curses.LINES if screen else 4
cols = curses.COLS * 4 // 5 if screen else 4
self.map_display = MapDisplay(game.m,
TexturePack.get_pack(
game.settings.TEXTURE_PACK),
game.settings.TEXTURE_PACK
),
lines, cols, screen is not None)
def refresh(self):
def refresh(self) -> None:
self.map_display.update_pad()
def display(self, y, x):
def display(self, y: int, x: int) -> None:
self.map_display.display(y, x)