style(game): rename FigureConfig to FigureParams

fix
This commit is contained in:
Kristofers Solo
2024-01-15 06:54:21 +02:00
parent 5200a1458e
commit 75d873d1eb
2 changed files with 9 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
from .config import CONFIG from .config import CONFIG
from .enum import Direction, GameMode, Rotation from .enum import Direction, GameMode, Rotation
from .figure import Figure, FigureConfig from .figure import Figure
from .path import BASE_PATH from .path import BASE_PATH
from .settings import read_settings, save_settings from .settings import read_settings, save_settings
from .tuples import Size from .tuples import Size
@@ -10,7 +10,6 @@ __all__ = [
"CONFIG", "CONFIG",
"Size", "Size",
"Figure", "Figure",
"FigureConfig",
"Direction", "Direction",
"Rotation", "Rotation",
"GameMode", "GameMode",

View File

@@ -9,13 +9,12 @@ from .config import CONFIG
from .path import BASE_PATH from .path import BASE_PATH
class FigureConfig(NamedTuple): class FigureParams(NamedTuple):
""" """
Attributes: Attributes:
shape: The shape of the figure. shape: The shape of the figure.
color: The color of the figure. color: The color of the figure.
filename: The filename of the image of the figure. filename: The filename of the image of the figure.
image: The image of the figure.
""" """
shape: list[Vec2] shape: list[Vec2]
@@ -42,7 +41,7 @@ class Figure(Enum):
L: The L figure. L: The L figure.
""" """
I = FigureConfig( I = FigureParams(
[ [
Vec2(0, 0), Vec2(0, 0),
Vec2(0, -1), Vec2(0, -1),
@@ -52,7 +51,7 @@ class Figure(Enum):
CONFIG.colors.cyan, CONFIG.colors.cyan,
"I.png", "I.png",
) )
O = FigureConfig( O = FigureParams(
[ [
Vec2(0, 0), Vec2(0, 0),
Vec2(0, -1), Vec2(0, -1),
@@ -62,7 +61,7 @@ class Figure(Enum):
CONFIG.colors.yellow, CONFIG.colors.yellow,
"O.png", "O.png",
) )
T = FigureConfig( T = FigureParams(
[ [
Vec2(0, 0), Vec2(0, 0),
Vec2(-1, 0), Vec2(-1, 0),
@@ -73,7 +72,7 @@ class Figure(Enum):
"T.png", "T.png",
) )
S = FigureConfig( S = FigureParams(
[ [
Vec2(0, 0), Vec2(0, 0),
Vec2(-1, 0), Vec2(-1, 0),
@@ -83,7 +82,7 @@ class Figure(Enum):
CONFIG.colors.green, CONFIG.colors.green,
"S.png", "S.png",
) )
Z = FigureConfig( Z = FigureParams(
[ [
Vec2(0, 0), Vec2(0, 0),
Vec2(1, 0), Vec2(1, 0),
@@ -93,7 +92,7 @@ class Figure(Enum):
CONFIG.colors.red, CONFIG.colors.red,
"Z.png", "Z.png",
) )
J = FigureConfig( J = FigureParams(
[ [
Vec2(0, 0), Vec2(0, 0),
Vec2(0, -1), Vec2(0, -1),
@@ -103,7 +102,7 @@ class Figure(Enum):
CONFIG.colors.blue, CONFIG.colors.blue,
"J.png", "J.png",
) )
L = FigureConfig( L = FigureParams(
[ [
Vec2(0, 0), Vec2(0, 0),
Vec2(0, -1), Vec2(0, -1),