From 75d873d1eb4532d6410a6b7deeab293b6e4ff56b Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Mon, 15 Jan 2024 06:54:21 +0200 Subject: [PATCH] style(game): rename `FigureConfig` to `FigureParams` fix --- src/utils/__init__.py | 3 +-- src/utils/figure.py | 17 ++++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/utils/__init__.py b/src/utils/__init__.py index 1c42e46..c6dec43 100644 --- a/src/utils/__init__.py +++ b/src/utils/__init__.py @@ -1,6 +1,6 @@ from .config import CONFIG from .enum import Direction, GameMode, Rotation -from .figure import Figure, FigureConfig +from .figure import Figure from .path import BASE_PATH from .settings import read_settings, save_settings from .tuples import Size @@ -10,7 +10,6 @@ __all__ = [ "CONFIG", "Size", "Figure", - "FigureConfig", "Direction", "Rotation", "GameMode", diff --git a/src/utils/figure.py b/src/utils/figure.py index f0c7754..66b7ad1 100644 --- a/src/utils/figure.py +++ b/src/utils/figure.py @@ -9,13 +9,12 @@ from .config import CONFIG from .path import BASE_PATH -class FigureConfig(NamedTuple): +class FigureParams(NamedTuple): """ Attributes: shape: The shape of the figure. color: The color of the figure. filename: The filename of the image of the figure. - image: The image of the figure. """ shape: list[Vec2] @@ -42,7 +41,7 @@ class Figure(Enum): L: The L figure. """ - I = FigureConfig( + I = FigureParams( [ Vec2(0, 0), Vec2(0, -1), @@ -52,7 +51,7 @@ class Figure(Enum): CONFIG.colors.cyan, "I.png", ) - O = FigureConfig( + O = FigureParams( [ Vec2(0, 0), Vec2(0, -1), @@ -62,7 +61,7 @@ class Figure(Enum): CONFIG.colors.yellow, "O.png", ) - T = FigureConfig( + T = FigureParams( [ Vec2(0, 0), Vec2(-1, 0), @@ -73,7 +72,7 @@ class Figure(Enum): "T.png", ) - S = FigureConfig( + S = FigureParams( [ Vec2(0, 0), Vec2(-1, 0), @@ -83,7 +82,7 @@ class Figure(Enum): CONFIG.colors.green, "S.png", ) - Z = FigureConfig( + Z = FigureParams( [ Vec2(0, 0), Vec2(1, 0), @@ -93,7 +92,7 @@ class Figure(Enum): CONFIG.colors.red, "Z.png", ) - J = FigureConfig( + J = FigureParams( [ Vec2(0, 0), Vec2(0, -1), @@ -103,7 +102,7 @@ class Figure(Enum): CONFIG.colors.blue, "J.png", ) - L = FigureConfig( + L = FigureParams( [ Vec2(0, 0), Vec2(0, -1),