Example #1
0
        private bool GetIsFilterAvailableForEntries(IBestiaryEntryFilter filter, List <BestiaryEntry> entries)
        {
            bool?forcedDisplay = filter.ForcedDisplay;

            if (forcedDisplay.HasValue)
            {
                return(forcedDisplay.Value);
            }
            for (int i = 0; i < entries.Count; i++)
            {
                if (filter.FitsFilter(entries[i]) && entries[i].UIInfoProvider.GetEntryUICollectionInfo().UnlockState > BestiaryEntryUnlockState.NotKnownAtAll_0)
                {
                    return(true);
                }
            }
            return(false);
        }
Example #2
0
 public void SetupAvailabilityTest(List <BestiaryEntry> allAvailableEntries)
 {
     _filterAvailabilityTests.Clear();
     for (int i = 0; i < _filterer.AvailableFilters.Count; i++)
     {
         List <BestiaryEntry> list = new List <BestiaryEntry>();
         _filterAvailabilityTests.Add(list);
         IBestiaryEntryFilter bestiaryEntryFilter = _filterer.AvailableFilters[i];
         for (int j = 0; j < allAvailableEntries.Count; j++)
         {
             if (bestiaryEntryFilter.FitsFilter(allAvailableEntries[j]))
             {
                 list.Add(allAvailableEntries[j]);
             }
         }
     }
 }
 public void SetupAvailabilityTest(List <BestiaryEntry> allAvailableEntries)
 {
     this._filterAvailabilityTests.Clear();
     for (int index1 = 0; index1 < this._filterer.AvailableFilters.Count; ++index1)
     {
         List <BestiaryEntry> bestiaryEntryList = new List <BestiaryEntry>();
         this._filterAvailabilityTests.Add(bestiaryEntryList);
         IBestiaryEntryFilter availableFilter = this._filterer.AvailableFilters[index1];
         for (int index2 = 0; index2 < allAvailableEntries.Count; ++index2)
         {
             if (availableFilter.FitsFilter(allAvailableEntries[index2]))
             {
                 bestiaryEntryList.Add(allAvailableEntries[index2]);
             }
         }
     }
 }