Minor Cleanups

This commit is contained in:
Vegapnk 2023-01-15 09:50:29 +01:00
parent 4cd77eba50
commit ba7b72b426
2 changed files with 11 additions and 10 deletions

View file

@ -1,11 +1,8 @@
using System;
using rjw;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using rjw;
using Verse;
using RimWorld;
namespace RJW_BGS
{
@ -44,6 +41,7 @@ namespace RJW_BGS
}).ToList<RaceGeneDef>();
if (pawnKindDefs.Count() > 0)
return pawnKindDefs;
List<RaceGeneDef> raceKindDefs = allDefs.Where(delegate (RaceGeneDef group)
{
List<string> raceNames = group.raceNames;
@ -51,6 +49,7 @@ namespace RJW_BGS
}).ToList<RaceGeneDef>();
if (raceKindDefs.Count() > 0)
return raceKindDefs;
List<RaceGeneDef> raceGroupDefs = new List<RaceGeneDef>();
if (raceGroupDef != null)
{
@ -60,8 +59,10 @@ namespace RJW_BGS
return raceGroupDefName != null && raceGroupDefName == raceGroupDef.defName;
}).ToList<RaceGeneDef>();
}
if (raceGroupDefs.Count() > 0)
return raceGroupDefs;
return new List<RaceGeneDef>();
}
}

View file

@ -102,17 +102,17 @@ namespace RJW_Genes
return !GetGenitaliaResizingGenes(pawn).NullOrEmpty();
}
public static List<Gene> GetGenitaliaResizingGenes(Pawn pawn)
public static List<Gene_GenitaliaResizingGene> GetGenitaliaResizingGenes(Pawn pawn)
{
var ResizingGenes = new List<Gene>();
var ResizingGenes = new List<Gene_GenitaliaResizingGene>();
// Error Handling: Issue with Pawn or Genes return empty.
if (pawn == null || pawn.genes == null)
return ResizingGenes;
foreach (Gene g in pawn.genes.GenesListForReading)
if (g is Gene_GenitaliaResizingGene)
ResizingGenes.Add(g);
foreach (Gene gene in pawn.genes.GenesListForReading)
if (gene is Gene_GenitaliaResizingGene resizing_gene)
ResizingGenes.Add(resizing_gene);
return ResizingGenes;
}