diff options
Diffstat (limited to 'Views/MainView.cs')
-rw-r--r-- | Views/MainView.cs | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/Views/MainView.cs b/Views/MainView.cs new file mode 100644 index 0000000..42f7c91 --- /dev/null +++ b/Views/MainView.cs @@ -0,0 +1,68 @@ +using System; +using KukaPizza.Controllers; + +namespace KukaPizza.Views +{ + public class MainView : View + { + private MainController _controller; + public MainView(MainController controller) + { + _controller = controller; + Init(_controller); + + } + protected override void Draw() + { + Console.Write(@" + + + + __ __ __ ____ +/\ \/\ \ /\ \ /\ _`\ __ +\ \ \/'/' __ __\ \ \/'\ __ \ \ \L\ \/\_\ ____ ____ __ + \ \ , < /\ \/\ \\ \ , < /'__`\ \ \ ,__/\/\ \/\_ ,`\ /\_ ,`\ /'__`\ + \ \ \\`\\ \ \_\ \\ \ \\`\ /\ \L\.\_ \ \ \/ \ \ \/_/ /_\/_/ /_/\ \L\.\_ + \ \_\ \_\ \____/ \ \_\ \_\ \__/.\_\ \ \_\ \ \_\/\____\ /\____\ \__/.\_\ + \/_/\/_/\/___/ \/_/\/_/\/__/\/_/ \/_/ \/_/\/____/ \/____/\/__/\/_/ + + + + + 1. Order a pizza + 2. Check orders + + 0. Exit + + + +================================================================================ + Copyright © 2019 Marcin Zelent & Paulius Klezys +================================================================================"); + } + + protected override void Interact() + { + int choice = 0; + + do + { + choice = Console.ReadKey(true).KeyChar; + + switch (choice) + { + case '1': + _controller.OpenOrderPizza(); + break; + case '2': + _controller.OpenCheckOrders(); + break; + } + + Draw(); + } while (choice != '0'); + + if (choice == '0') _controller.Close(); + } + } +}
\ No newline at end of file |