예제 #1
0
        public static IEnumerable <Rule> RulesForPawn(string pawnSymbol, Pawn pawn, Dictionary <string, string> constants = null, bool addRelationInfoSymbol = true, bool addTags = true)
        {
            if (pawn == null)
            {
                Log.ErrorOnce($"Tried to insert rule {pawnSymbol} for null pawn", 16015097);
                return(Enumerable.Empty <Rule>());
            }
            TaggedString text = "";

            if (addRelationInfoSymbol)
            {
                PawnRelationUtility.TryAppendRelationsWithColonistsInfo(ref text, pawn);
            }
            return(RulesForPawn(pawnSymbol, pawn.Name, (pawn.story != null) ? pawn.story.Title : null, pawn.kindDef, pawn.gender, pawn.Faction, pawn.ageTracker.AgeBiologicalYears, pawn.ageTracker.AgeChronologicalYears, text, PawnUtility.EverBeenColonistOrTameAnimal(pawn), PawnUtility.EverBeenQuestLodger(pawn), pawn.Faction != null && pawn.Faction.leader == pawn, (pawn.royalty != null) ? pawn.royalty.AllTitlesForReading : null, constants, addTags));
        }