This commit is contained in:
adrienmalin 2018-11-30 19:54:06 +01:00
parent aa52e08521
commit b8e4d2471a

View File

@ -191,10 +191,13 @@ class TetroT(Tetromino, metaclass=MetaTetro):
""" """
COORDS = (0, 0), (L, 0), (0, U), (R, 0) COORDS = (0, 0), (L, 0), (0, U), (R, 0)
T_SLOT_A = ((L, U), (R, U), (R, D), (L, D))
T_SLOT_B = ((R, U), (R, D), (L, D), (L, U)) T_SLOT = (
T_SLOT_C = ((L, D), (L, U), (R, U), (R, D)) ((L, U), (R, U), (L, D), (R, D)),
T_SLOT_D = ((R, D), (L, D), (L, U), (R, U)) ((R, U), (R, D), (L, U), (L, D)),
((R, D), (L, D), (R, U), (L, U)),
((L, D), (L, U), (R, D), (R, U)),
)
def __init__(self): def __init__(self):
super().__init__() super().__init__()
@ -211,10 +214,10 @@ class TetroT(Tetromino, metaclass=MetaTetro):
rotated = super().rotate(direction) rotated = super().rotate(direction)
if rotated: if rotated:
center = self.minoes[0].coord center = self.minoes[0].coord
pa = center + Point(*self.T_SLOT_A[self.orientation]) pa = center + Point(*self.T_SLOT[self.orientation][0])
pb = center + Point(*self.T_SLOT_B[self.orientation]) pb = center + Point(*self.T_SLOT[self.orientation][1])
pc = center + Point(*self.T_SLOT_C[self.orientation]) pc = center + Point(*self.T_SLOT[self.orientation][2])
pd = center + Point(*self.T_SLOT_D[self.orientation]) pd = center + Point(*self.T_SLOT[self.orientation][3])
a = not self.matrix.is_empty_cell(pa) a = not self.matrix.is_empty_cell(pa)
b = not self.matrix.is_empty_cell(pb) b = not self.matrix.is_empty_cell(pb)