public void cutMeat(Meat m) { if (m.needCut) { m.needCut = false; } }
private void button11_Click(object sender, EventArgs e) { veg = new Veg[Convert.ToInt32(numericUpDown2.Value)]; for (int i = 0; i < veg.Length; i++) { veg[i] = new Veg(); } for (int i = 0; i < veg.Length; i++) { veg[i].isDirty = true; } meat = new Meat[Convert.ToInt32(numericUpDown1.Value)]; for (int i = 0; i < meat.Length; i++) { meat[i] = new Meat(); } for (int i = 0; i < meat.Length; i++) { meat[i].needCut = true; } numericUpDown2.Enabled = false; numericUpDown1.Enabled = false; ready = true; }
public void addMeat(Meat m) { for (int i = 0; i < meat.Length; i++) { if (meat[i] == null) { meat[i] = m; return; } } }