static void Main() { Menu menu = new Menu(); Garage garage = new Garage(); bool isStillRunning = true; do { switch (menu.ShowMenuToTheUserAndReturnSelectedIndex()) { case 1: { AddParkingLotsToGarage(garage); break; } case 2: { CreateAndParkANewCarInTheGarage(garage); break; } case 3: { garage.WriteGarageLayoutToTheUser(); break; } case 4: { isStillRunning = CheckIfTheUserWantsToCloseTheApplication(); break; } } } while (isStillRunning); }
private static void AddParkingLotsToGarage(Garage garage) { Console.Write("Enter number of parking lots: "); var numberOfParkingLotsInput = Console.ReadLine(); var numberOfParkingLots = Convert.ToInt32(numberOfParkingLotsInput); garage.AddParkingLots(numberOfParkingLots); }
private static void CreateAndParkANewCarInTheGarage(Garage garage) { var newCar = CreateANewCar(); garage.ParkCar(newCar); }