public Tanker(string name, float liftingCapacity, int numberOfStaff, string transportedLiquid, TankerType tankerType) { Name = name; LiftingCapacity = liftingCapacity; NumberOfStaff = numberOfStaff; TransportedLiquid = transportedLiquid; TankerType = tankerType; }
private void AddBtn_Click(object sender, EventArgs e) { string name = nameTB.Text; float lifting = (float)liftingNUD.Value; int staff = (int)staffCountNUD.Value; string transportedLiquid = transportedLiquidTB.Text; TankerType tankerType = (TankerType )Enum.Parse(typeof(TankerType), (string)typeCB.SelectedItem); ships.Add(new Tanker(name, lifting, staff, transportedLiquid, tankerType)); ReloadList(); Print($"Корабль {name} добавлен."); }