Exemple #1
0
 public void LoadCargoInto(CargoPlane intoCargoplane, int newCargo)
 {
     foreach (var airplane in airplanesList)
     {
         if (airplane is CargoPlane)
         {
             //var cargoplane = airplane as CargoPlane;
             var cargoplane = (CargoPlane)airplane;
             if (intoCargoplane.PlaneId.Equals(cargoplane.PlaneId))
             {
                 intoCargoplane.LoadCargo(newCargo);
             }
         }
     }
 }
Exemple #2
0
        //Operations on Cargo planes:

        public void AddCargoPlane(CargoPlane newCargoPlane)
        {
            airplanesList.Add(newCargoPlane);
            Console.WriteLine(value: $"The cargo plane with ID: {newCargoPlane.PlaneId} has been added to the {AirportName} airport.\n");
        }