static void Main(string[] args) { PartOriginCountry handlebar = PartOriginCountry.Norwey; PartOriginCountry frame = PartOriginCountry.China; PartOriginCountry brakes = PartOriginCountry.Germany; PartOriginCountry wheels = PartOriginCountry.Poland; var form = new Form(handlebar, frame, brakes, wheels); CustomBike bike = form.ProduceBike(); var newBike = bike.Clone(); Console.WriteLine("Custom bike:"); Console.WriteLine(bike); Console.WriteLine(); var customBike1 = bike.Clone(); Console.WriteLine($"Cloned bike 1: \n{customBike1} \n"); var customBike2 = bike.Clone(); Console.WriteLine($"Cloned bike 2: \n{customBike2} \n"); Console.ReadKey(); }
public CustomBike ProduceBike() { var bike = new CustomBike(_handlebar, _frame, _brakes, _wheels); return(bike); }