Exemple #1
0
        private static IEnumerable <string> GetAllRequiredApparelPerGroup(Pawn p)
        {
            if (p.royalty == null || !p.royalty.allowApparelRequirements)
            {
                yield break;
            }
            foreach (RoyalTitle t in p.royalty.AllTitlesInEffectForReading)
            {
                if (t.def.requiredApparel == null || t.def.requiredApparel.Count <= 0)
                {
                    continue;
                }
                for (int i = 0; i < t.def.requiredApparel.Count; i++)
                {
                    RoyalTitleDef.ApparelRequirement apparelRequirement = t.def.requiredApparel[i];
                    if (apparelRequirement.IsMet(p))
                    {
                        continue;
                    }
                    IEnumerable <ThingDef> enumerable = apparelRequirement.AllRequiredApparelForPawn(p);
                    foreach (ThingDef item in enumerable)
                    {
                        yield return(item.LabelCap);
                    }
                }
            }
            yield return("ApparelRequirementAnyPrestigeArmor".Translate());

            yield return("ApparelRequirementAnyPsycasterApparel".Translate());
        }
        private static IEnumerable <string> GetFirstRequiredApparelPerGroup(Pawn p)
        {
            if (p.royalty != null && p.royalty.allowApparelRequirements)
            {
                foreach (RoyalTitle t in p.royalty.AllTitlesInEffectForReading)
                {
                    if (t.def.requiredApparel != null && t.def.requiredApparel.Count > 0)
                    {
                        for (int i = 0; i < t.def.requiredApparel.Count; i++)
                        {
                            RoyalTitleDef.ApparelRequirement apparelRequirement = t.def.requiredApparel[i];
                            if (!apparelRequirement.IsMet(p))
                            {
                                yield return(apparelRequirement.AllRequiredApparelForPawn(p).First().LabelCap);
                            }
                        }
                    }
                }
                yield return("ApparelRequirementAnyPrestigeArmor".Translate());

                yield return("ApparelRequirementAnyPsycasterApparel".Translate());
            }
        }