using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Verse; using HarmonyLib; namespace RJWSexperience { [StaticConstructorOnStartup] public static class DefInjection { static DefInjection() { InjectRaces(); } private static void InjectRaces() { List PawnDefs = DefDatabase.AllDefs.Where(x => x.race != null).ToList(); InjectComp(PawnDefs); } private static void InjectComp(List PawnDefs) { CompProperties comp = new CompProperties(typeof(SexPartnerHistory)); if (!PawnDefs.NullOrEmpty()) foreach(ThingDef def in PawnDefs) { def.comps.Add(comp); } } } }