public Boolean TestItem(ItemRecord a_Item) { if (!TestTristate(Published, a_Item.IsPublished)) { return(false); } if (!TestTristate(PlainMaterials, !a_Item.HasUnknownMaterials)) { return(false); } if (!TestTristate(HasMarketGroup, (0 != a_Item.MarketGroupID))) { return(false); } if (!TestTristate(IsPricesOk, a_Item.IsPricesOk(PriceExpiryDays))) { return(false); } if ((AssetsFilter != null) && !AssetsFilter.ContainsKey(a_Item.TypeID)) { return(false); } return(true); }
ItemAssets GetOrInsert_LocationAssets(UInt32 a_LocationID) { if (Assets.ContainsKey(a_LocationID)) { return(Assets[a_LocationID]); } ItemAssets newLocation = new ItemAssets(a_LocationID, false); Assets.Add(a_LocationID, newLocation); return(newLocation); }
/// <summary> /// Fills m_ItemList with data /// </summary> /// <param name="a_ListTypeIDs">TypeIDs of items to be filled into list</param> /// <param name="a_Assets">Null or Assets to be listed</param> private void SetupListItemsData(UInt32[] a_ListTypeIDs, AssetsMap a_Assets) { m_TotalsItem = null; List <MainListItem> specialItems = new List <MainListItem>(); if (a_Assets != null) { m_TotalsItem = new MainListItem(); m_TotalsItem.TypeID = SpecialTypeID_Totals; m_TotalsItem.ItemData = CreateSpecialItem_Totals(); m_TotalsItem.Quantity = 0; specialItems.Add(m_TotalsItem); } m_ItemList = new MainListItem[specialItems.Count + a_ListTypeIDs.Count()]; for (int i = 0; i < specialItems.Count; i++) { m_ItemList[i] = specialItems[i]; } for (int i = 0; i < a_ListTypeIDs.Count(); i++) { UInt32 currTypeID = a_ListTypeIDs[i]; MainListItem currItem = new MainListItem(); m_ItemList[specialItems.Count + i] = currItem; ItemAssets currAssets = null; if ((a_Assets != null) && a_Assets.ContainsKey(currTypeID)) { currAssets = (ItemAssets)a_Assets[currTypeID]; } currItem.TypeID = currTypeID; currItem.ItemData = m_ItemsDB.GetItemByTypeID(currTypeID); if (currAssets == null) { currItem.Quantity = 1; } else { currItem.Quantity = currAssets.Quantity; } } }