public void Execute() { SelectCarType(); Brand brand = SelectBrand(); SelectColour(); IColourDecoration colourDecoration = SelectColourDeco(); EngineClass engine = SelectEngine(); SelectWheel(); IWheelDeco wheelDeco = SelectWheelDeco(); Numberplate numberplate = AssignNumberplate(); IWheel wheel = (IWheel)Activator.CreateInstance(wheelList[listOfIndex.Last()], wheelDeco); listOfIndex.RemoveAt(listOfIndex.Count - 1); ICarColour carColour = (ICarColour)Activator.CreateInstance(carColourList[listOfIndex.Last()], colourDecoration); listOfIndex.RemoveAt(listOfIndex.Count - 1); Vehicle vehicle = (Vehicle)Activator.CreateInstance(types[listOfIndex.Last()], new object[] { carColour, wheel, brand, numberplate, engine }); Console.WriteLine("Congratulation you successfully added a new vehicle"); carDealer.AddVehicleToList(vehicle); command = new PrintVehicleCommand() { List = carDealer.Vehicles }; command.Execute(); listOfIndex.Clear(); }
public Green(IColourDecoration decorations) { this.decorations = decorations; }
public Black(IColourDecoration decorations) { this.decorations = decorations; }
public Silver(IColourDecoration decorations) { this.decorations = decorations; }
public White(IColourDecoration decorations) { this.decorations = decorations; }