Exemplo n.º 1
0
 public void Cut(Potato p)
 {
     if (p.Have_wholeness)
     {
         p.Have_wholeness = false;
     }
 }
Exemplo n.º 2
0
 public void Clean(Potato p)
 {
     if (p.Have_skin)
     {
         p.Have_skin = false;
     }
 }
Exemplo n.º 3
0
 public void Wash(Potato p)
 {
     if (State)
     {
         p.Dirty = 0;
     }
 }
Exemplo n.º 4
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);
     }
 }
Exemplo n.º 5
0
 public void AddPotato(Potato p)
 {
     for (int i = 0; i < potatos.Length; ++i)
     {
         if (potatos[i] == null)
         {
             potatos[i] = p;
         }
         return;
     }
 }