public void Cut(Potato p) { if (p.Have_wholeness) { p.Have_wholeness = false; } }
public void Clean(Potato p) { if (p.Have_skin) { p.Have_skin = false; } }
public void Wash(Potato p) { if (State) { p.Dirty = 0; } }
private void button1_Click_1(object sender, EventArgs e) { if (numericUpDown1.Value > 0) { if (!waterTap.State) { MessageBox.Show("Кран закрыт, как мыть?", "Ошибка логики", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } potatos = new Potato[Convert.ToInt32(numericUpDown1.Value)]; fryer.Init(Convert.ToInt32(numericUpDown1.Value)); for (int i = 0; i < potatos.Length; ++i) { potatos[i] = new Potato(); } for (int i = 0; i < potatos.Length; ++i) { potatos[i].Dirty = 0; } numericUpDown1.Enabled = false; radioButton2.Checked = true; MessageBox.Show("Картошку помыли, можно чистить", "Кухня", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Картошки то нет, что мыть?", "Ошибка логики", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void AddPotato(Potato p) { for (int i = 0; i < potatos.Length; ++i) { if (potatos[i] == null) { potatos[i] = p; } return; } }