From f4049ca3bbd79c2c6568e519cde92836cc79769a Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sat, 13 Nov 2021 12:05:18 +0100 Subject: Add optional coordinates to a piece Signed-off-by: Olivier Gayot --- cameltris/piece.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cameltris/piece.py') diff --git a/cameltris/piece.py b/cameltris/piece.py index d8e7b63..3636fbd 100644 --- a/cameltris/piece.py +++ b/cameltris/piece.py @@ -1,8 +1,11 @@ """ Module that defines all types of pieces """ +from typing import Optional + import pygame from .color import Color +from .coordinates import Coordinates square_template = pygame.Surface((48, 48)) @@ -12,6 +15,7 @@ class Piece: """ A piece class that provides default methods for performing rotations """ def __init__(self): """ Initialize a piece """ + self.coord: Optional[Coordinates] = None self.square = square_template.copy() def rotate_clockwise(self): -- cgit v1.2.3