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,14 +56,18 @@ 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:
 | 
				
			||||||
 | 
					                        return true;
 | 
				
			||||||
 | 
					                    case Stage.Luteal:
 | 
				
			||||||
 | 
					                    case Stage.ClimactericLuteal:
 | 
				
			||||||
 | 
					                        return IsEggExist && curStageHrs < Props.eggLifespanDays * 24;
 | 
				
			||||||
 | 
					                    default:
 | 
				
			||||||
 | 
					                        return false;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else if (curStage == Stage.Ovulatory) return true;
 | 
					 | 
				
			||||||
                return false;
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -397,16 +397,19 @@ 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:
 | 
				
			||||||
 | 
					                        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;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else if (curStage == Stage.Luteal || curStage == Stage.ClimactericLuteal)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    if (curStageHrs < Props.eggLifespanDays * 24) return true;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                else if (curStage == Stage.Ovulatory) return true;
 | 
					 | 
				
			||||||
                return false;
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public int GetNumofEggs
 | 
					        public int GetNumofEggs
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue