Exemple #1
0
 public void MoveSimulantToDeadPopulation(Simulant simulant)
 {
     _ = simulant.Gender == Simulant.Genders.Female ?
         AliveFemale.Remove(simulant) :
         AliveMale.Remove(simulant);
     Dead.Add(simulant);
 }
Exemple #2
0
 public void AddSimulantToAlivePopulation(Simulant simulant)
 {
     if (simulant.Gender == Simulant.Genders.Female)
     {
         AliveFemale.Add(simulant);
     }
     else
     {
         AliveMale.Add(simulant);
     }
 }
Exemple #3
0
        public void MoveAllEligibleSimulantsToDeadPopulation()
        {
            List <Simulant> newlyDeadSimulants =
                AliveFemale.Where(sim =>
                                  sim.HealthStage == Simulant.HealthStages.Dead).Union(
                    AliveMale.Where(sim =>
                                    sim.HealthStage == Simulant.HealthStages.Dead)).ToList();

            foreach (Simulant simulant in newlyDeadSimulants)
            {
                MoveSimulantToDeadPopulation(simulant);
                Simulant.AfterKill(simulant);
            }
        }