Methode check_in für Klasse Client angefangen

This commit is contained in:
adamercat 2021-02-02 10:29:40 +01:00
parent 43242e4d7e
commit 853fb3b50a
1 changed files with 15 additions and 5 deletions

View File

@ -46,17 +46,27 @@ class Client():
self.name = name
self.surname = surname
self.client_num = client_num
self.room = room
self.room = None
self.period = period
self.key_num = key_num
self.bookings = bookings
self.status = status
self.key_num = 0
self.bookings = 0
self.status = False
# Automatic status adjustment
if len(self.bookings) >= 4:
self.status = True
Client.clients += 1
def check_in(self, room, key_num):
room_list[reference.index(room)].occupy(surname, self.period)
num_ = "key_" + str(key_num) + ".hand_out_key(" + str(key_num) + "," + "'" + str(surname) + "')"
try:
exec(num_)
self.key_num = key_num
except:
("Schlüssel mit Daten nicht gefunden.")
def change_room(self, surname, new_room, key_num = 0): # Room add period
room_list[reference.index(self.room)].free()
room_list[reference.index(new_room)].occupy(surname, self.period)