More generic display update

This commit is contained in:
Yohann D'ANELLO
2020-12-18 15:07:09 +01:00
parent b8d32b29c8
commit 85870494a0
8 changed files with 46 additions and 18 deletions

View File

@ -3,6 +3,7 @@
import curses
from squirrelbattle.display.display import Box, Display
from squirrelbattle.game import Game
class MessageDisplay(Display):
@ -17,8 +18,8 @@ class MessageDisplay(Display):
self.message = ""
self.pad = self.newpad(1, 1)
def update_message(self, msg: str) -> None:
self.message = msg
def update(self, game: Game) -> None:
self.message = game.message
def display(self) -> None:
self.box.refresh(self.y - 1, self.x - 2,