This commit is contained in:
Yohann D'ANELLO
2020-11-10 20:34:22 +01:00
parent 1ff2e26cd4
commit 5c95bf11e7
7 changed files with 72 additions and 71 deletions

View File

@ -1,11 +1,15 @@
import curses
from typing import Any, Union
from typing import Any
from dungeonbattle.tests.screen import FakePad
class Display:
x: int
y: int
width: int
height: int
def __init__(self, screen: Any, pack: Any):
self.screen = screen
self.pack = pack
@ -13,19 +17,19 @@ class Display:
def newpad(self, height: int, width: int) -> Union[FakePad, Any]:
return curses.newpad(height, width) if self.screen else FakePad()
def resize(self, y, x, height, width):
def resize(self, y: int, x: int, height: int, width: int) -> None:
self.x = x
self.y = y
self.width = width
self.height = height
def refresh(self, *args):
def refresh(self, *args) -> None:
if len(args) == 4:
self.resize(*args)
self.display()
def display(self):
pass
def display(self) -> None:
raise NotImplementedError
@property
def rows(self) -> int: