Exemplo n.º 1
0
        private void MainMenu()
        {
            ui.PrintLine("Garage 1.0");
            do
            {
                ui.PrintLine("0 - Quit");
                ui.PrintLine("1 - Create new garage");
                ui.PrintLine("2 - Manage vehicles (add, remove, display info)");
                ui.PrintLine("3 - Searches (list and search in garage)");
                ui.PrintLine("4 - Populate garage with testdata");
                ui.PrintLine("5 - Resize garage");

                int choice = ui.ReadInt();

                switch (choice)
                {
                case 1:
                    CreateGarage();
                    break;

                case 2:
                    VehiclesManagement();
                    break;

                case 3:
                    GarageSearch();
                    break;

                case 4:
                    PopulateWithTestData();
                    ui.PrintLine("Garage has been populated with test data");
                    break;

                case 5:
                    int newSize = ui.ReadInt($"Current size  is {garage.Capacity}. If size is reduced, data may be lost. New size: ");
                    garage.Resize(newSize);
                    break;

                case 0:
                    ui.PrintLine("Exiting.");
                    return;

                default:
                    ui.PrintLine("Please enter a valid input.");
                    break;
                }
            }while (true);
        }