From 81a86d7657ba6fba4b24f74beb7c4436a13a6211 Mon Sep 17 00:00:00 2001 From: Sara Kowalska Date: Sun, 5 Apr 2020 14:04:55 +0200 Subject: [PATCH] Dodanie klas dania i talerza --- Restaurant/main.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Restaurant/main.py b/Restaurant/main.py index bc6df88..518d7c3 100644 --- a/Restaurant/main.py +++ b/Restaurant/main.py @@ -4,11 +4,25 @@ import time pygame.init() +class Dish(object): + def __init__(self, dishName, prepTime): + self.dishName = dishName + self.preparationTime = prepTime + +class Plate(object): + def __init__(self, dish): + self.dishName = dish.dishName + self.isEmpty = False + self.preparationTime = dish.preparationTime + + def eat(self): + self.isEmpty = True #zjadanie dania jest oznaczeniem talerza jako pusty (metoda będzie wywoływana przez klienta) + class Table(object): def __init__(self, pos): self.pos = pos - def move(self, newx, newy): + def move(self, newx, newy): #metoda do ustawiania stołów poprzez podanie nowych współrzędnych self.pos[0] = newx self.pos[1] = newy