public bool TryRemoveWeapon(ThingDef def, SharedWeaponFilter filter, bool includeBioencoded, out ThingWithComps weapon)
 {
     if (this.StoredWeapons.TryGetValue(def, out LinkedList <ThingWithComps> l))
     {
         for (LinkedListNode <ThingWithComps> n = l.First; n != null; n = n.Next)
         {
             if (filter.Allows(n.Value))
             {
                 weapon = n.Value;
                 l.Remove(n);
                 return(true);
             }
         }
     }
     if (includeBioencoded)
     {
         if (this.StoredBioEncodedWeapons.TryGetValue(def, out l))
         {
             for (LinkedListNode <ThingWithComps> n = l.First; n != null; n = n.Next)
             {
                 if (filter.Allows(n.Value))
                 {
                     weapon = n.Value;
                     l.Remove(n);
                     return(true);
                 }
             }
         }
     }
     weapon = null;
     return(false);
 }
 public bool HasWeapon(SharedWeaponFilter filter, ThingDef def)
 {
     if (this.StoredWeapons.TryGetValue(def, out LinkedList <ThingWithComps> l))
     {
         if (l == null)
         {
             this.StoredWeapons.Remove(def);
         }
         else
         {
             foreach (ThingWithComps t in l)
             {
                 if (filter.Allows(t))
                 {
                     return(true);
                 }
             }
         }
     }
     // Do not include bio incoded here
     return(false);
 }