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("Все накормлены."); } }
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(); } }
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("Все отремонтированы."); } }