mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Refactor IsDangerDay into a switch.
This commit is contained in:
parent
1a452cb120
commit
d5f87d0e45
3 changed files with 21 additions and 14 deletions
Binary file not shown.
|
@ -56,16 +56,20 @@ namespace RJW_Menstruation
|
||||||
{
|
{
|
||||||
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) return false;
|
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) return false;
|
||||||
|
|
||||||
if (curStage == Stage.Follicular || curStage == Stage.ClimactericFollicular) return true;
|
switch (curStage)
|
||||||
else if (curStage == Stage.Luteal || curStage == Stage.ClimactericLuteal)
|
|
||||||
{
|
{
|
||||||
if (!IsEggExist) return false;
|
case Stage.Follicular:
|
||||||
else return curStageHrs < Props.eggLifespanDays * 24;
|
case Stage.ClimactericFollicular:
|
||||||
}
|
case Stage.Ovulatory:
|
||||||
else if (curStage == Stage.Ovulatory) return true;
|
return true;
|
||||||
|
case Stage.Luteal:
|
||||||
|
case Stage.ClimactericLuteal:
|
||||||
|
return IsEggExist && curStageHrs < Props.eggLifespanDays * 24;
|
||||||
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -397,18 +397,21 @@ namespace RJW_Menstruation
|
||||||
{
|
{
|
||||||
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) return false;
|
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) return false;
|
||||||
|
|
||||||
if (curStage == Stage.Follicular || curStage == Stage.ClimactericFollicular)
|
switch (curStage)
|
||||||
{
|
{
|
||||||
if (curStageHrs > 0.7f * (follicularIntervalhours - bleedingIntervalhours)) return true;
|
case Stage.Follicular:
|
||||||
}
|
case Stage.ClimactericFollicular:
|
||||||
else if (curStage == Stage.Luteal || curStage == Stage.ClimactericLuteal)
|
return curStageHrs > 0.7f * (follicularIntervalhours - bleedingIntervalhours);
|
||||||
{
|
case Stage.Ovulatory:
|
||||||
if (curStageHrs < Props.eggLifespanDays * 24) return true;
|
return true;
|
||||||
}
|
case Stage.Luteal:
|
||||||
else if (curStage == Stage.Ovulatory) return true;
|
case Stage.ClimactericLuteal:
|
||||||
|
return curStageHrs < Props.eggLifespanDays * 24;
|
||||||
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public int GetNumofEggs
|
public int GetNumofEggs
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue