예제 #1
0
        public SkillList GetItemsByName(string Name, bool CaseSensitive = true)
        {
            SkillList list = new SkillList();

            if (CaseSensitive)
            {
                foreach (StatList entry in this)
                {
                    if (String.Equals(entry.ResourceName, Name))
                    {
                        list.Add(entry);
                    }
                }
            }
            else
            {
                foreach (StatList entry in this)
                {
                    if (String.Equals(entry.ResourceName.ToLower(), Name.ToLower()))
                    {
                        list.Add(entry);
                    }
                }
            }

            return(list);
        }
예제 #2
0
        public SkillList GetItemsByPrefix(string Prefix, bool CaseSensitive = true)
        {
            SkillList list = new SkillList();

            if (Prefix == null)
            {
                return(list);
            }

            if (CaseSensitive)
            {
                // add matches
                foreach (StatList entry in this)
                {
                    if (entry.ResourceName != null && entry.ResourceName.IndexOf(Prefix) == 0)
                    {
                        list.Add(entry);
                    }
                }
            }
            else
            {
                // add matches
                foreach (StatList entry in this)
                {
                    if (entry.ResourceName != null && entry.ResourceName.ToLower().IndexOf(Prefix.ToLower()) == 0)
                    {
                        list.Add(entry);
                    }
                }
            }

            return(list);
        }