private static void SaveCurrentState(List <Pawn> pawns)
        {
            int currentMap = Find.CurrentMap.uniqueID;

            //Save current state
            foreach (Pawn p in pawns)
            {
                //find colonist on the current zone in the current map
                RestrictLink link = RestrictManager.links.Find(
                    x => x.colonist.Equals(p) &&
                    x.zone == RestrictManager.GetActivePolicy().id&&
                    x.mapId == currentMap);

                if (link != null)
                {
                    //colonist found! save
                    link.area = p.playerSettings.AreaRestriction;
                }
                else
                {
                    //colonist not found. So add it to the RestrictLink list
                    RestrictManager.links.Add(
                        new RestrictLink(
                            RestrictManager.GetActivePolicy().id,
                            p,
                            p.playerSettings.AreaRestriction,
                            currentMap));
                }
            }
        }
        private static void PrintAllAssignPolicies()
        {
            Log.Message("[BPC] === List Policies START [" +
                        RestrictManager.policies.Count +
                        "] ===");
            foreach (Policy p in RestrictManager.policies)
            {
                Log.Message("[BPC]\t" + p.ToString());
            }

            Log.Message("[BPC] === List ActivePolices START [" +
                        RestrictManager.activePolicies.Count +
                        "] ===");
            foreach (MapActivePolicy m in RestrictManager.activePolicies)
            {
                Log.Message("[BPC]\t" + m.ToString());
            }

            Log.Message("[BPC] === List links START [" +
                        RestrictManager.links.Count +
                        "] ===");
            foreach (RestrictLink RestrictLink in RestrictManager.links)
            {
                Log.Message("[BPC]\t" + RestrictLink.ToString());
            }
        }
 public RestrictLink(RestrictLink link)
 {
     this.zone     = link.zone;
     this.colonist = link.colonist;
     this.area     = link.area;
     this.schedule = new List <TimeAssignmentDef>(link.schedule);
     this.mapId    = link.mapId;
 }
 private static void CleanDeadColonists(List <Pawn> pawns)
 {
     for (int i = 0; i < RestrictManager.links.Count; i++)
     {
         RestrictLink pawn = RestrictManager.links[i];
         if (!pawns.Contains(pawn.colonist))
         {
             if (pawn.colonist == null || pawn.colonist.Dead)
             {
                 RestrictManager.links.Remove(pawn);
             }
         }
     }
 }