Refactor HighestEstrus

This commit is contained in:
lutepickle 2024-05-14 21:15:49 -07:00
parent 2516ed1439
commit c9c5e70246

View file

@ -395,23 +395,10 @@ namespace RJW_Menstruation
public static HediffComp_Menstruation.EstrusLevel HighestEstrus(this Pawn pawn) public static HediffComp_Menstruation.EstrusLevel HighestEstrus(this Pawn pawn)
{ {
HediffComp_Menstruation.EstrusLevel res = HediffComp_Menstruation.EstrusLevel.None; return pawn.GetMenstruationComps().
Select(comp => comp.GetEstrusLevel()).
foreach(HediffComp_Menstruation comp in pawn.GetMenstruationComps()) DefaultIfEmpty(HediffComp_Menstruation.EstrusLevel.None).
{ Max();
switch (comp.GetEstrusLevel())
{
case HediffComp_Menstruation.EstrusLevel.None:
break;
case HediffComp_Menstruation.EstrusLevel.Concealed:
res = HediffComp_Menstruation.EstrusLevel.Concealed;
break;
case HediffComp_Menstruation.EstrusLevel.Visible:
return HediffComp_Menstruation.EstrusLevel.Visible;
}
}
return res;
} }
public static bool HasIUD(this Pawn pawn) public static bool HasIUD(this Pawn pawn)