Exemplo n.º 1
0
 internal Item[] GetRelevantItemsInternal(CalculationsBase model, Character character, bool ignoreFilters = false)
 {
     List<Item> itemList = new List<Item>(AllItems).FindAll(new Predicate<Item>(
         delegate(Item item) {
             return model.IsItemRelevant(item) // Model Relevance
                 && (ignoreFilters || ItemFilter.IsItemRelevant(model, item)) // Filters Relevance
                 && (character == null || item.FitsFaction(character.Race)) // Faction Relevance
                 && (character == null || character.ItemMatchesiLvlCheck(item))  // iLvl check from UI Filter (non-tree)
                 && (character == null || character.ItemMatchesBindCheck(item))  // Bind check from UI Filter (non-tree)
                 && (character == null || character.ItemMatchesProfCheck(item))  // Prof check from UI Filter (non-tree)
                 && (character == null || character.ItemMatchesDropCheck(item)); // Drop check from UI Filter (non-tree)
         }));
     return itemList.ToArray();
 }
Exemplo n.º 2
0
 private void CacheRelevantItems(CalculationsBase model, Character character, bool ignoreFilters = false)
 {
     List<Item> itemList = new List<Item>(AllItems).FindAll(new Predicate<Item>(
         delegate(Item item)
         {
             return model.IsItemRelevant(item) // Model Relevance
                 && item.FitsFaction(character.Race) // Faction Relevance
                 && (ignoreFilters || ItemFilter.IsItemRelevant(model, item)) // Filters Relevance
                 && character.ItemMatchesiLvlCheck(item)  // iLvl check from UI Filter (non-tree)
                 && character.ItemMatchesBindCheck(item)  // Bind check from UI Filter (non-tree)
                 && character.ItemMatchesProfCheck(item)  // Prof check from UI Filter (non-tree)
                 && character.ItemMatchesDropCheck(item); // Drop check from UI Filter (non-tree)
         }));
     cachedRelevantItems = itemList.ToArray();
     List<Optimizer.SuffixItem> suffixItemList = new List<Optimizer.SuffixItem>();
     foreach (var item in cachedRelevantItems)
     {
         if (item.AllowedRandomSuffixes == null || item.AllowedRandomSuffixes.Count == 0)
         {
             suffixItemList.Add(new Optimizer.SuffixItem() { Item = item, RandomSuffixId = 0 });
         }
         else
         {
             foreach (var suffix in item.AllowedRandomSuffixes)
             {
                 suffixItemList.Add(new Optimizer.SuffixItem() { Item = item, RandomSuffixId = suffix });
             }
         }
     }
     cachedRelevantSuffixItems = suffixItemList.ToArray();
     lastModel = model;
     lastRace = character.Race;
 }