28 lines
966 B
C#
28 lines
966 B
C#
using AnimalGenetics;
|
|
using Verse;
|
|
|
|
namespace RJW_Menstruation
|
|
{
|
|
public static class AnimalGeneticsCompatibility
|
|
{
|
|
public static void PreBirth(Pawn mother, Pawn father, Hediff pregnancy)
|
|
{
|
|
GeneticInformation motherGeneticInformation = mother?.AnimalGenetics();
|
|
GeneticInformation fatherGeneticInformation = father?.AnimalGenetics();
|
|
|
|
if (fatherGeneticInformation == null && motherGeneticInformation != null)
|
|
{
|
|
FatherGeneticInformation fatherGeneticInformationComp = pregnancy.TryGetComp<FatherGeneticInformation>();
|
|
fatherGeneticInformation = fatherGeneticInformationComp?.GeneticInformation;
|
|
}
|
|
|
|
ParentReferences.Push(new ParentReferences.Record { Mother = motherGeneticInformation, Father = fatherGeneticInformation });
|
|
}
|
|
|
|
public static void PostBirth()
|
|
{
|
|
ParentReferences.Pop();
|
|
}
|
|
}
|
|
}
|