summaryrefslogtreecommitdiff
path: root/tui
diff options
context:
space:
mode:
authorAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-25 15:52:28 +0200
committerAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-25 15:52:28 +0200
commit27057a601c43ab5a6dcaa5b396c6b3d891c921b9 (patch)
tree576348f7c7f25b6a6c7283be29a23aa08e6d1688 /tui
parent84ff4aa8fc7714b5841097e0dd800085982321e4 (diff)
Sorting out import situation and making enum names for tiles for readability.
Diffstat (limited to 'tui')
-rw-r--r--tui/__init__.py3
-rw-r--r--tui/static.py3
-rw-r--r--tui/tui.py4
3 files changed, 7 insertions, 3 deletions
diff --git a/tui/__init__.py b/tui/__init__.py
new file mode 100644
index 0000000..c1c5b91
--- /dev/null
+++ b/tui/__init__.py
@@ -0,0 +1,3 @@
+""" tui - hoitaa käyttäjälle katseltavaa ja havaitsee syötteet """
+from .tui import Tui
+from .static import Action
diff --git a/tui/static.py b/tui/static.py
index 391e3f1..267b061 100644
--- a/tui/static.py
+++ b/tui/static.py
@@ -1,6 +1,7 @@
""" tui/static.py - Staattiset määritykset tui:ssa tarvittaville jutuille. """
from enum import Enum
from dataclasses import dataclass
+from board import Tile
class Action(Enum):
""" tominnot, joita voidaan saada palautusrvona """
@@ -57,7 +58,7 @@ class TileType:
TileTypes = {
- 0: TileType( "[ ]", [(0x7,0), (0x7,0), (0x7,0)] ),
+ Tile.BLANK: TileType( "[ ]", [(0x7,0), (0x7,0), (0x7,0)] ),
1: TileType( "[1]", [(0xA,0), (0xA,0), (0xA,0)] ),
2: TileType( "[2]", [(0xB,0), (0xB,0), (0xB,0)] ),
3: TileType( "[3]", [(0xD,0), (0xD,0), (0xD,0)] ),
diff --git a/tui/tui.py b/tui/tui.py
index 65e482d..e925e57 100644
--- a/tui/tui.py
+++ b/tui/tui.py
@@ -2,8 +2,8 @@
# pylint: disable = multiple-imports
import termios, fcntl, sys, os
from time import sleep
-from tui.static import Action, ActionKeys, TileTypes
-from tui.ansi import Ansi
+from .static import Action, ActionKeys, TileTypes
+from .ansi import Ansi
class Tui():