Little refactor in GetBabyInfo and GetFatherInfo

This commit is contained in:
lutepickle 2024-02-10 10:10:55 -08:00
parent 02b0045fb3
commit 56b11069da
1 changed files with 2 additions and 4 deletions

View File

@ -20,9 +20,8 @@ namespace RJW_Menstruation
StringBuilder res = new StringBuilder();
IEnumerable<Pawn> babiesdistinct = babies.Distinct(new RaceComparer());
int iteration = 0;
foreach (Pawn baby in babiesdistinct)
foreach (Pawn baby in babies.Distinct(new RaceComparer()))
{
int num = babies.Where(x => x.def.Equals(baby.def)).Count();
if (iteration > 0) res.Append(", ");
@ -43,9 +42,8 @@ namespace RJW_Menstruation
if (!is_parent_known && Configurations.InfoDetail != Configurations.DetailLevel.All)
return res.Append(Translations.Dialog_FatherUnknown).ToString();
IEnumerable<Pawn> babiesdistinct = babies.Distinct(new FatherComparer(mother));
int iteration = 0;
foreach (Pawn baby in babiesdistinct)
foreach (Pawn baby in babies.Distinct(new FatherComparer(mother)))
{
if (iteration > 0) res.Append(", ");
res.Append(Utility.GetFather(baby, mother)?.LabelShort ?? Translations.Dialog_FatherUnknown);