Пример #1
0
        private bool tagCollectionMatchesCategory(TagsArray collection)
        {
            if (collection.TagDefinitions.Length > 0)
            {
                int num = Categories.Length;
                for (int i = 0; i < num; i++)
                {
                    bool flag = collection.ContainsCategory(Categories[i]);
                    switch (MatchType)
                    {
                    case MatchType.ALL:
                        if (!flag)
                        {
                            return(false);
                        }
                        break;

                    case MatchType.ANY:
                        if (flag)
                        {
                            return(true);
                        }
                        break;
                    }
                }
                return(defaultMatchingValue(MatchType));
            }
            return(false);
        }
Пример #2
0
 public void SetTags(TagDefinition[][] definitions)
 {
     Data = new TagsArray[definitions.Length];
     for (int i = 0; i < definitions.Length; i++)
     {
         ref TagsArray reference = ref Data[i];
         reference = new TagsArray(definitions[i]);
     }
Пример #3
0
        private TagsArray[] getTagCollection(DCustomEquipment equipment)
        {
            List <TagDefinition[]> list = new List <TagDefinition[]>();

            TagDefinition[] equipmentTags = Service.Get <TagsManager>().GetEquipmentTags(equipment);
            if (equipmentTags.Length == 0)
            {
                return(new TagsArray[0]);
            }
            list.Add(equipmentTags);
            TagsArray[] array = new TagsArray[list.Count];
            int         num   = array.Length;

            for (int i = 0; i < num; i++)
            {
                array[i].TagDefinitions = list[i];
            }
            return(array);
        }