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 (curStage == Stage.Follicular || curStage == Stage.ClimactericFollicular) return true;
 | 
			
		||||
                else if (curStage == Stage.Luteal || curStage == Stage.ClimactericLuteal)
 | 
			
		||||
                switch (curStage)
 | 
			
		||||
                {
 | 
			
		||||
                    if (!IsEggExist) return false;
 | 
			
		||||
                    else return curStageHrs < Props.eggLifespanDays * 24;
 | 
			
		||||
                }
 | 
			
		||||
                else if (curStage == Stage.Ovulatory) return true;
 | 
			
		||||
                    case Stage.Follicular:
 | 
			
		||||
                    case Stage.ClimactericFollicular:
 | 
			
		||||
                    case Stage.Ovulatory:
 | 
			
		||||
                        return true;
 | 
			
		||||
                    case Stage.Luteal:
 | 
			
		||||
                    case Stage.ClimactericLuteal:
 | 
			
		||||
                        return IsEggExist && curStageHrs < Props.eggLifespanDays * 24;
 | 
			
		||||
                    default:
 | 
			
		||||
                        return false;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -397,18 +397,21 @@ namespace RJW_Menstruation
 | 
			
		|||
            {
 | 
			
		||||
                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;
 | 
			
		||||
                }
 | 
			
		||||
                else if (curStage == Stage.Luteal || curStage == Stage.ClimactericLuteal)
 | 
			
		||||
                {
 | 
			
		||||
                    if (curStageHrs < Props.eggLifespanDays * 24) return true;
 | 
			
		||||
                }
 | 
			
		||||
                else if (curStage == Stage.Ovulatory) return true;
 | 
			
		||||
                    case Stage.Follicular:
 | 
			
		||||
                    case Stage.ClimactericFollicular:
 | 
			
		||||
                        return curStageHrs > 0.7f * (follicularIntervalhours - bleedingIntervalhours);
 | 
			
		||||
                    case Stage.Ovulatory:
 | 
			
		||||
                        return true;
 | 
			
		||||
                    case Stage.Luteal:
 | 
			
		||||
                    case Stage.ClimactericLuteal:
 | 
			
		||||
                        return curStageHrs < Props.eggLifespanDays * 24;
 | 
			
		||||
                    default:
 | 
			
		||||
                        return false;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        public int GetNumofEggs
 | 
			
		||||
        {
 | 
			
		||||
            get
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue