From a9797d75992b15173139c260d4ef01e4d0f69d61 Mon Sep 17 00:00:00 2001 From: s444417 Date: Wed, 6 May 2020 22:03:23 +0200 Subject: [PATCH] =?UTF-8?q?Drobne=20poprawki=20i=20porz=C4=85dki.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kelner/src/components/Drawable.py | 5 ----- kelner/src/components/Waiter.py | 2 +- kelner/src/managers/DrawableCollection.py | 4 ++-- kelner/src/managers/ImageCache.py | 2 +- kelner/src/managers/MenuManager.py | 2 +- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/kelner/src/components/Drawable.py b/kelner/src/components/Drawable.py index 02d91d7..694a226 100644 --- a/kelner/src/components/Drawable.py +++ b/kelner/src/components/Drawable.py @@ -1,10 +1,5 @@ class Drawable: - GREY = (128, 128, 128) - YELLOW = (255, 255, 0) - RED = (255, 0, 0) - GREEN = (0, 255, 0) - def __init__(self, x, y, minX, maxX, minY, maxY, cellSize, offset): self.__minX = minX self.__maxX = maxX diff --git a/kelner/src/components/Waiter.py b/kelner/src/components/Waiter.py index 445e69a..a9e3e4d 100644 --- a/kelner/src/components/Waiter.py +++ b/kelner/src/components/Waiter.py @@ -117,7 +117,7 @@ class Waiter(Drawable): def draw(self, screen): direction = self.getDirection() imageKind = None - if direction == Direction.LeftUp: + if direction == Direction.LeftUp: imageKind = Images.WaiterLeftUp elif direction == Direction.Up: imageKind = Images.WaiterUp diff --git a/kelner/src/managers/DrawableCollection.py b/kelner/src/managers/DrawableCollection.py index 05d5216..a4f3fed 100644 --- a/kelner/src/managers/DrawableCollection.py +++ b/kelner/src/managers/DrawableCollection.py @@ -1,7 +1,7 @@ import random from threading import Lock -from kelner.src.components.Table import Table, Status +from kelner.src.components.Table import Table from kelner.src.components.Waiter import Waiter @@ -71,7 +71,7 @@ class DrawableCollection: def getReservedPlaces(self, waiter): cols = waiter.getMaxX() - waiter.getMinX() + 1 rows = waiter.getMaxY() - waiter.getMinY() + 1 - reservedPlaces = [[0] * cols for i in range(rows)] + reservedPlaces = [[0] * cols for _ in range(rows)] tables = self.getTables(None) if tables: for table in tables: diff --git a/kelner/src/managers/ImageCache.py b/kelner/src/managers/ImageCache.py index dc1815f..f1ad355 100644 --- a/kelner/src/managers/ImageCache.py +++ b/kelner/src/managers/ImageCache.py @@ -60,7 +60,7 @@ class ImageCache: def __getFont(self): if self.__font is None: - self.__font = font = pygame.font.SysFont('comicsansms', 24, True) + self.__font = pygame.font.SysFont('comicsansms', 24, True) return self.__font def getImage(self, imageKind, width, height): diff --git a/kelner/src/managers/MenuManager.py b/kelner/src/managers/MenuManager.py index 47b34d5..57e7eda 100644 --- a/kelner/src/managers/MenuManager.py +++ b/kelner/src/managers/MenuManager.py @@ -30,6 +30,6 @@ class MenuManager: def generateOrder(self): count = random.randint(self.__MinDishes, self.__MaxDishes) order = [] - for i in range(0, count): + for _ in range(0, count): order += [(self.__menuCard[random.randint(0, len(self.__menuCard) - 1)])] return order