public static bool RemoveAllDesignationsOn(DesignationManager __instance, Thing t, bool standardCanceling = false)
        {
            bool matchFound = false;

            for (int index = 0; index < __instance.allDesignations.Count; ++index)
            {
                Designation designation = __instance.allDesignations[index];
                if ((!standardCanceling || designation.def.designateCancelable) && designation.target.Thing == t)
                {
                    designation.Notify_Removing();
                    matchFound = true;
                }
            }
            if (!matchFound)
            {
                return(false);
            }
            lock (__instance)
            {
                List <Designation> newAllDesignations = new List <Designation>(__instance.allDesignations);
                newAllDesignations.RemoveAll(d => (!standardCanceling || d.def.designateCancelable) && d.target.Thing == t);
                __instance.allDesignations = newAllDesignations;
            }

            return(false);
        }
        public static bool RemoveDesignation(DesignationManager __instance, Designation des)
        {
            des.Notify_Removing();
            if (!__instance.allDesignations.Contains(des))
            {
                return(false);
            }

            lock (__instance)
            {
                List <Designation> newAllDesignations = new List <Designation>(__instance.allDesignations);
                newAllDesignations.Remove(des);
                __instance.allDesignations = newAllDesignations;
            }
            return(false);
        }