コード例 #1
0
 public bool AncestorIsImplant(BodyPartRecord record, CustomPawn pawn)
 {
     foreach (BodyPartRecord ancestor in bodyPartAncestors[record])
     {
         if (pawn.IsImplantedPart(ancestor))
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #2
0
        protected void ResetBodyPartEnabledState(IEnumerable <BodyPartRecord> parts, CustomPawn pawn)
        {
            disabledBodyParts.Clear();
            ImplantManager implantManager = PrepareCarefully.Instance.HealthManager.ImplantManager;

            foreach (var part in parts)
            {
                if (pawn.IsImplantedPart(part) || implantManager.AncestorIsImplant(pawn, part))
                {
                    disabledBodyParts.Add(part);
                }
            }
        }