Ejemplo n.º 1
0
        void ReleaseAll()
        {
            int released = PrisonerUtil.Release(prison, prisoner => true);

            MessageBox.Show(String.Format("All {0} prisoners scheduled for release.", released));
            UpdatePrisoners();
        }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
        void EliminateAll()
        {
            int released = PrisonerUtil.Eliminate(prison, prisoner => true);

            MessageBox.Show(String.Format("All {0} prisoners eliminated.", released));
            UpdatePrisoners();
        }
Ejemplo n.º 4
0
 void cCategory_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (SelectedPrisoner != null)
     {
         SelectedPrisoner.Category = PrisonerUtil.CategoryIndexToName(cCategory.SelectedIndex);
     }
 }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
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();
        }
Ejemplo n.º 7
0
 void bEliminate_Click(object sender, EventArgs e) {
     PrisonerUtil.EliminatePrisoner(prison, SelectedPrisoner.Id);
     SelectedPrisoner = null;
     UpdatePrisoners();
 }