コード例 #1
0
 internal static void Postfix(Thing __result)
 {
     if (droppedAndStorage != null)
     {
         foreach (KeyValuePair <Thing, Building_InfiniteStorage> kv in droppedAndStorage)
         {
             if (kv.Key != __result)
             {
                 Building_InfiniteStorage storage = kv.Value;
                 storage.Add(kv.Key);
             }
         }
         droppedAndStorage.Clear();
     }
 }
コード例 #2
0
            internal static void Postfix(List <Thing> __result)
            {
                if (droppedAndStorage != null && __result != null)
                {
                    HashSet <Thing> results = new HashSet <Thing>();
                    foreach (Thing t in __result)
                    {
                        results.Add(t);
                    }

                    foreach (KeyValuePair <Thing, Building_InfiniteStorage> kv in droppedAndStorage)
                    {
                        if (!results.Contains(kv.Key))
                        {
                            Building_InfiniteStorage storage = kv.Value;
                            storage.Add(kv.Key);
                        }
                    }
                    results.Clear();
                    results = null;
                    droppedAndStorage.Clear();
                }
            }