Poprawki i porządki. #13
@ -1,10 +1,5 @@
|
|||||||
class Drawable:
|
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):
|
def __init__(self, x, y, minX, maxX, minY, maxY, cellSize, offset):
|
||||||
self.__minX = minX
|
self.__minX = minX
|
||||||
self.__maxX = maxX
|
self.__maxX = maxX
|
||||||
|
@ -117,7 +117,7 @@ class Waiter(Drawable):
|
|||||||
def draw(self, screen):
|
def draw(self, screen):
|
||||||
direction = self.getDirection()
|
direction = self.getDirection()
|
||||||
imageKind = None
|
imageKind = None
|
||||||
if direction == Direction.LeftUp:
|
if direction == Direction.LeftUp:
|
||||||
imageKind = Images.WaiterLeftUp
|
imageKind = Images.WaiterLeftUp
|
||||||
elif direction == Direction.Up:
|
elif direction == Direction.Up:
|
||||||
imageKind = Images.WaiterUp
|
imageKind = Images.WaiterUp
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import random
|
import random
|
||||||
from threading import Lock
|
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
|
from kelner.src.components.Waiter import Waiter
|
||||||
|
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ class DrawableCollection:
|
|||||||
def getReservedPlaces(self, waiter):
|
def getReservedPlaces(self, waiter):
|
||||||
cols = waiter.getMaxX() - waiter.getMinX() + 1
|
cols = waiter.getMaxX() - waiter.getMinX() + 1
|
||||||
rows = waiter.getMaxY() - waiter.getMinY() + 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)
|
tables = self.getTables(None)
|
||||||
if tables:
|
if tables:
|
||||||
for table in tables:
|
for table in tables:
|
||||||
|
@ -60,7 +60,7 @@ class ImageCache:
|
|||||||
|
|
||||||
def __getFont(self):
|
def __getFont(self):
|
||||||
if self.__font is None:
|
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
|
return self.__font
|
||||||
|
|
||||||
def getImage(self, imageKind, width, height):
|
def getImage(self, imageKind, width, height):
|
||||||
|
@ -30,6 +30,6 @@ class MenuManager:
|
|||||||
def generateOrder(self):
|
def generateOrder(self):
|
||||||
count = random.randint(self.__MinDishes, self.__MaxDishes)
|
count = random.randint(self.__MinDishes, self.__MaxDishes)
|
||||||
order = []
|
order = []
|
||||||
for i in range(0, count):
|
for _ in range(0, count):
|
||||||
order += [(self.__menuCard[random.randint(0, len(self.__menuCard) - 1)])]
|
order += [(self.__menuCard[random.randint(0, len(self.__menuCard) - 1)])]
|
||||||
return order
|
return order
|
||||||
|
Loading…
Reference in New Issue
Block a user