-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathmain.py
More file actions
26 lines (18 loc) · 760 Bytes
/
Copy pathmain.py
File metadata and controls
26 lines (18 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from commands import CreateCocktailCommand
from commands import CreateSoupCommand
from cookery import CookPool
from Waiter import Waiter
def main() -> None:
waiter = Waiter()
waiter.set_command(CreateSoupCommand(CookPool.get_cook(), "Borsh"))
waiter.set_command(CreateCocktailCommand(CookPool.get_bartender(), "Mojito"))
waiter.set_command(CreateSoupCommand(CookPool.get_cook(), "Solyanka"))
# Гость передумал: последний заказ снимаем до того, как что-то приготовлено.
cancelled = waiter.cancel_last()
print("cancelled:", cancelled)
print()
waiter.execute_commands()
print()
print("bill:", waiter.get_bill())
if __name__ == "__main__":
main()