Linting
This commit is contained in:
@ -1,15 +1,31 @@
|
||||
import curses
|
||||
|
||||
from dungeonbattle.entities.player import Player
|
||||
|
||||
|
||||
class StatsDisplay:
|
||||
def __init__(self, player, height, width, topleftx, toplefty) :
|
||||
def __init__(self, player: Player, height: int, width: int,
|
||||
topleftx: int, toplefty: int):
|
||||
self.width = width
|
||||
self.height = height
|
||||
self.topleftx = topleftx
|
||||
self.toplefty = toplefty
|
||||
self.player = player
|
||||
self.pad = curses.newpad(height, width)
|
||||
def update_pad(self) :
|
||||
string = "Player -- LVL {} EXP {}/{} HP {}/{}\nStats : STR {} INT {} CHR {} DEX {} CON {}".format(player.level, player.currentXP, player.maxXP, player.health, player.maxhealth, player.strength, player.intelligence, player.charisma, player.dexterity, player.constitution)
|
||||
|
||||
def update_pad(self) -> None:
|
||||
string = "Player -- LVL {} EXP {}/{} HP {}/{}\n" \
|
||||
"Stats : STR {} INT {} CHR {} DEX {} CON {}"\
|
||||
.format(self.player.level, self.player.current_xp,
|
||||
self.player.max_xp, self.player.health,
|
||||
self.player.maxhealth, self.player.strength,
|
||||
self.player.intelligence, self.player.charisma,
|
||||
self.player.dexterity, self.player.constitution)
|
||||
self.pad.addstr(0, 0, string)
|
||||
def refresh(self) :
|
||||
|
||||
def refresh(self) -> None:
|
||||
self.pad.clear()
|
||||
self.update_pad()
|
||||
self.pad.refresh(0, 0, toplefty, topleftx, heigth+toplefty, width+topleftx)
|
||||
|
||||
self.pad.refresh(0, 0, self.toplefty, self.topleftx,
|
||||
self.heigth + self.toplefty,
|
||||
self.width + self.topleftx)
|
||||
|
Reference in New Issue
Block a user