Merge branch 'master' into 'familiars'

# Conflicts:
#   squirrelbattle/display/display_manager.py
#   squirrelbattle/display/logsdisplay.py
#   squirrelbattle/display/mapdisplay.py
#   squirrelbattle/display/menudisplay.py
#   squirrelbattle/menus.py
This commit is contained in:
eichhornchen
2021-01-05 10:27:39 +01:00
15 changed files with 167 additions and 57 deletions

View File

@ -3,20 +3,25 @@
from squirrelbattle.interfaces import Map
from .display import Display
from ..game import Game
class MapDisplay(Display):
"""
A class to handle the display of the map.
"""
map: Map
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.pad.resize(500, 500)
self.addstr(self.pad, 0, 0, self.map.draw_string(self.pack),
self.pack.tile_fg_color, self.pack.tile_bg_color)
for e in self.map.entities: