From 7a7d189fb253a7b8f60d2d55bcdbece9a20d6f23 Mon Sep 17 00:00:00 2001 From: Brandon Rodriguez <brodriguez8774@mail.kvcc.edu> Date: Thu, 15 Oct 2015 17:12:38 -0400 Subject: [PATCH] Expand on most of UI and User Selection. Moves user selection to proper class. Was previously in the collection class which didn't make sense. Most menus should now display properly. Most user selection should properly save values, although there's little to no error handling yet. --- cis237assignment3/DroidCollection.cs | 207 +----------- cis237assignment3/Droid_Generic.cs | 35 +- cis237assignment3/Droid_Protocol.cs | 10 +- cis237assignment3/Droid_Utility.cs | 4 +- cis237assignment3/RunProgram.cs | 460 ++++++++++++++++++++++++++- cis237assignment3/UserInterface.cs | 157 ++++++++- 6 files changed, 636 insertions(+), 237 deletions(-) diff --git a/cis237assignment3/DroidCollection.cs b/cis237assignment3/DroidCollection.cs index 2a738d6..39dcab7 100644 --- a/cis237assignment3/DroidCollection.cs +++ b/cis237assignment3/DroidCollection.cs @@ -8,24 +8,11 @@ using System.Threading.Tasks; namespace cis237assignment3 { - static class DroidCollection + class DroidCollection { #region Variables - // Variables for getting/saving user input. - private string userInput; - - private string selectedMaterialString; - protected string selectedModelString; - private string selectedColorString; - private int selectedLanguageInt; - private bool ToolBoxBool; - private bool computerConnectionBool; - private bool armBool; - private bool trashCompactorBool; - private bool vacuumBool; - private bool fireExtinguisherBool; - private int selectedNumberOfShipsInt; + #endregion @@ -42,10 +29,11 @@ namespace cis237assignment3 } - public DroidCollection(int userSelection) + public DroidCollection(IDroid aDroid) { } + #endregion @@ -61,192 +49,7 @@ namespace cis237assignment3 #region Private Methods - private void TypeSelection() - { - UserInterface.DisplayTypeSelectionMenu(); - userInput = UserInterface.GetUserInput(); - - switch (userInput) - { - case "1": - PurchaseProtocol(); - break; - case "2": - PurchaseUtility(); - break; - case "3": - PurchaseJanitor(); - break; - case "4": - PurchaseAstromech(); - break; - case "esc": - break; - default: - break; - } - } - - private void PurchaseGeneric() - { - ModelSelection(); - MaterialSelection(); - ColorSelection(); - - } - - private void PurchaseProtocol() - { - PurchaseGeneric(); - LanguageSelection(); - - } - - private void PurchaseUtility() - { - PurchaseGeneric(); - ToolBoxSelection(); - CompConnectionSelection(); - ArmSelection(); - } - - private void PurchaseJanitor() - { - PurchaseUtility(); - - } - - private void PurchaseAstromech() - { - PurchaseUtility(); - - } - - #region Individual Feature Selections - - private void ModelSelection() - { - UserInterface.DisplayModelSelectionMenu(Droid_Generic.MODEL_1_STRING, Droid_Generic.MODEL_2_STRING); - userInput = UserInterface.GetUserInput(); - - switch (userInput) - { - case "1": - selectedModelString = Droid_Generic.MODEL_1_STRING; - break; - case "2": - selectedModelString = Droid_Generic.MODEL_2_STRING; - break; - case "3": - break; - case "4": - break; - case "esc": - break; - default: - break; - } - } - - private void MaterialSelection() - { - UserInterface.DisplayMaterialSelectionMenu(Droid_Generic.MATERIAL_1_STRING, Droid_Generic.MATERIAL_2_STRING, Droid_Generic.MATERIAL_3_STRING, Droid_Generic.MATERIAL_4_STRING, Droid_Generic.MATERIAL_5_STRING); - userInput = UserInterface.GetUserInput(); - - switch (userInput) - { - case "1": - selectedMaterialString = Droid_Generic.MATERIAL_1_STRING; - break; - case "2": - selectedMaterialString = Droid_Generic.MATERIAL_2_STRING; - break; - case "3": - selectedMaterialString = Droid_Generic.MATERIAL_3_STRING; - break; - case "4": - selectedMaterialString = Droid_Generic.MATERIAL_4_STRING; - break; - case "5": - selectedMaterialString = Droid_Generic.MATERIAL_5_STRING; - break; - case "esc": - break; - default: - break; - } - } - - private void ColorSelection() - { - UserInterface.DisplayColorSelectionMenu(Droid_Generic.COLOR_1_STRING, Droid_Generic.COLOR_2_STRING, Droid_Generic.COLOR_3_STRING, Droid_Generic.COLOR_4_STRING, Droid_Generic.COLOR_5_STRING); - userInput = UserInterface.GetUserInput(); - - switch (userInput) - { - case "1": - selectedColorString = Droid_Generic.COLOR_1_STRING; - break; - case "2": - selectedColorString = Droid_Generic.COLOR_2_STRING; - break; - case "3": - selectedColorString = Droid_Generic.COLOR_3_STRING; - break; - case "4": - selectedColorString = Droid_Generic.COLOR_4_STRING; - break; - case "5": - selectedColorString = Droid_Generic.COLOR_5_STRING; - break; - case "esc": - break; - default: - break; - } - } - - private void LanguageSelection() - { - - } - - private void ToolBoxSelection() - { - - } - - private void CompConnectionSelection() - { - - } - - private void ArmSelection() - { - - } - - private void TrashCompactorSelection() - { - - } - - private void VacuumSelection() - { - - } - - private void FireExtinguisherSelection() - { - - } - - private void NumberOfShipsSelection() - { - - } - - #endregion + #endregion diff --git a/cis237assignment3/Droid_Generic.cs b/cis237assignment3/Droid_Generic.cs index 246091c..c971ed0 100644 --- a/cis237assignment3/Droid_Generic.cs +++ b/cis237assignment3/Droid_Generic.cs @@ -18,11 +18,11 @@ namespace cis237assignment3 // All the necessary variables for material selection. private string selectedMaterialString; private decimal selectedMaterialDecimal; - public static const string MATERIAL_1_STRING = "Tin"; - public static const string MATERIAL_2_STRING = "Steel"; - public static const string MATERIAL_3_STRING = "Titanium"; - public static const string MATERIAL_4_STRING = "Mythril"; - public static const string MATERIAL_5_STRING = "Unobtanium"; + public static string MATERIAL_1_STRING = "Tin"; + public static string MATERIAL_2_STRING = "Steel"; + public static string MATERIAL_3_STRING = "Titanium"; + public static string MATERIAL_4_STRING = "Mythril"; + public static string MATERIAL_5_STRING = "Unobtanium"; private decimal material1Decimal; private decimal material2Decimal; private decimal material3Decimal; @@ -32,19 +32,19 @@ namespace cis237assignment3 // All the necessary variables for model selection. protected string selectedModelString; protected decimal selectedModelDecimal; - public static const string MODEL_1_STRING = "TI-84"; - public static const string MODEL_2_STRING = "TI-84"; + public static string MODEL_1_STRING = "TI-84"; + public static string MODEL_2_STRING = "TI-84"; private decimal model1Decimal; private decimal model2Decimal; // All the necessary variables for color selection. private string selectedColorString; private decimal selectedColorDecimal; - public static const string COLOR_1_STRING = "White"; - public static const string COLOR_2_STRING = "Black"; - public static const string COLOR_3_STRING = "Blue"; - public static const string COLOR_4_STRING = "Red"; - public static const string COLOR_5_STRING = "Green"; + public static string COLOR_1_STRING = "White"; + public static string COLOR_2_STRING = "Black"; + public static string COLOR_3_STRING = "Blue"; + public static string COLOR_4_STRING = "Red"; + public static string COLOR_5_STRING = "Green"; private decimal color1Decimal; private decimal color2Decimal; private decimal color3Decimal; @@ -97,7 +97,7 @@ namespace cis237assignment3 #region Private Methods - + /* EXTRA FUNCTIONALITY. WORK ON LAST. /// <summary> /// Sets a clearance int for the program. This is the permanent discount for all items on clearance. /// </summary> @@ -257,6 +257,8 @@ namespace cis237assignment3 color5Decimal = baseColorCost + AddCents(); } } + * + * */ #endregion @@ -282,7 +284,12 @@ namespace cis237assignment3 public override void CalculateTotalCost() { - throw new NotImplementedException(); + totalCostDecimal = selectedModelDecimal + selectedMaterialDecimal + selectedColorDecimal; + } + + public override string DisplayShortToString() + { + return "aaa"; } #endregion diff --git a/cis237assignment3/Droid_Protocol.cs b/cis237assignment3/Droid_Protocol.cs index 7a70b6b..4e5d587 100644 --- a/cis237assignment3/Droid_Protocol.cs +++ b/cis237assignment3/Droid_Protocol.cs @@ -12,7 +12,7 @@ namespace cis237assignment3 /// Class for Droids of type Protocol. /// Inherits only from Droid. /// </summary> - class Droid_Protocol : Droid + class Droid_Protocol : Droid_Generic { #region Variables @@ -20,6 +20,12 @@ namespace cis237assignment3 protected const decimal COST_PER_LANGUAGE = 1; // Temp cost placeholder. protected decimal totalLanguageDecimal; + // Language selection constants + public const int LANGUAGE_SELECTION_1 = 1; + public const int LANGUAGE_SELECTION_2 = 3; + public const int LANGUAGE_SELECTION_3 = 7; + public const int LANGUAGE_SELECTION_4 = 15; + #endregion @@ -87,7 +93,7 @@ namespace cis237assignment3 public override void CalculateTotalCost() { - throw new NotImplementedException(); + base.CalculateTotalCost(); //+ totalLanguageDecimal; } /// <summary> diff --git a/cis237assignment3/Droid_Utility.cs b/cis237assignment3/Droid_Utility.cs index c8cb962..9ad038b 100644 --- a/cis237assignment3/Droid_Utility.cs +++ b/cis237assignment3/Droid_Utility.cs @@ -12,7 +12,7 @@ namespace cis237assignment3 /// Class for Droids of type Utility. /// Inherits only from Droid. /// </summary> - class Droid_Utility : Droid + class Droid_Utility : Droid_Generic { #region Variables @@ -110,7 +110,7 @@ namespace cis237assignment3 public override void CalculateTotalCost() { - throw new NotImplementedException(); + base.CalculateTotalCost(); } /// <summary> diff --git a/cis237assignment3/RunProgram.cs b/cis237assignment3/RunProgram.cs index 0f83ecd..c5dbdcf 100644 --- a/cis237assignment3/RunProgram.cs +++ b/cis237assignment3/RunProgram.cs @@ -16,17 +16,36 @@ namespace cis237assignment3 #region Variables private bool runProgram; - private string inputString; + private bool menusBool; // Used to exit back to main menu if user decides to. True to stay in menus. False if user typed to exit. + // Variables for getting/saving user input. + private string userInputString; + + private string selectedMaterialString; + private string selectedModelString; + private string selectedColorString; + private int selectedLanguageInt; + private bool toolBoxBool; + private bool computerConnectionBool; + private bool armBool; + private bool trashCompactorBool; + private bool vacuumBool; + private bool fireExtinguisherBool; + private int selectedNumberOfShipsInt; + #endregion #region Constructor + /// <summary> + /// Base constructor. + /// </summary> public RunProgram() { runProgram = true; + Run(); } #endregion @@ -50,15 +69,18 @@ namespace cis237assignment3 { while (runProgram) { - UserInterface.DisplayMainMenu(); - inputString = UserInterface.GetUserInput(); + // Resets/initializes menu bool to allow user to stay in menus. + menusBool = true; + + UserInterface.Menus.DisplayMainMenu(); + userInputString = UserInterface.GetUserInput(); MainMenuSelection(); } } private void MainMenuSelection() { - switch (inputString) + switch (userInputString) { case "1": PurchaseDroid(); @@ -82,7 +104,7 @@ namespace cis237assignment3 private void PurchaseDroid() { - + DroidTypeSelection(); } private void DisplayReciept() @@ -100,6 +122,434 @@ namespace cis237assignment3 runProgram = false; } + private void DroidTypeSelection() + { + UserInterface.Menus.DisplayTypeSelectionMenu(); + userInputString = UserInterface.GetUserInput(); + + switch (userInputString) + { + case "1": + PurchaseProtocol(); + break; + case "2": + PurchaseUtility(); + break; + case "3": + PurchaseJanitor(); + break; + case "4": + PurchaseAstromech(); + break; + case "esc": + break; + default: + break; + } + } + + /// <summary> + /// Methods to run if purchasing any kind of droid at all (generic). + /// </summary> + private void PurchaseGeneric() + { + if (menusBool) + { + ModelSelection(); + } + if (menusBool) + { + MaterialSelection(); + } + if (menusBool) + { + ColorSelection(); + } + + } + + /// <summary> + /// Methods to run if purchasing a droid of type Protocol. + /// </summary> + private void PurchaseProtocol() + { + if (menusBool) + { + PurchaseGeneric(); + } + if (menusBool) + { + LanguageSelection(); + } + if (menusBool) + { + IDroid aDroid = new Droid_Protocol(selectedMaterialString, selectedModelString, selectedColorString, selectedLanguageInt); + } + } + + /// <summary> + /// Methods to run if purchasing a droid of type Utility. + /// </summary> + private void PurchaseUtility() + { + if (menusBool) + { + PurchaseGeneric(); + } + if (menusBool) + { + ToolBoxSelection(); + } + if (menusBool) + { + CompConnectionSelection(); + } + if (menusBool) + { + ArmSelection(); + } + if (menusBool) + { + IDroid aDroid = new Droid_Utility(selectedMaterialString, selectedModelString, selectedColorString, toolBoxBool, computerConnectionBool, armBool); + } + } + + /// <summary> + /// Methods to run if purchasing a droid of type Janitor. + /// </summary> + private void PurchaseJanitor() + { + if (menusBool) + { + PurchaseUtility(); + } + if (menusBool) + { + TrashCompactorSelection(); + } + if (menusBool) + { + VacuumSelection(); + } + if (menusBool) + { + IDroid aDroid = new Droid_Janitor(selectedMaterialString, selectedModelString, selectedColorString, toolBoxBool, computerConnectionBool, armBool, trashCompactorBool, vacuumBool); + } + } + + /// <summary> + /// Methods to run if purchasing a droid of type Astromech. + /// </summary> + private void PurchaseAstromech() + { + if (menusBool) + { + PurchaseUtility(); + } + if (menusBool) + { + FireExtinguisherSelection(); + } + if (menusBool) + { + NumberOfShipsSelection(); + } + if (menusBool) + { + IDroid aDroid = new Droid_Astromech(selectedMaterialString, selectedModelString, selectedColorString, toolBoxBool, computerConnectionBool, armBool, fireExtinguisherBool, selectedNumberOfShipsInt); + } + } + + #region Individual Feature Selections + + /// <summary> + /// Handles user selection of droid Model. + /// </summary> + private void ModelSelection() + { + UserInterface.Menus.DisplayModelSelectionMenu(Droid_Generic.MODEL_1_STRING, Droid_Generic.MODEL_2_STRING); + userInputString = UserInterface.GetUserInput(); + + switch (userInputString) + { + case "1": + selectedModelString = Droid_Generic.MODEL_1_STRING; + break; + case "2": + selectedModelString = Droid_Generic.MODEL_2_STRING; + break; + case "3": + break; + case "4": + break; + case "esc": + menusBool = false; + break; + default: + break; + } + } + + /// <summary> + /// Handles user selection of droid Material. + /// </summary> + private void MaterialSelection() + { + UserInterface.Menus.DisplayMaterialSelectionMenu(Droid_Generic.MATERIAL_1_STRING, Droid_Generic.MATERIAL_2_STRING, Droid_Generic.MATERIAL_3_STRING, Droid_Generic.MATERIAL_4_STRING, Droid_Generic.MATERIAL_5_STRING); + userInputString = UserInterface.GetUserInput(); + + switch (userInputString) + { + case "1": + selectedMaterialString = Droid_Generic.MATERIAL_1_STRING; + break; + case "2": + selectedMaterialString = Droid_Generic.MATERIAL_2_STRING; + break; + case "3": + selectedMaterialString = Droid_Generic.MATERIAL_3_STRING; + break; + case "4": + selectedMaterialString = Droid_Generic.MATERIAL_4_STRING; + break; + case "5": + selectedMaterialString = Droid_Generic.MATERIAL_5_STRING; + break; + case "esc": + menusBool = false; + break; + default: + break; + } + } + + /// <summary> + /// Handles user selection of droid Color. + /// </summary> + private void ColorSelection() + { + UserInterface.Menus.DisplayColorSelectionMenu(Droid_Generic.COLOR_1_STRING, Droid_Generic.COLOR_2_STRING, Droid_Generic.COLOR_3_STRING, Droid_Generic.COLOR_4_STRING, Droid_Generic.COLOR_5_STRING); + userInputString = UserInterface.GetUserInput(); + + switch (userInputString) + { + case "1": + selectedColorString = Droid_Generic.COLOR_1_STRING; + break; + case "2": + selectedColorString = Droid_Generic.COLOR_2_STRING; + break; + case "3": + selectedColorString = Droid_Generic.COLOR_3_STRING; + break; + case "4": + selectedColorString = Droid_Generic.COLOR_4_STRING; + break; + case "5": + selectedColorString = Droid_Generic.COLOR_5_STRING; + break; + case "esc": + menusBool = false; + break; + default: + break; + } + } + + /// <summary> + /// Handles user selection of droid Language. + /// </summary> + private void LanguageSelection() + { + UserInterface.Menus.DisplayLanguageSelectionMenu(Droid_Protocol.LANGUAGE_SELECTION_1, Droid_Protocol.LANGUAGE_SELECTION_2, Droid_Protocol.LANGUAGE_SELECTION_3, Droid_Protocol.LANGUAGE_SELECTION_4); + userInputString = UserInterface.GetUserInput(); + + switch (userInputString) + { + case "1": + selectedLanguageInt = Droid_Protocol.LANGUAGE_SELECTION_1; + break; + case "2": + selectedLanguageInt = Droid_Protocol.LANGUAGE_SELECTION_2; + break; + case "3": + selectedLanguageInt = Droid_Protocol.LANGUAGE_SELECTION_3; + break; + case "4": + selectedLanguageInt = Droid_Protocol.LANGUAGE_SELECTION_4; + break; + case "esc": + menusBool = false; + break; + } + } + + /// <summary> + /// Handles user selection of droid Tool Box. + /// </summary> + private void ToolBoxSelection() + { + UserInterface.Menus.DisplayToolBoxSelectionMenu(); + userInputString = UserInterface.GetUserInput(); + + switch (userInputString) + { + case "1": + toolBoxBool = true; + break; + case "2": + toolBoxBool = false; + break; + case "esc": + menusBool = false; + break; + } + } + + /// <summary> + /// Handles user selection of droid Computer Connection. + /// </summary> + private void CompConnectionSelection() + { + UserInterface.Menus.DisplayComputerConnectionSelectionMenu(); + userInputString = UserInterface.GetUserInput(); + + switch (userInputString) + { + case "1": + computerConnectionBool = true; + break; + case "2": + computerConnectionBool = false; + break; + case "esc": + menusBool = false; + break; + } + } + + /// <summary> + /// Handles user selection of droid Arm. + /// </summary> + private void ArmSelection() + { + UserInterface.Menus.DisplayArmSelectionMenu(); + userInputString = UserInterface.GetUserInput(); + + switch (userInputString) + { + case "1": + armBool = true; + break; + case "2": + armBool = false; + break; + case "esc": + menusBool = false; + break; + } + } + + /// <summary> + /// Handles user selection of droid Trash Compactor. + /// </summary> + private void TrashCompactorSelection() + { + UserInterface.Menus.DisplayTrashCompactorSelectionMenu(); + userInputString = UserInterface.GetUserInput(); + + switch (userInputString) + { + case "1": + trashCompactorBool = true; + break; + case "2": + trashCompactorBool = false; + break; + case "esc": + menusBool = false; + break; + } + } + + /// <summary> + /// Handles user selection of droid Vacuum. + /// </summary> + private void VacuumSelection() + { + UserInterface.Menus.DisplayVacuumSelectionMenu(); + userInputString = UserInterface.GetUserInput(); + + switch (userInputString) + { + case "1": + vacuumBool = true; + break; + case "2": + vacuumBool = false; + break; + case "esc": + menusBool = false; + break; + } + } + + /// <summary> + /// Handles user selection of droid Fire Extinguisher. + /// </summary> + private void FireExtinguisherSelection() + { + UserInterface.Menus.DisplayFireExtinguisherSelectionMenu(); + userInputString = UserInterface.GetUserInput(); + + switch (userInputString) + { + case "1": + fireExtinguisherBool = true; + break; + case "2": + fireExtinguisherBool = false; + break; + case "esc": + menusBool = false; + break; + } + } + + /// <summary> + /// Handles user selection of droid Ship-outfitting number. + /// </summary> + private void NumberOfShipsSelection() + { + while (menusBool) + { + UserInterface.Menus.DisplayNumberOfShipsSelectionMenu(); + userInputString = UserInterface.GetUserInput(); + + // If user does not want to back out of menu. + if (userInputString != "esc") + { + // Attempt to convert user input to int. + try + { + selectedNumberOfShipsInt = Convert.ToInt32(userInputString); + } + catch + { + UserInterface.DisplayError("Not a valid number."); + NumberOfShipsSelection(); + } + } + else + { + menusBool = false; + } + } + } + + #endregion + + #endregion } diff --git a/cis237assignment3/UserInterface.cs b/cis237assignment3/UserInterface.cs index 9fe2a17..1127bb1 100644 --- a/cis237assignment3/UserInterface.cs +++ b/cis237assignment3/UserInterface.cs @@ -11,12 +11,18 @@ namespace cis237assignment3 /// <summary> /// Handles all display to user and reading of user input. /// Having one class handle everything UI helps create consistency. + /// + /// Note: Having the interface methods accept parameters instead of directly calling static variables prevents the + /// interface from having to directly access multiple classes itself. Only RunProgram will access multiple classes + /// due to it being the "binding" between all the classes. + /// + /// Instead, Interface just tells RunProgram what it needs to work and never deals directly with other classes. /// </summary> static class UserInterface { #region Variables - + private static string userInputString; #endregion @@ -40,7 +46,35 @@ namespace cis237assignment3 #region Private Methods + /// <summary> + /// Sets cursor position for menus. + /// </summary> + private static void SetMenuCursor() + { + Console.SetCursorPosition(0, 1); + } + private static void ResetMenuDisplay() + { + // Section to remove everything currently displayed. + SetMenuCursor(); + Console.WriteLine( + "".PadRight(Console.WindowWidth - 1) + Environment.NewLine + + "".PadRight(Console.WindowWidth - 1) + Environment.NewLine + + "".PadRight(Console.WindowWidth - 1) + Environment.NewLine + + "".PadRight(Console.WindowWidth - 1) + Environment.NewLine + + "".PadRight(Console.WindowWidth - 1) + Environment.NewLine + + "".PadRight(Console.WindowWidth - 1) + Environment.NewLine + + "".PadRight(Console.WindowWidth - 1) + Environment.NewLine); + + // Section to add back "esc to go back" display section. + // Recreated each time incase a menu string at some point is too long and writes over it. + SetMenuCursor(); + Console.WriteLine("Type 'esc' at any point to exit out. ".PadLeft(Console.WindowWidth - 1)); + + // Sets cursor for new menu to actually display. + SetMenuCursor(); + } #endregion @@ -54,7 +88,15 @@ namespace cis237assignment3 /// <returns>String of user's input.</returns> public static string GetUserInput() { - return Console.ReadLine().Trim().ToLower(); + Console.SetCursorPosition(1, 9); + + userInputString = Console.ReadLine().Trim().ToLower(); + + // Removing of user input after recieving it. + Console.SetCursorPosition(0, 9); + Console.WriteLine("".PadRight(Console.WindowWidth - 1)); + + return userInputString; } @@ -63,6 +105,21 @@ namespace cis237assignment3 Console.WriteLine(displayString); } + + public static void DisplayError(string displayString) + { + Console.SetCursorPosition(1, 8); + + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine(displayString.PadRight(Console.WindowWidth - 1)); + Console.ForegroundColor = ConsoleColor.Gray; + } + + public static void ClearDisplayLine() + { + + } + /// <summary> /// Struct to hold overbloated list of menus. /// </summary> @@ -73,6 +130,8 @@ namespace cis237assignment3 /// </summary> public static void DisplayMainMenu() { + ResetMenuDisplay(); + Console.WriteLine( " Select an option: " + Environment.NewLine + "" + Environment.NewLine + @@ -82,8 +141,13 @@ namespace cis237assignment3 " 4) Exit"); } + /// <summary> + /// Displays droid Type selection to user. + /// </summary> public static void DisplayTypeSelectionMenu() { + ResetMenuDisplay(); + Console.WriteLine( " Select a Droid Type: " + Environment.NewLine + "" + Environment.NewLine + @@ -93,8 +157,15 @@ namespace cis237assignment3 " 4) Astromech Droid" + Environment.NewLine); } + /// <summary> + /// Displays droid Model selection to user. + /// </summary> + /// <param name="model1">Droid Model 1.</param> + /// <param name="model2">Droid Model 2.</param> public static void DisplayModelSelectionMenu(string model1, string model2) { + ResetMenuDisplay(); + Console.WriteLine( " Select a Droid Model: " + Environment.NewLine + "" + Environment.NewLine + @@ -102,8 +173,18 @@ namespace cis237assignment3 " 2) " + model2 + Environment.NewLine); } + /// <summary> + /// Displays droid Material selection to user. + /// </summary> + /// <param name="material1">Droid Material 1.</param> + /// <param name="material2">Droid Material 2.</param> + /// <param name="material3">Droid Material 3.</param> + /// <param name="material4">Droid Material 4.</param> + /// <param name="material5">Droid Material 5.</param> public static void DisplayMaterialSelectionMenu(string material1, string material2, string material3, string material4, string material5) { + ResetMenuDisplay(); + Console.WriteLine( " Select a Droid Material: " + Environment.NewLine + "" + Environment.NewLine + @@ -114,8 +195,18 @@ namespace cis237assignment3 " 5) " + material5 + Environment.NewLine); } + /// <summary> + /// Displays droid Color selection to user. + /// </summary> + /// <param name="color1">Droid Color 1.</param> + /// <param name="color2">Droid Color 2.</param> + /// <param name="color3">Droid Color 3.</param> + /// <param name="color4">Droid Color 4.</param> + /// <param name="color5">Droid Color 5.</param> public static void DisplayColorSelectionMenu(string color1, string color2, string color3, string color4, string color5) { + ResetMenuDisplay(); + Console.WriteLine( " Select a Droid Color: " + Environment.NewLine + "" + Environment.NewLine + @@ -126,19 +217,33 @@ namespace cis237assignment3 " 5) " + color5 + Environment.NewLine); } - public static void DisplayLanguageSelectionMenu() + /// <summary> + /// Displays droid Language selection to user. + /// </summary> + /// <param name="langSelection1">Droid Language 1.</param> + /// <param name="langSelection2">Droid Language 2.</param> + /// <param name="langSelection3">Droid Language 3.</param> + /// <param name="langSelection4">Droid Language 4.</param> + public static void DisplayLanguageSelectionMenu(int langSelection1, int langSelection2, int langSelection3, int langSelection4) { + ResetMenuDisplay(); + Console.WriteLine( " Select number of Built in Languages: " + Environment.NewLine + "" + Environment.NewLine + - " 1) 1" + Environment.NewLine + - " 2) 3" + Environment.NewLine + - " 3) 7" + Environment.NewLine + - " 4) 12" + Environment.NewLine); + " 1) " + langSelection1 + Environment.NewLine + + " 2) " + langSelection2 + Environment.NewLine + + " 3) " + langSelection3 + Environment.NewLine + + " 4) " + langSelection4 + Environment.NewLine); } + /// <summary> + /// Displays droid Tool Box selection to user. + /// </summary> public static void DisplayToolBoxSelectionMenu() { + ResetMenuDisplay(); + Console.WriteLine( " Add Toolbox Functionality? " + Environment.NewLine + "" + Environment.NewLine + @@ -146,17 +251,27 @@ namespace cis237assignment3 " 2) No" +Environment.NewLine); } + /// <summary> + /// Displays droid Computer Connection selection to user. + /// </summary> public static void DisplayComputerConnectionSelectionMenu() { + ResetMenuDisplay(); + Console.WriteLine( - " Add Computer Connection Functionality? " + Environment.NewLine + + " Add Network Functionality? " + Environment.NewLine + "" + Environment.NewLine + " 1) Yes" + Environment.NewLine + " 2) No" + Environment.NewLine); } + /// <summary> + /// Displays droid Arm selection to user. + /// </summary> public static void DisplayArmSelectionMenu() { + ResetMenuDisplay(); + Console.WriteLine( " Add Mechanical Arm Functionality? " + Environment.NewLine + "" + Environment.NewLine + @@ -164,8 +279,13 @@ namespace cis237assignment3 " 2) No" + Environment.NewLine); } + /// <summary> + /// Displays droid Color selection to user. + /// </summary> public static void DisplayTrashCompactorSelectionMenu() { + ResetMenuDisplay(); + Console.WriteLine( " Add Trash Compactor Functionality? " + Environment.NewLine + "" + Environment.NewLine + @@ -173,8 +293,13 @@ namespace cis237assignment3 " 2) No" + Environment.NewLine); } + /// <summary> + /// Displays droid Vacuum selection to user. + /// </summary> public static void DisplayVacuumSelectionMenu() { + ResetMenuDisplay(); + Console.WriteLine( " Add Vacuum Functionality? " + Environment.NewLine + "" + Environment.NewLine + @@ -182,8 +307,13 @@ namespace cis237assignment3 " 2) No" + Environment.NewLine); } + /// <summary> + /// Displays droid Fire Extinguisher selection to user. + /// </summary> public static void DisplayFireExtinguisherSelectionMenu() { + ResetMenuDisplay(); + Console.WriteLine( " Add built in Fire Extinguisher? " + Environment.NewLine + "" + Environment.NewLine + @@ -191,14 +321,17 @@ namespace cis237assignment3 " 2) No" + Environment.NewLine); } + /// <summary> + /// Displays droid Ship-outfitting Number selection to user. + /// </summary> public static void DisplayNumberOfShipsSelectionMenu() { + ResetMenuDisplay(); + Console.WriteLine( - " How many ships do you need to outfit this kind of droid onto? " + Environment.NewLine + - "" + Environment.NewLine + - " 1)"); + " Outfit onto how many ships? " + Environment.NewLine + + "" + Environment.NewLine); } - } #endregion -- GitLab