mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Minor Cleanups
This commit is contained in:
parent
4cd77eba50
commit
ba7b72b426
2 changed files with 11 additions and 10 deletions
|
@ -1,11 +1,8 @@
|
||||||
using System;
|
using rjw;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using rjw;
|
|
||||||
using Verse;
|
using Verse;
|
||||||
using RimWorld;
|
|
||||||
|
|
||||||
namespace RJW_BGS
|
namespace RJW_BGS
|
||||||
{
|
{
|
||||||
|
@ -44,6 +41,7 @@ namespace RJW_BGS
|
||||||
}).ToList<RaceGeneDef>();
|
}).ToList<RaceGeneDef>();
|
||||||
if (pawnKindDefs.Count() > 0)
|
if (pawnKindDefs.Count() > 0)
|
||||||
return pawnKindDefs;
|
return pawnKindDefs;
|
||||||
|
|
||||||
List<RaceGeneDef> raceKindDefs = allDefs.Where(delegate (RaceGeneDef group)
|
List<RaceGeneDef> raceKindDefs = allDefs.Where(delegate (RaceGeneDef group)
|
||||||
{
|
{
|
||||||
List<string> raceNames = group.raceNames;
|
List<string> raceNames = group.raceNames;
|
||||||
|
@ -51,6 +49,7 @@ namespace RJW_BGS
|
||||||
}).ToList<RaceGeneDef>();
|
}).ToList<RaceGeneDef>();
|
||||||
if (raceKindDefs.Count() > 0)
|
if (raceKindDefs.Count() > 0)
|
||||||
return raceKindDefs;
|
return raceKindDefs;
|
||||||
|
|
||||||
List<RaceGeneDef> raceGroupDefs = new List<RaceGeneDef>();
|
List<RaceGeneDef> raceGroupDefs = new List<RaceGeneDef>();
|
||||||
if (raceGroupDef != null)
|
if (raceGroupDef != null)
|
||||||
{
|
{
|
||||||
|
@ -60,8 +59,10 @@ namespace RJW_BGS
|
||||||
return raceGroupDefName != null && raceGroupDefName == raceGroupDef.defName;
|
return raceGroupDefName != null && raceGroupDefName == raceGroupDef.defName;
|
||||||
}).ToList<RaceGeneDef>();
|
}).ToList<RaceGeneDef>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (raceGroupDefs.Count() > 0)
|
if (raceGroupDefs.Count() > 0)
|
||||||
return raceGroupDefs;
|
return raceGroupDefs;
|
||||||
|
|
||||||
return new List<RaceGeneDef>();
|
return new List<RaceGeneDef>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,17 +102,17 @@ namespace RJW_Genes
|
||||||
return !GetGenitaliaResizingGenes(pawn).NullOrEmpty();
|
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.
|
// Error Handling: Issue with Pawn or Genes return empty.
|
||||||
if (pawn == null || pawn.genes == null)
|
if (pawn == null || pawn.genes == null)
|
||||||
return ResizingGenes;
|
return ResizingGenes;
|
||||||
|
|
||||||
foreach (Gene g in pawn.genes.GenesListForReading)
|
foreach (Gene gene in pawn.genes.GenesListForReading)
|
||||||
if (g is Gene_GenitaliaResizingGene)
|
if (gene is Gene_GenitaliaResizingGene resizing_gene)
|
||||||
ResizingGenes.Add(g);
|
ResizingGenes.Add(resizing_gene);
|
||||||
|
|
||||||
return ResizingGenes;
|
return ResizingGenes;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue