Clean up a few type checker things
This commit is contained in:
parent
b0d91c9c5d
commit
f78bc39e3b
3 changed files with 11 additions and 4 deletions
|
@ -4,6 +4,8 @@
|
||||||
Declares the InfoWindow.
|
Declares the InfoWindow.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
from tcod.console import Console
|
||||||
|
|
||||||
from . import Window
|
from . import Window
|
||||||
from ..color import HealthBar
|
from ..color import HealthBar
|
||||||
from ..percentage_bar import PercentageBar
|
from ..percentage_bar import PercentageBar
|
||||||
|
@ -34,7 +36,7 @@ class InfoWindow(Window):
|
||||||
|
|
||||||
self.hit_points_bar.percent_filled = hp / max_hp
|
self.hit_points_bar.percent_filled = hp / max_hp
|
||||||
|
|
||||||
def draw(self, console):
|
def draw(self, console: Console):
|
||||||
super().draw(console)
|
super().draw(console)
|
||||||
|
|
||||||
drawable_bounds = self.drawable_bounds
|
drawable_bounds = self.drawable_bounds
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
Declares the MessageLogWindow.
|
Declares the MessageLogWindow.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
from tcod.console import Console
|
||||||
|
|
||||||
from . import Window
|
from . import Window
|
||||||
from ...geometry import Rect
|
from ...geometry import Rect
|
||||||
from ...messages import MessageLog
|
from ...messages import MessageLog
|
||||||
|
@ -16,6 +18,6 @@ class MessageLogWindow(Window):
|
||||||
super().__init__(bounds, framed=True)
|
super().__init__(bounds, framed=True)
|
||||||
self.message_log = message_log
|
self.message_log = message_log
|
||||||
|
|
||||||
def draw(self, console):
|
def draw(self, console: Console):
|
||||||
super().draw(console)
|
super().draw(console)
|
||||||
self.message_log.render_to_console(console, self.drawable_bounds)
|
self.message_log.render_to_console(console, self.drawable_bounds)
|
||||||
|
|
|
@ -4,9 +4,11 @@
|
||||||
the dungeon.'''
|
the dungeon.'''
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Tuple
|
from typing import Optional, Tuple
|
||||||
|
|
||||||
# pylint: disable=too-many-instance-attributes
|
# pylint: disable=too-many-instance-attributes
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
class Species:
|
class Species:
|
||||||
'''A kind of monster.
|
'''A kind of monster.
|
||||||
|
@ -35,7 +37,8 @@ class Species:
|
||||||
attack_power: int
|
attack_power: int
|
||||||
defense: int
|
defense: int
|
||||||
foreground_color: Tuple[int, int, int]
|
foreground_color: Tuple[int, int, int]
|
||||||
background_color: Tuple[int, int, int] = None
|
background_color: Optional[Tuple[int, int, int]] = None
|
||||||
|
|
||||||
|
|
||||||
Orc = Species(name='Orc', symbol='o',
|
Orc = Species(name='Orc', symbol='o',
|
||||||
foreground_color=(63, 127, 63),
|
foreground_color=(63, 127, 63),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue