/// <summary>
        /// Handles user selection of droid Type.
        /// </summary>
        private void DroidTypeSelection()
        {
            UserInterface.Menus.DisplayTypeSelectionMenu();
            userInputString = UserInterface.GetUserInput();

            switch (userInputString)
            {
                case "1":
                    PurchaseProtocol();

                    // After user selects values for droid, actually create it, add it to the collection, and calculate the various associated prices.
                    if (menusBool)
                    {
                        UserInterface.ClearDisplayLine();
                        IDroid aDroid = new Droid_Protocol(selectedMaterialString, selectedModelString, selectedColorString, selectedLanguageInt);
                        droidCollection.AddDroid(aDroid);
                        droidCollection.DroidList[droidCollection.DroidListSize - 1].CalculateFeatures();
                        droidCollection.DroidList[droidCollection.DroidListSize - 1].CalculateTotalCost();
                    }
                    break;
                case "2":
                    PurchaseUtility();

                    // After user selects values for droid, actually create it, add it to the collection, and calculate the various associated prices.
                    if (menusBool)
                    {
                        UserInterface.ClearDisplayLine();
                        IDroid aDroid = new Droid_Utility(selectedMaterialString, selectedModelString, selectedColorString, toolBoxBool, computerConnectionBool, armBool);
                        droidCollection.AddDroid(aDroid);
                        droidCollection.DroidList[droidCollection.DroidListSize - 1].CalculateFeatures();
                        droidCollection.DroidList[droidCollection.DroidListSize - 1].CalculateTotalCost();
                    }
                    break;
                case "3":
                    PurchaseJanitor();

                    // After user selects values for droid, actually create it, add it to the collection, and calculate the various associated prices.
                    if (menusBool)
                    {
                        UserInterface.ClearDisplayLine();
                        IDroid aDroid = new Droid_Janitor(selectedMaterialString, selectedModelString, selectedColorString, toolBoxBool, computerConnectionBool, armBool, trashCompactorBool, vacuumBool);
                        droidCollection.AddDroid(aDroid);
                        droidCollection.DroidList[droidCollection.DroidListSize - 1].CalculateFeatures();
                        droidCollection.DroidList[droidCollection.DroidListSize - 1].CalculateTotalCost();
                    }
                    break;
                case "4":
                    PurchaseAstromech();

                    // After user selects values for droid, actually create it, add it to the collection, and calculate the various associated prices.
                    if (menusBool)
                    {
                        UserInterface.ClearDisplayLine();
                        IDroid aDroid = new Droid_Astromech(selectedMaterialString, selectedModelString, selectedColorString, toolBoxBool, computerConnectionBool, armBool, fireExtinguisherBool, selectedNumberOfShipsInt);
                        droidCollection.AddDroid(aDroid);
                        droidCollection.DroidList[droidCollection.DroidListSize - 1].CalculateFeatures();
                        droidCollection.DroidList[droidCollection.DroidListSize - 1].CalculateTotalCost();
                    }
                    break;
                case "esc":
                    UserInterface.ClearDisplayLine();
                    break;
                default:
                    UserInterface.DisplayError("Invalid selection.");
                    DroidTypeSelection();
                    break;
            }
        }
Example #2
0
        /// <summary>
        /// Handles user selection of droid Type.
        /// </summary>
        private void DroidTypeSelection()
        {
            UserInterface.Menus.DisplayTypeSelectionMenu();
            userInputString = UserInterface.GetUserInput();

            switch (userInputString)
            {
            case "1":
                PurchaseProtocol();

                // After user selects values for droid, actually create it, add it to the collection, and calculate the various associated prices.
                if (menusBool)
                {
                    UserInterface.ClearDisplayLine();
                    IDroid aDroid = new Droid_Protocol(selectedMaterialString, selectedModelString, selectedColorString, selectedLanguageInt);
                    droidCollection.AddDroid(aDroid);
                    droidCollection.DroidList[droidCollection.DroidListSize - 1].CalculateFeatures();
                    droidCollection.DroidList[droidCollection.DroidListSize - 1].CalculateTotalCost();
                }
                break;

            case "2":
                PurchaseUtility();

                // After user selects values for droid, actually create it, add it to the collection, and calculate the various associated prices.
                if (menusBool)
                {
                    UserInterface.ClearDisplayLine();
                    IDroid aDroid = new Droid_Utility(selectedMaterialString, selectedModelString, selectedColorString, toolBoxBool, computerConnectionBool, armBool);
                    droidCollection.AddDroid(aDroid);
                    droidCollection.DroidList[droidCollection.DroidListSize - 1].CalculateFeatures();
                    droidCollection.DroidList[droidCollection.DroidListSize - 1].CalculateTotalCost();
                }
                break;

            case "3":
                PurchaseJanitor();

                // After user selects values for droid, actually create it, add it to the collection, and calculate the various associated prices.
                if (menusBool)
                {
                    UserInterface.ClearDisplayLine();
                    IDroid aDroid = new Droid_Janitor(selectedMaterialString, selectedModelString, selectedColorString, toolBoxBool, computerConnectionBool, armBool, trashCompactorBool, vacuumBool);
                    droidCollection.AddDroid(aDroid);
                    droidCollection.DroidList[droidCollection.DroidListSize - 1].CalculateFeatures();
                    droidCollection.DroidList[droidCollection.DroidListSize - 1].CalculateTotalCost();
                }
                break;

            case "4":
                PurchaseAstromech();

                // After user selects values for droid, actually create it, add it to the collection, and calculate the various associated prices.
                if (menusBool)
                {
                    UserInterface.ClearDisplayLine();
                    IDroid aDroid = new Droid_Astromech(selectedMaterialString, selectedModelString, selectedColorString, toolBoxBool, computerConnectionBool, armBool, fireExtinguisherBool, selectedNumberOfShipsInt);
                    droidCollection.AddDroid(aDroid);
                    droidCollection.DroidList[droidCollection.DroidListSize - 1].CalculateFeatures();
                    droidCollection.DroidList[droidCollection.DroidListSize - 1].CalculateTotalCost();
                }
                break;

            case "esc":
                UserInterface.ClearDisplayLine();
                break;

            default:
                UserInterface.DisplayError("Invalid selection.");
                DroidTypeSelection();
                break;
            }
        }