More generic display update
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
|
||||
from squirrelbattle.interfaces import Map
|
||||
from .display import Display
|
||||
from ..game import Game
|
||||
|
||||
|
||||
class MapDisplay(Display):
|
||||
@ -10,9 +11,10 @@ class MapDisplay(Display):
|
||||
def __init__(self, *args):
|
||||
super().__init__(*args)
|
||||
|
||||
def update_map(self, m: Map) -> None:
|
||||
self.map = m
|
||||
self.pad = self.newpad(m.height, self.pack.tile_width * m.width + 1)
|
||||
def update(self, game: Game) -> None:
|
||||
self.map = game.map
|
||||
self.pad = self.newpad(self.map.height,
|
||||
self.pack.tile_width * self.map.width + 1)
|
||||
|
||||
def update_pad(self) -> None:
|
||||
self.addstr(self.pad, 0, 0, self.map.draw_string(self.pack),
|
||||
|
Reference in New Issue
Block a user