aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcinzelent <marcin@zelent.net>2021-02-21 14:13:49 +0100
committermarcinzelent <marcin@zelent.net>2019-12-20 14:21:37 +0100
commitb1eb36d3fbc5012b07489454a7452e8488507f6a (patch)
treef6a9e6e561eabde5b06366a6aeac78df123ca917 /Views/OrderPizzaStep3View.cs
Initial commitHEADmaster
Diffstat (limited to 'Views/OrderPizzaStep3View.cs')
-rw-r--r--Views/OrderPizzaStep3View.cs58
1 files changed, 58 insertions, 0 deletions
diff --git a/Views/OrderPizzaStep3View.cs b/Views/OrderPizzaStep3View.cs
new file mode 100644
index 0000000..6fbfebc
--- /dev/null
+++ b/Views/OrderPizzaStep3View.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using KukaPizza.Controllers;
+using KukaPizza.Models;
+
+namespace KukaPizza.Views
+{
+ public class OrderPizzaStep3View : View
+ {
+ private OrderPizzaController _controller;
+
+ public OrderPizzaStep3View(OrderPizzaController controller)
+ {
+ _controller = controller;
+ Init(_controller);
+ }
+
+ protected override void Draw()
+ {
+ Console.Clear();
+ Console.Write(
+@"================================================================================
+ Step 3. Choose pizza size
+================================================================================
+
+ 1. Small
+ 2. Medium
+ 3. Large
+
+");
+ Console.WriteLine($" 0. Go back");
+ Console.Write($"\nChoose number [0-3]: ");
+ }
+
+ protected override void Interact()
+ {
+ string choice = "";
+
+ do
+ {
+ Console.CursorVisible = true;
+ choice = Console.ReadLine();
+ Console.CursorVisible = false;
+
+ if (choice == "") choice = "-1";
+
+ int choiceInt = Int32.Parse(choice);
+ if (choiceInt > 0 && choiceInt < 4)
+ {
+ _controller.ChooseSize(choiceInt);
+ NavigateTo(typeof(OrderPizzaStep4View));
+ }
+
+ Draw();
+ } while (choice != "0");
+ }
+ }
+} \ No newline at end of file