Exemple #1
0
 private void btnFeed_Click(object sender, EventArgs e)
 {
     if (!ckbxAll.Checked)
     {
         Output(iterator.Current().Feed());
     }
     else if (!ta.Empty)
     {
         VolunteerIterator iter   = new VolunteerIterator(ta);
         Volunteer         member = iter.First();
         while (!iter.isDone())
         {
             member.Feed();
             member = iter.Next();
         }
         Output("Все накормлены.");
     }
 }
Exemple #2
0
 private void tmrClock_Tick(object sender, EventArgs e)
 {
     if (!ta.Empty)
     {
         VolunteerIterator iter   = new VolunteerIterator(ta);
         Volunteer         member = iter.First();
         while (!iter.isDone())
         {
             if (member.HourOfLife())
             {
                 Log(member.GetName() + "[id:" + member.ID.ToString() + "] погибает.");
                 ta.RemoveVolunteer(iter.Index);
             }
             member = iter.Next();
         }
         UpdateIterator();
     }
 }
Exemple #3
0
 private void btnRepair_Click(object sender, EventArgs e)
 {
     if (!ckbxAll.Checked)
     {
         Output(iterator.Current().Repair());
     }
     else if (!ta.Empty)
     {
         VolunteerIterator iter   = new VolunteerIterator(ta);
         Volunteer         member = iter.First();
         while (!iter.isDone())
         {
             member.Repair();
             member = iter.Next();
         }
         Output("Все отремонтированы.");
     }
 }