void ReleaseAll() { int released = PrisonerUtil.Release(prison, prisoner => true); MessageBox.Show(String.Format("All {0} prisoners scheduled for release.", released)); UpdatePrisoners(); }
void bRelease_Click(object sender, EventArgs e) { PrisonerUtil.ReleasePrisoner(prison, selectedPrisoner.Id); pbServed.Value = 100; PrisonerBio bio = selectedPrisoner.Bio; lServedStats.Text = String.Format("{0:0.#} of {1} years", bio.Served, bio.Sentence); bRelease.Enabled = false; }
void EliminateAll() { int released = PrisonerUtil.Eliminate(prison, prisoner => true); MessageBox.Show(String.Format("All {0} prisoners eliminated.", released)); UpdatePrisoners(); }
void cCategory_SelectedIndexChanged(object sender, EventArgs e) { if (SelectedPrisoner != null) { SelectedPrisoner.Category = PrisonerUtil.CategoryIndexToName(cCategory.SelectedIndex); } }
void UpdatePrisonerCategoryItem(ToolStripMenuItem miEliminate, ToolStripMenuItem miRelease, string categoryName, string label) { int allCount; if (categoryName == null) { allCount = prison.Objects.Prisoners.Count; } else { allCount = PrisonerUtil.CountPrisoners(prison, p => p.Category == categoryName); } miEliminate.Text = String.Format("{0} ({1})", label, allCount); miEliminate.Enabled = (allCount > 0); int nonReleasedCount; if (categoryName == null) { nonReleasedCount = PrisonerUtil.CountPrisoners(prison, p => p.Bio.Served < p.Bio.Sentence); } else { nonReleasedCount = PrisonerUtil.CountPrisoners(prison, p => p.Category == categoryName && p.Bio.Served < p.Bio.Sentence); } miRelease.Text = String.Format("{0} ({1})", label, nonReleasedCount); miRelease.Enabled = (nonReleasedCount > 0); }
void Release(string categoryName) { string groupLabel = PrisonerUtil.InternalToInGameCatName(categoryName); int released = PrisonerUtil.Release(prison, prisoner => prisoner.Category == categoryName); MessageBox.Show(String.Format("{0} {1} prisoners scheduled for release.", released, groupLabel)); UpdatePrisoners(); }
void bEliminate_Click(object sender, EventArgs e) { PrisonerUtil.EliminatePrisoner(prison, SelectedPrisoner.Id); SelectedPrisoner = null; UpdatePrisoners(); }