Refactor HighestEstrus
This commit is contained in:
parent
2516ed1439
commit
c9c5e70246
|
@ -395,23 +395,10 @@ namespace RJW_Menstruation
|
|||
|
||||
public static HediffComp_Menstruation.EstrusLevel HighestEstrus(this Pawn pawn)
|
||||
{
|
||||
HediffComp_Menstruation.EstrusLevel res = HediffComp_Menstruation.EstrusLevel.None;
|
||||
|
||||
foreach(HediffComp_Menstruation comp in pawn.GetMenstruationComps())
|
||||
{
|
||||
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;
|
||||
return pawn.GetMenstruationComps().
|
||||
Select(comp => comp.GetEstrusLevel()).
|
||||
DefaultIfEmpty(HediffComp_Menstruation.EstrusLevel.None).
|
||||
Max();
|
||||
}
|
||||
|
||||
public static bool HasIUD(this Pawn pawn)
|
||||
|
|
Loading…
Reference in New Issue