summaryrefslogtreecommitdiff
path: root/tui
diff options
context:
space:
mode:
authorAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-13 19:56:09 +0200
committerAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-13 19:56:09 +0200
commit30ee34f106c5052cf0a60361d3220427b5753557 (patch)
treec0f7053390f86f08b904f2dde4c57bd69c698b6e /tui
parent227870a64f1eacbc13950256a05a2fab5c8c2a25 (diff)
Fixing some types and linting tui/static.py and app.py.
Diffstat (limited to 'tui')
-rw-r--r--tui/static.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/tui/static.py b/tui/static.py
index c769e0f..cb934f0 100644
--- a/tui/static.py
+++ b/tui/static.py
@@ -1,7 +1,9 @@
-from enum import Enum
+""" tui/static.py - Staattiset määritykset tui:ssa tarvittaville jutuille. """
+from enum import Enum, IntEnum
from dataclasses import dataclass
class Action(Enum):
+ """ tominnot, joita voidaan saada palautusrvona """
QUIT = 0 # Pelin lopetus
OPEN = 1 # Ruudun avaaminen
FLAG = 2 # Ruudun liputus
@@ -26,8 +28,9 @@ ActionEscKeys = {
@dataclass
class TileType:
+ """ ruututyyppien tallennusmuotojen kuvaus"""
text: str # Teksti
- colors: [] # Lista (väri, tausta) pareja tekstille
+ colors: [] # Lista (väri, tausta) pareja tekstin kaunistamiseen
TileTypes = {
@@ -40,13 +43,14 @@ TileTypes = {
6: TileType( "[6]", [(0x9,0), (0x9,0), (0x9,0)] ),
7: TileType( "[7]", [(0x9,0), (0x9,0), (0x9,0)] ),
8: TileType( "[8]", [(0x9,0), (0x9,0), (0x9,0)] ),
- 9: TileType( "[¤]", [(0xF,1), (0xF,1), (0xF,1)] ),
+ 9: TileType( "[@]", [(0xF,1), (0xF,1), (0xF,1)] ),
10: TileType( "[#]", [(0x8,7), (0x8,7), (0x8,7)] ),
11: TileType( "[B]", [(0x8,7), (0x1,7), (0x8,7)] ),
12: TileType( "[?]", [(0x8,7), (0x3,7), (0x8,7)] )
}
-class Colors:
+class Colors(IntEnum):
+ """ ANSI värejä vastaavat lukuarvot """
BLACK = 0
RED = 1
GREEN = 2
@@ -62,4 +66,4 @@ class Colors:
BRIGHT_BLUE = 0xC
BRIGHT_MAGENTA = 0xD
BRIGHT_CYAN = 0xE
- BRIGHT_WHITE = 0xF \ No newline at end of file
+ BRIGHT_WHITE = 0xF