public abstract CarBase Create(BodyNames bodyName, int doors, int wheels, int seats, TypesOfDrive typesOfDrive, string model, string generation, Colors color, double weght, double carrying, decimal price);
public override CarBase Create(BodyNames bodyName, int doors, int wheels, int seats, TypesOfDrive typesOfDrive, string model, string generation, Colors color, double weght, double carrying, decimal price) { body = new BodyType(bodyName, doors, wheels, seats, typesOfDrive); this.model = new Model(model); this.color = new Color(color); this.price = price; CarBase car = new Suv(body, Brand, this.model, this.color, price) { CarType = carType, Weght = weght, Сarrying = carrying }; return(car); }
public BodyType(BodyNames bodyName, int numberOfDoors, int numberOfWheels, int numberOfSeats, TypesOfDrive typeOfDrive) { BodyName = bodyName.ToString(); NumberOfDoors = numberOfDoors; NumberOfWheels = numberOfWheels; NumberOfSeats = numberOfSeats; TypeOfDrive = $"{typeOfDrive}x{numberOfWheels}"; }