Exemplo n.º 1
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;
 }
Exemplo n.º 2
0
 public Prisoner(ObjectBase baseObj)
     : base(baseObj.Label, true) {
     Id = baseObj.Id;
     Type = baseObj.Type;
     ReparseProperties(baseObj);
     CopyNodes(baseObj);
     Bio = (PrisonerBio)PopNode("Bio");
 }
Exemplo n.º 3
0
 public override Node CreateNode(string label) {
     if (Type.Equals("Prisoner") && label.Equals("Bio")) {
         var bio = new PrisonerBio(label);
         PushNode(label, bio);
         return bio;
     } else {
         return base.CreateNode(label);
     }
 }
Exemplo n.º 4
0
 public Prisoner(ObjectBase baseObj)
     : base(baseObj.Label, true)
 {
     Id   = baseObj.Id;
     Type = baseObj.Type;
     ReparseProperties(baseObj);
     CopyNodes(baseObj);
     Bio = (PrisonerBio)PopNode("Bio");
 }
Exemplo n.º 5
0
 public override Node CreateNode(string label)
 {
     if (Type.Equals("Prisoner") && label.Equals("Bio"))
     {
         var bio = new PrisonerBio(label);
         PushNode(label, bio);
         return(bio);
     }
     else
     {
         return(base.CreateNode(label));
     }
 }
Exemplo n.º 6
0
        // Schedules a single prisoner for release, by ID.
        public static void ReleasePrisoner(Prison prison, int id)
        {
            PrisonerBio bio = prison.Objects.Prisoners[id].Bio;

            bio.Served = bio.Sentence;
        }