Tibialyzer.Hunt.AddUsedItems C# (CSharp) Method

AddUsedItems() public method

public AddUsedItems ( Dictionary newItems ) : bool
newItems Dictionary
return bool
        public bool AddUsedItems(Dictionary<string, Dictionary<string, HashSet<int>>> newItems)
        {
            bool newValues = false;
            lock (huntLock) {
                foreach (var val in newItems) {
                    Item item = StorageManager.getItem(val.Key);
                    if (item == null) continue;
                    if (!this.usedItems.ContainsKey(item)) {
                        this.usedItems.Add(item, new OrderedHashSetCollection());
                    }
                    var collection = this.usedItems[item];

                    int currentCount = collection.GetItemCount();
                    collection.UpdateHashSet(val.Value);
                    if (collection.GetItemCount() > currentCount) {
                        newValues = true;
                    }
                }
                if (newValues) {
                    LootDatabaseManager.UpdateUsedItems(this);
                }
            }
            return newValues;
        }

Same methods

Hunt::AddUsedItems ( int>.List items ) : void

Usage Example

Example #1
0
        public static void AddUsedItems(Hunt hunt, Dictionary <string, Dictionary <string, HashSet <int> > > usedItems)
        {
            bool newValues = hunt.AddUsedItems(usedItems);

            if (newValues)
            {
                GlobalDataManager.UpdateUsedItems();
            }
        }
All Usage Examples Of Tibialyzer.Hunt::AddUsedItems