Esempio n. 1
0
 private List <Description> GetComparisonValues()
 {
     if (SelectedValue == null || SelectedValue.ID == 0)
     {
         return(ItemsHolder
                .GetResultWithoutFilter(this)
                .Where(s => s.Sources != null)
                .SelectMany(s => s.Sources)
                .SelectMany(s => s.Additionals)
                .Select(s => s.Text)
                .Distinct()
                .Concat(new[] { new Description(0) })
                .OrderBy(o => o.CurrentLang)
                .ToList());
     }
     else
     {
         return(ItemsHolder
                .GetResultWithoutFilter(this)
                .Where(s => s.Sources != null)
                .SelectMany(s => s.Sources)
                .Where(s => s.Text.Equals(SelectedValue))
                .SelectMany(s => s.Additionals)
                .Select(s => s.Text)
                .Distinct()
                .Concat(new[] { new Description(0) })
                .OrderBy(o => o.CurrentLang)
                .ToList());
     }
 }
 private IEnumerable <string> GetValues()
 {
     if (String.IsNullOrEmpty(ItemsHolder.StandardFilters["Sources"].SelectedValue as string))
     {
         return(ItemsHolder
                .GetResultWithoutFilter(this)
                .SelectMany(s => s.Sources)
                .SelectMany(s => s.Additionals)
                .Select(s => s.Text.CurrentLang)
                .Distinct()
                .Where(l => !string.IsNullOrWhiteSpace(l))
                .Concat(new[] { string.Empty })
                .OrderBy(o => o)
                .ToList());
     }
     else
     {
         return(ItemsHolder
                .GetResultWithoutFilter(this)
                .SelectMany(s => s.Sources)
                .Where(s => s.Text.CurrentLang == ItemsHolder.StandardFilters["Sources"].SelectedValue)
                .SelectMany(s => s.Additionals)
                .Select(s => s.Text.CurrentLang)
                .Distinct()
                .Where(l => !string.IsNullOrWhiteSpace(l))
                .Concat(new[] { string.Empty })
                .OrderBy(o => o)
                .ToList());
     }
 }
Esempio n. 3
0
 public OrderFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
     if (AssetProvider.CountMode)
     {
         values.Add(new Description(22440));
     }
     CurrentValues = values;
     SelectedValue = values.FirstOrDefault();
 }
 public override void SetCurrenValues()
 {
     ComparisonValues = ItemsHolder
                        .GetResultWithoutFilter(this)
                        .Select(s => s.ReleaseVersion)
                        .Distinct()
                        .Where(l => !string.IsNullOrWhiteSpace(l))
                        .Concat(new[] { string.Empty })
                        .OrderBy(o => o)
                        .ToList();
 }
Esempio n. 5
0
 public override void SetCurrenValues()
 {
     CurrentValues = ItemsHolder
                     .GetResultWithoutFilter(this)
                     .SelectMany(s => s.EffectTargets)
                     .Select(s => s.Text)
                     .Distinct()
                     .Concat(new[] { new Description(0) })
                     .OrderBy(o => o.CurrentLang)
                     .ToList();
 }
Esempio n. 6
0
 public override void SetCurrenValues()
 {
     CurrentValues = ItemsHolder
                     .GetResultWithoutFilter(this)
                     .Where(s => s.Allocation?.Text != null)
                     .Select(s => s.Allocation.Text)
                     .Distinct()
                     .Concat(new[] { new Description(0) })
                     .OrderBy(o => o.CurrentLang)
                     .ToList();
 }
Esempio n. 7
0
 public FilterHolder(ItemsHolder holder)
 {
     Filters.Add(new UpgradesFilter(holder));
     Filters.Add(new SourcesFilter(holder));
     Filters.Add(new ItemTypesFilter(holder));
     Filters.Add(new TargetsFilter(holder));
     Filters.Add(new ReleaseVersionsFilter(holder));
     Filters.Add(new RaritiesFilter(holder));
     Filters.Add(new AvailableFilter(holder)
     {
         SelectedValue = true
     });
     Filters.Add(new EquippedFilter(holder));
     Filters.Add(new SearchTextFilter(holder));
     Filters.Add(new TargetBuildingFilter(holder));
 }
