Exemplo 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());
     }
 }
Exemplo n.º 3
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();
 }
Exemplo n.º 4
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();
 }
Exemplo n.º 5
0
 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();
 }
Exemplo n.º 6
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();
        }
Exemplo n.º 7
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();
        }