automatyczny_kelner/src/obj/Table.py

15 lines
578 B
Python
Raw Normal View History

from src.obj.Object import Object
class Table(Object):
2023-05-14 14:23:37 +02:00
def __init__(self, position, orientation, square_size, screen_size, current_role=0):
super().__init__("table", position, orientation, square_size, screen_size)
self.roles = ["table", "order", "wait", "done"]
self.current_role = current_role
self.change_role(self.roles[self.current_role])
def next_role(self, waiter):
if waiter.agent_role == "waiter":
self.current_role = (self.current_role + 1) % 4
self.change_role(self.roles[self.current_role])