mirror of
				https://gitgud.io/lutepickle/rjw_menstruation.git
				synced 2024-08-14 22:46:52 +00:00 
			
		
		
		
	Slight refactor of RandomStage, be a bit cleaner
This commit is contained in:
		
							parent
							
								
									8e5487b3ba
								
							
						
					
					
						commit
						9ce08ceab8
					
				
					 1 changed files with 12 additions and 12 deletions
				
			
		| 
						 | 
					@ -1722,24 +1722,24 @@ namespace RJW_Menstruation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        protected Stage RandomStage()
 | 
					        protected Stage RandomStage()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            int rand = Rand.ElementByWeight(
 | 
					            Stage stage = Rand.ElementByWeight(
 | 
				
			||||||
                0, Props.follicularIntervalDays - Props.bleedingIntervalDays,
 | 
					                Stage.Follicular, Props.follicularIntervalDays - Props.bleedingIntervalDays,
 | 
				
			||||||
                1, Props.lutealIntervalDays,
 | 
					                Stage.Luteal, Props.lutealIntervalDays,
 | 
				
			||||||
                2, Props.bleedingIntervalDays);
 | 
					                Stage.Bleeding, Props.bleedingIntervalDays);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            switch (rand)
 | 
					            switch (stage)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                case 0:
 | 
					                case Stage.Follicular:
 | 
				
			||||||
                    curStageHrs = Rand.Range(0, (Props.follicularIntervalDays - Props.bleedingIntervalDays) * 24);
 | 
					                    curStageHrs = Rand.Range(0, (Props.follicularIntervalDays - Props.bleedingIntervalDays) * 24);
 | 
				
			||||||
                    return Stage.Follicular;
 | 
					                    break;
 | 
				
			||||||
                case 1:
 | 
					                case Stage.Luteal:
 | 
				
			||||||
                    curStageHrs = Rand.Range(0, Props.lutealIntervalDays * 24);
 | 
					                    curStageHrs = Rand.Range(0, Props.lutealIntervalDays * 24);
 | 
				
			||||||
                    return Stage.Luteal;
 | 
					                    break;
 | 
				
			||||||
                case 2:
 | 
					                case Stage.Bleeding:
 | 
				
			||||||
                    curStageHrs = Rand.Range(0, Props.bleedingIntervalDays * 24);
 | 
					                    curStageHrs = Rand.Range(0, Props.bleedingIntervalDays * 24);
 | 
				
			||||||
                    return Stage.Bleeding;
 | 
					                    break;
 | 
				
			||||||
                default: return Stage.Follicular;
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            return stage;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void CopyCycleProperties(HediffComp_Menstruation original)
 | 
					        public void CopyCycleProperties(HediffComp_Menstruation original)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue