示例#1
0
        public void OpenGarage()
        {
            UI.eGarageActions action;
            bool   userWantsToQuit = false;
            string openString      = "Please choose an action:";

            do
            {
                UI.PrintString(openString);
                action = UI.GetActionFromUser();
                UI.ClearScreen();
                switch (action)
                {
                case UI.eGarageActions.InsertNewVehicle:
                    insertNewVehicleToGarage();
                    break;

                case UI.eGarageActions.DisplayAllVehiclesInGarage:
                    displayVehiclesInGarage();
                    break;

                case UI.eGarageActions.ChangeTheStatusOfCar:
                    changeTheStatusOfVehicle();
                    break;

                case UI.eGarageActions.InflateTheWheels:
                    inflateTheWheels();
                    break;

                case UI.eGarageActions.Refuel:
                    refuel();
                    break;

                case UI.eGarageActions.ChargeTheBattery:
                    chargeTheBattery();
                    break;

                case UI.eGarageActions.DisplayFullDetailsOfVehicle:
                    displayFullDetailsOfVehicle();
                    break;

                case UI.eGarageActions.Quit:
                    userWantsToQuit = true;
                    break;
                }
            }while (!userWantsToQuit);
        }