mirror of
				https://gitgud.io/lutepickle/rjw_menstruation.git
				synced 2024-08-14 22:46:52 +00:00 
			
		
		
		
	Little refactor in GetBabyInfo and GetFatherInfo
This commit is contained in:
		
							parent
							
								
									02b0045fb3
								
							
						
					
					
						commit
						56b11069da
					
				
					 1 changed files with 2 additions and 4 deletions
				
			
		| 
						 | 
					@ -20,9 +20,8 @@ namespace RJW_Menstruation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            StringBuilder res = new StringBuilder();
 | 
					            StringBuilder res = new StringBuilder();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            IEnumerable<Pawn> babiesdistinct = babies.Distinct(new RaceComparer());
 | 
					 | 
				
			||||||
            int iteration = 0;
 | 
					            int iteration = 0;
 | 
				
			||||||
            foreach (Pawn baby in babiesdistinct)
 | 
					            foreach (Pawn baby in babies.Distinct(new RaceComparer()))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                int num = babies.Where(x => x.def.Equals(baby.def)).Count();
 | 
					                int num = babies.Where(x => x.def.Equals(baby.def)).Count();
 | 
				
			||||||
                if (iteration > 0) res.Append(", ");
 | 
					                if (iteration > 0) res.Append(", ");
 | 
				
			||||||
| 
						 | 
					@ -43,9 +42,8 @@ namespace RJW_Menstruation
 | 
				
			||||||
            if (!is_parent_known && Configurations.InfoDetail != Configurations.DetailLevel.All)
 | 
					            if (!is_parent_known && Configurations.InfoDetail != Configurations.DetailLevel.All)
 | 
				
			||||||
                return res.Append(Translations.Dialog_FatherUnknown).ToString();
 | 
					                return res.Append(Translations.Dialog_FatherUnknown).ToString();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            IEnumerable<Pawn> babiesdistinct = babies.Distinct(new FatherComparer(mother));
 | 
					 | 
				
			||||||
            int iteration = 0;
 | 
					            int iteration = 0;
 | 
				
			||||||
            foreach (Pawn baby in babiesdistinct)
 | 
					            foreach (Pawn baby in babies.Distinct(new FatherComparer(mother)))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                if (iteration > 0) res.Append(", ");
 | 
					                if (iteration > 0) res.Append(", ");
 | 
				
			||||||
                res.Append(Utility.GetFather(baby, mother)?.LabelShort ?? Translations.Dialog_FatherUnknown);
 | 
					                res.Append(Utility.GetFather(baby, mother)?.LabelShort ?? Translations.Dialog_FatherUnknown);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue