/// <summary> /// Returns how many Dead Humans had which Profession /// </summary> /// <param name="humans">The Dead Humans to be analyzed</param> /// <returns></returns> public static Dictionary<string, int> ProfessionInformation(HumanSnapshot[] humans) { Dictionary<string, int> profInf = new Dictionary<string, int>(); foreach (EProfession prof in Enum.GetValues(typeof(EProfession))) { profInf.Add(prof.ToString(), humans.Count(x => x.Profession.Equals(prof))); } return profInf; }
/// <summary> /// Returns, how many Humans died away from Home /// </summary> /// <param name="humans">The Dead Humans to be analyzed</param> /// <returns></returns> public static string HomeCellInformation(HumanSnapshot[] humans) { return humans.Count(x => x.HomeCell != x.DeathCell) + " out of " + humans.Length + " Humans died far away from home..."; }
/// <summary> /// Return information about deathCauses /// </summary> /// <param name="humans">The Dead Humans to be analyzed</param> /// <returns></returns> public static string DeathInformation(HumanSnapshot[] humans) { return humans.Count(x => x.Cause) + " Humans died of the disease, " + humans.Count(x => !x.Cause) + " Humans died of their age..."; }