public ItemGroupVM(string name, ItemSlotVM slot) { Name = name; var items = new List <ItemVM>(); var searchText = ""; if (VM.Instance.Game != null) { searchText = VM.Instance.Game.ItemSearchText; } foreach (XmlItem xml in XmlData.Current.Items) { if (searchText.Length >= MIN_ITEM_TEXT_SEARCH_LENGTH && !xml.Name.ToLower().Contains(searchText) && !xml.ID.ToLower().Contains(searchText)) { continue; } if (xml.Type == name) { items.Add(new ItemVM(slot, xml)); } } //sort items if (items.Count > 1) { items.Sort(); } Items = new UpdatableCollection <ItemVM>(items); }
public ItemGroupVM(string name, ItemSlotVM slot) { Name = name; var items = new List <ItemVM>(); var searchText = ""; if (VM.Instance.Game != null) { searchText = VM.Instance.Game.ItemSearchText; } //we made this easier now foreach (XmlItemGroup type in XmlData.Current.ItemGroups) { if (type.Name == name) { //only add items from this item set into the group foreach (XmlItem xml in type.Items) { //skip items that do not match the search string if (searchText.Length >= MIN_ITEM_TEXT_SEARCH_LENGTH && !xml.Name.ToLower().Contains(searchText) && !xml.ID.ToLower().Contains(searchText)) { continue; } //add the item to the item group items.Add(new ItemVM(slot, xml)); } } } //sort items if (items.Count > 1) { items.Sort(); } Items = new UpdatableCollection <ItemVM>(items); }
public ItemGroupVM(string name, ItemSlotVM slot) { Name = name; var items = new List <ItemVM>(); foreach (XmlItem xml in XmlData.Current.Items) { //xmlitem.Type if (xml.Type == name) { items.Add(new ItemVM(slot, xml)); } } //sort items if (items.Count > 1) { items.Sort(); } Items = new UpdatableCollection <ItemVM>(items); }
public ItemVM(ItemSlotVM slot, XmlItem item) { _slot = slot; _xml = item; SetName(); }
public ItemVM(ItemSlotVM slot, XmlItem item) { _slot = slot; Xml = item; }