internal static Policy GetPolicyAssignedTo(this Pawn eater, Pawn getter = null)
        {
#if DEBUG
            if (Config.debugNoPawnsRestricted)
            {
                return(Policies.Unrestricted);
            }
#endif
            if (getter == null)
            {
                getter = eater;
            }

            Policy policy = GetHardcodedPolicy(eater, getter);

            if (policy != null)
            {
                return(policy);
            }

            return(WorldDataStore_PawnPolicies.GetPawnEntry(eater));

            //nopolicy:

            //	Log.Warning("Found no active policy for " + eater + ". Using default policy.");
            //	return Policies.Unrestricted;
        }
        internal static void AssignToAllPawnsMatchingOnMap(Policy policy, Func <Pawn, bool> validator)
        {
            var map = Find.VisibleMap;

            var pawns = map.mapPawns.AllPawnsSpawned.Where(validator);

            foreach (var item in pawns)
            {
                WorldDataStore_PawnPolicies.SetPolicyForPawn(item, policy);
            }
        }
 public WorldDataStore_PawnPolicies()
 {
     SingleInstance = this;
 }