public ItemFilter ToItemFilter() { var items = this.ItemsList .Where(sic => sic.IsSelected != false) .SelectMany(sic => sic.Items.Where(sii => sii.IsSelected == true)) .Select(sii => sii.Value); ItemIDMask im = null; if (items.Any()) { im = new ItemIDMask(items); } ItemCategoryMask icm = null; //if (itemCats.Any()) // icm = new ItemCategoryMask(itemCats); MaterialIDMask mim = null; //if (this.MaterialIDs.Any()) // mim = new MaterialIDMask(this.MaterialIDs); MaterialCategoryMask mcm = null; //if (this.MaterialCategories.Any()) // mcm = new MaterialCategoryMask(this.MaterialCategories); return(new ItemFilter(im, icm, mim, mcm)); }
public BuildOrder ToBuildOrder() { var numMaterials = this.BuildableItem.FixedBuildMaterials.Count; var filters = new IItemFilter[numMaterials]; for (int idx = 0; idx < numMaterials; ++idx) { var itemIDs = this.BuildMaterialsView[idx].ItemIDs.Where(i => i.IsSelected).Select(i => i.Value).ToArray(); var materialIDs = this.BuildMaterialsView[idx].MaterialIDs.Where(i => i.IsSelected).Select(i => i.Value).ToArray(); ItemIDMask im = null; if (itemIDs.Any()) { im = new ItemIDMask(itemIDs); } MaterialIDMask mim = null; if (materialIDs.Any()) { mim = new MaterialIDMask(materialIDs); } filters[idx] = new ItemFilter(im, null, mim, null); } var bo = new BuildOrder(this.BuildableItem, filters); return(bo); }
public ItemFilter(ItemIDMask itemIDMask, ItemCategoryMask itemCategoryMask, MaterialIDMask materialIDMask, MaterialCategoryMask materialCategoryMask) { m_itemIDMask = itemIDMask; m_itemCategoryMask = itemCategoryMask; m_materialIDMask = materialIDMask; m_materialCategoryMask = materialCategoryMask; }