Exemplo n.º 1
0
        public static void PickJob(Adult adult, int chance)
        {
            bool canGetJob = Globals.random.Next(0, chance) == chance - 1;

            if (canGetJob)
            {
                int jobPicker = Globals.random.Next(0, 2);

                JobChoices(adult, jobPicker);
            }
        }
Exemplo n.º 2
0
        public static void BreakUp(Adult adult)
        {
            if (adult.HasPartner)
            {
                adult.Partner.HasPartner = false;
                adult.Partner.Partner    = null;

                adult.Partner    = null;
                adult.HasPartner = false;
            }
        }
Exemplo n.º 3
0
 public void MakeChildrenAdults()
 {
     for (int i = 0; i < Humans.Count; i++)
     {
         if (!Humans[i].IsAdult && Humans[i].Age > 3)
         {
             Humans[i] = new Adult((Child)Humans[i]);
             Announcements.Add($"{Humans[i].Name} became an adult!");
         }
     }
 }
Exemplo n.º 4
0
        public static bool MakeCouple(Adult adult1, Adult adult2, int chance)
        {
            int tempChance = Globals.random.Next(0, chance);

            if ((adult1.Parent1 == adult2.Parent1) && (adult1.Parent2 == adult2.Parent2))
            {
                if (adult1.Parent1 != null || adult1.Parent2 != null)
                {
                    return(false);
                }
            }
            if ((!adult1.HasPartner && !adult2.HasPartner) && (adult1 != adult2) && (tempChance == chance - 1))
            {
                adult1.Partner = adult2;
                adult2.Partner = adult1;

                adult1.HasPartner = true;
                adult2.HasPartner = true;

                return(true);
            }
            return(false);
        }