From 38f40f44b0de18eaa35b664da7e5a8dd2beaddcb Mon Sep 17 00:00:00 2001 From: Sara Kowalska Date: Sun, 5 Apr 2020 18:50:57 +0200 Subject: [PATCH] =?UTF-8?q?Brakuj=C4=85ce=20atrybuty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Restaurant/main.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Restaurant/main.py b/Restaurant/main.py index 9fdf223..36b62bb 100644 --- a/Restaurant/main.py +++ b/Restaurant/main.py @@ -7,10 +7,11 @@ pygame.init() class Dish(object): - def __init__(self, dishName, prepTime, eatTime): + def __init__(self, dishName, prepTime, eatTime, price): self.dishName = dishName self.preparationTime = prepTime self.eatingTime = eatTime + self.price = price class Plate(object): @@ -43,15 +44,20 @@ class Client(object): self.sex = sex self.myPlate = None self.budget = budget + self.myTable = 0 #domyślnie klient nie siedzi przy żadnym stole def takePlateAndEat(self, plate): self.myPlate = plate plate.eat() + def takeASeat(self, table): + self.myTable = table class Table(object): - def __init__(self, pos): + def __init__(self, pos, capacity): self.pos = pos + self.capacity = capacity + self.clients = [] #lista gości przy danym stole def move(self, newx, newy): #metoda do ustawiania stołów poprzez podanie nowych współrzędnych self.pos[0] = newx