From 4df942db913383d2b2c829f8b89c306a1f75cd9d Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Fri, 12 Nov 2021 13:56:06 +0100 Subject: Add some documentation to the cameltris.piece module Signed-off-by: Olivier Gayot --- cameltris/piece.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cameltris') diff --git a/cameltris/piece.py b/cameltris/piece.py index 2f3e7ce..1bbe2c4 100644 --- a/cameltris/piece.py +++ b/cameltris/piece.py @@ -1,3 +1,5 @@ +""" Module that defines all types of pieces """ + import pygame @@ -15,13 +17,17 @@ cyan = (30, 164, 150) class Piece: + """ A piece class that provides default methods for performing rotations """ def __init__(self): + """ Initialize a piece """ self.square = square_template.copy() def rotate_clockwise(self): + """ Rotate the piece clockwise """ self.elements = list(zip(*self.elements[::-1])) def rotate_counter_clockwise(self): + """ Rotate the piece counter-clockwise """ self.rotate_clockwise() self.rotate_clockwise() self.rotate_clockwise() -- cgit v1.2.3