Example #1
0
        private bool IsSearchMatch(Item i, string txt)
        {
            var local    = new List <ItemAttributes.Attribute>();
            var nonlocal = new List <ItemAttributes.Attribute>();

            ItemAttributes.LoadItem(i, local, nonlocal);

            List <string> modstrings = new List <string>()
            {
                i.BaseType,
                i.FlavourText,
                i.Name,
            };

            modstrings.AddRange(local.Select(a => a.ValuedAttribute));
            modstrings.AddRange(nonlocal.Select(a => a.ValuedAttribute));

            modstrings = modstrings.Distinct().ToList();

            return(modstrings.Any(s => s != null && s.ToLower().Contains(txt)));
        }