From 27057a601c43ab5a6dcaa5b396c6b3d891c921b9 Mon Sep 17 00:00:00 2001 From: Aineopintojen-harjoitustyo-Algoritmit-j Date: Thu, 25 Jan 2024 15:52:28 +0200 Subject: Sorting out import situation and making enum names for tiles for readability. --- tui/__init__.py | 3 +++ tui/static.py | 3 ++- tui/tui.py | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 tui/__init__.py (limited to 'tui') 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(): -- cgit v1.2.3