public Train(string name, Carriage headCarriage, Carriage[] carriages = null) { Name = name; this.carriages.Add(headCarriage); if (carriages != null) { this.carriages.AddRange(carriages); } }
public void AddCarriage(Carriage carriage) { this.carriages.Add(carriage); }