public Car(string model, int speed, int power, int weight, string type, double tirepresure1, int tireage1, double tirepresure2, int tireage2, double tirepresure3, int tireage3, double tirepresure4, int tireage4) { this.Model = model; Engine engine = new Engine(); this.Engine.EngineSpeed = speed; this.Engine.Power = power; this.Cargo.Cargoweight = weight; this.Cargo.Cargotype = type; this.Tires = new List <Tire>(); Tire tire = new Tire(); this.Tires = tire.TireList(tirepresure1, tireage1, tirepresure2, tireage2, tirepresure3, tireage3, tirepresure4, tireage4); }
public List <Tire> TireList(double tirePresure1, int tireAge1, double tirePresure2, int tireAge2, double tirePresure3, int tireAge3, double tirePresure4, int tireAge4) { List <Tire> tires = new List <Tire>(); Tire tire = new Tire(); Tire tire2 = new Tire(); Tire tire3 = new Tire(); Tire tire4 = new Tire(); tire2.TirePresure = tirePresure1; tire2.TireAge = tireAge1; tires.Add(tire2); tire3.TirePresure = tirePresure2; tire3.TireAge = tireAge2; tires.Add(tire3); tire4.TirePresure = tirePresure3; tire4.TireAge = tireAge3; tires.Add(tire4); tire.TirePresure = tirePresure4; tire.TireAge = tireAge4; tires.Add(tire); return(tires); }