static Pawn GeneratePartPowerProviderIfNeeded(Pawn __result) { var net = PawnPartPowerNet.Get(__result); if (net.Nodes.OfType <IPowerConsumer>().Any() && net.MaxRate <= 0) { __result.health.AddHediff(CyberizationDefOf.BionicEnergyCell, __result.RaceProps.body.corePart); } return(__result); }
private static IEnumerable <IPowerConsumer> PriorityOrder(Pawn pawn) { var result = PawnPartPowerNet.Get(pawn)?.Nodes.OfType <IPowerConsumer>().ToList(); if (result.NullOrEmpty()) { return(new List <IPowerConsumer>()); } result.Sort((left, right) => GetSorting(left).CompareTo(GetSorting(right))); return(result); }