Esempio n. 8
0
        public override void SetCurrenValues()
        {
            CurrentValues = ItemsHolder
                            .GetResultWithoutFilter(this)
                            .Where(s => s.Rarity != null)
                            .Select(s => s.Rarity)
                            .Distinct()
                            .Concat(new[] { new Description(0) })
                            .OrderBy(o => o.ID, RarityComparer.Default)
                            .ToList();

            ComparisonValues = ItemsHolder
                               .GetResultWithoutFilter(this)
                               .Where(s => s.Rarity != null)
                               .Select(s => s.Rarity)
                               .Distinct()
                               .Concat(new[] { new Description(0) })
                               .OrderBy(o => o.ID, RarityComparer.Default)
                               .ToList();
        }
Esempio n. 9
0
        public override void SetCurrenValues()
        {
            var items = ItemsHolder.GetResultWithoutFilter(this).ToList();

            CurrentValues = items
                            .SelectMany(s => s.AllUpgrades)
                            .Select(s => s.Text)
                            .Distinct()
                            .Concat(new[] { new Description(0) })
                            .OrderBy(o => o.CurrentLang)
                            .ToList();

            var upgrades = items.SelectMany(s => s.AllUpgrades.Where(u => u.Text.Equals(SelectedValue)).ToList());

            var list = (new[] { new Description(0) }).Concat(upgrades
                                                             .Where(u => !string.IsNullOrWhiteSpace(u.Value))
                                                             .Select(u => new DummyDescription(u.Value))
                                                             .Distinct()
                                                             .OrderBy(o => float.Parse(o.CurrentLang.TrimEnd(' ', '%').Replace(":", "").Replace("/", "").Replace(" ", ""))));

            if (!list.Skip(1).Any())
            {
                list = (new[] { new Description(0) }).Concat(upgrades
                                                             .SelectMany(u => u.Additionals ?? Enumerable.Empty <Upgrade>()).Select(a => a.Text)
                                                             .Distinct()
                                                             .OrderBy(o => o.CurrentLang));
            }

            if (!list.Skip(1).Any())
            {
                list = (new[] { new Description(0) }).Concat(upgrades
                                                             .Where(u => u.Text.AdditionalInformation != null)
                                                             .Select(u => u.Text.AdditionalInformation)
                                                             .Distinct()
                                                             .OrderBy(o => o.CurrentLang));
            }

            ComparisonValues = list.ToList();
        }
 public AdvancedSearchTextFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
     FilterType     = FilterType.Selection;
     ComparisonType = FilterType.Text;
 }
 public SpecificUpgradesFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
     ComparisonType = FilterType.Selection;
 }
Esempio n. 12
0
 public OrderFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
     CurrentValues = values;
     SelectedValue = values.FirstOrDefault();
 }
Esempio n. 13
0
 public RollableFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
     FilterType = FilterType.Bool;
 }
Esempio n. 14
0
 protected BaseFilter(ItemsHolder itemsHolder)
 {
     ItemsHolder = itemsHolder;
     SetCurrenValues();
 }
 public ExpeditionAttributeFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
     ComparisonType = FilterType.Selection;
 }
Esempio n. 16
0
 public TargetBuildingFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
     ComparisonType = FilterType.Selection;
 }
Esempio n. 17
0
 public SearchTextFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
     FilterType = FilterType.Text;
 }
Esempio n. 18
0
 public ReleaseVersionsFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
     FilterType     = FilterType.None;
     ComparisonType = FilterType.Selection;
 }
Esempio n. 19
0
 public ItemTypesFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
 }
Esempio n. 20
0
 public TargetBuildingFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
 }
Esempio n. 21
0
 public EquippedFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
     ComparisonType = FilterType.Selection;
 }
Esempio n. 22
0
 public EquippedFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
 }
Esempio n. 23
0
 public RaritiesFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
     ComparisonType = FilterType.Selection;
     FilterType     = FilterType.None;
 }
Esempio n. 24
0
 public SourcesFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
     ComparisonType = FilterType.Selection;
 }
 public DetailedSourcesFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
 }
Esempio n. 26
0
 protected BaseFilter(ItemsHolder itemsHolder)
 {
     ItemsHolder = itemsHolder;
 }
Esempio n. 27
0
 public TargetsFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
 }
Esempio n. 28
0
 public OrderFilter(ItemsHolder itemsHolder) : base(itemsHolder)
 {
     SelectedValue = values[0].CurrentLang;
 }