public void SetItemSellData(ITEM_SELL SellData) { if (!this.mHash_ItemSellData.ContainsKey(SellData.nGroupUnique)) { this.mHash_ItemSellData.Add(SellData.nGroupUnique, new Dictionary <int, ITEM_SELL>()); } if (!this.mHash_ItemSellData[SellData.nGroupUnique].ContainsKey(SellData.nItemMakeRank)) { this.mHash_ItemSellData[SellData.nGroupUnique].Add(SellData.nItemMakeRank, SellData); } }
public override bool ParseDataFromNDT(TsDataReader dr) { foreach (TsDataReader.Row data in dr) { ITEM_SELL iTEM_SELL = new ITEM_SELL(); iTEM_SELL.SetData(data); iTEM_SELL.nItemMakeRank = NrTSingleton <ITEM_SELL_Manager> .Instance.GetRankType(iTEM_SELL.stRank); NrTSingleton <ITEM_SELL_Manager> .Instance.SetItemSellData(iTEM_SELL); } return(true); }
public ITEM_SELL GetItemSellData(int GroupUnique, int ItemMakeRank) { if (this.mHash_ItemSellData.ContainsKey(GroupUnique)) { foreach (KeyValuePair <int, ITEM_SELL> current in this.mHash_ItemSellData[GroupUnique]) { int key = current.Key; ITEM_SELL value = current.Value; if (key == ItemMakeRank) { return(value); } } } return(null); }
private int CompareItemLevel(ITEM a, ITEM b) { ITEMINFO itemInfo = NrTSingleton <ItemManager> .Instance.GetItemInfo(a.m_nItemUnique); if (itemInfo == null) { return(0); } ITEMINFO itemInfo2 = NrTSingleton <ItemManager> .Instance.GetItemInfo(b.m_nItemUnique); if (itemInfo2 == null) { return(0); } int itemMakeRank = a.m_nOption[2]; int itemMakeRank2 = b.m_nOption[2]; ITEM_SELL itemSellData = NrTSingleton <ITEM_SELL_Manager> .Instance.GetItemSellData(itemInfo.m_nQualityLevel, itemMakeRank); if (itemSellData == null) { return(0); } ITEM_SELL itemSellData2 = NrTSingleton <ITEM_SELL_Manager> .Instance.GetItemSellData(itemInfo2.m_nQualityLevel, itemMakeRank2); if (itemSellData2 == null) { return(0); } long num = (long)(itemSellData.nItemSellMoney / NrTSingleton <PointManager> .Instance.GetItemBuyRate()); if (0L >= num) { return(0); } long num2 = (long)(itemSellData2.nItemSellMoney / NrTSingleton <PointManager> .Instance.GetItemBuyRate()); if (0L >= num2) { return(0); } return(num.CompareTo(num2)); }
private void ShowEquipList() { this.m_kList.SetMultiSelectMode(true); this.m_kList.Clear(); List <ITEM> list = new List <ITEM>(); for (int i = 1; i <= 4; i++) { for (int j = 0; j < ItemDefine.INVENTORY_ITEMSLOT_MAX; j++) { ITEM item = NkUserInventory.GetInstance().GetItem(i, j); if (item != null) { ITEMINFO itemInfo = NrTSingleton <ItemManager> .Instance.GetItemInfo(item.m_nItemUnique); if (itemInfo != null) { int itemMakeRank = item.m_nOption[2]; ITEM_SELL itemSellData = NrTSingleton <ITEM_SELL_Manager> .Instance.GetItemSellData(itemInfo.m_nQualityLevel, itemMakeRank); if (itemSellData != null) { long num = (long)(itemSellData.nItemSellMoney / NrTSingleton <PointManager> .Instance.GetItemBuyRate()); if (0L < num) { list.Add(item); } } } } } } if (list.Count > 0) { list.Sort(new Comparison <ITEM>(this.CompareItemLevel)); for (int k = 0; k < list.Count; k++) { ITEMINFO itemInfo2 = NrTSingleton <ItemManager> .Instance.GetItemInfo(list[k].m_nItemUnique); if (itemInfo2 != null) { int itemMakeRank2 = list[k].m_nOption[2]; ITEM_SELL itemSellData2 = NrTSingleton <ITEM_SELL_Manager> .Instance.GetItemSellData(itemInfo2.m_nQualityLevel, itemMakeRank2); if (itemSellData2 != null) { long num2 = (long)(itemSellData2.nItemSellMoney / NrTSingleton <PointManager> .Instance.GetItemBuyRate()); if (0L < num2) { NewListItem newListItem = new NewListItem(this.m_kList.ColumnNum, true, string.Empty); newListItem.SetListItemData(1, list[k], null, null, null); string name = NrTSingleton <ItemManager> .Instance.GetName(list[k]); newListItem.SetListItemData(2, name, null, null, null); newListItem.SetListItemData(3, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2255"), null, null, null); newListItem.SetListItemData(4, NrTSingleton <CTextParser> .Instance.GetTextColor("1301") + num2.ToString(), null, null, null); newListItem.SetListItemData(5, false); newListItem.SetListItemData(6, list[k].IsLock()); newListItem.Data = list[k]; this.m_kList.Add(newListItem); } } } } } this.m_kList.RepositionItems(); list.Clear(); }
private void ClickList(IUIObject obj) { if (this.m_eType == ExchangePointDlg.TYPE.TYPE_TICKET) { UIListItemContainer selectedItem = this.m_kList.SelectedItem; if (null == selectedItem) { return; } ITEM iTEM = (ITEM)selectedItem.Data; if (iTEM == null) { return; } this.m_kSelectItem.SetItemTexture(iTEM); this.m_kSelectItem.Data = iTEM; this.m_nSelectItemUnique = iTEM.m_nItemUnique; this.m_nSelectItemNum = 1; this.m_kSellNum.MaxValue = (long)iTEM.m_nItemNum; this.m_kSellNum.Text = this.m_nSelectItemNum.ToString(); this.m_kSelectItemName.Text = NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique(iTEM.m_nItemUnique); this.GetPoint(iTEM); this.SetVisible(true); } else if (this.m_eType == ExchangePointDlg.TYPE.TYPE_EQUIPITEM) { for (int i = 0; i < this.m_kList.Count; i++) { UIListItemContainer item = this.m_kList.GetItem(i); if (!(null == item)) { if (item.IsSelected()) { item.GetElement(5).Visible = true; } else { item.GetElement(5).Visible = false; } } } this.InitRemoveItemID(); int num = this.m_kList.SelectedItems.Count; if (num == 0) { this.InitSelectItemInfo(); return; } if (num > 10) { return; } num = 0; long num2 = 0L; bool flag = false; foreach (IUIListObject current in this.m_kList.SelectedItems.Values) { IUIListObject iUIListObject = current; if (iUIListObject != null) { if (num > 10) { break; } ITEM iTEM2 = (ITEM)iUIListObject.Data; if (iTEM2 != null) { ITEMINFO itemInfo = NrTSingleton <ItemManager> .Instance.GetItemInfo(iTEM2.m_nItemUnique); if (itemInfo != null) { int itemMakeRank = iTEM2.m_nOption[2]; ITEM_SELL itemSellData = NrTSingleton <ITEM_SELL_Manager> .Instance.GetItemSellData(itemInfo.m_nQualityLevel, itemMakeRank); if (itemSellData != null) { long num3 = (long)(itemSellData.nItemSellMoney / NrTSingleton <PointManager> .Instance.GetItemBuyRate()); if (0L < num3) { if (!flag) { this.m_kSelectItem.SetItemTexture(iTEM2); this.m_kSelectItem.Data = iTEM2; this.m_kSelectItemName.Text = NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique(iTEM2.m_nItemUnique); flag = true; } this.m_nRemoveItemID[num++] = iTEM2.m_nItemID; num2 += num3; } } } } } } string empty = string.Empty; if (1 < this.m_kList.SelectedItems.Count) { NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[] { NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("295"), "count", this.m_kList.SelectedItems.Count - 1 }); this.m_kEquipCount.Text = empty; } else { this.m_kEquipCount.Text = string.Empty; } this.m_kEquipPointName.Visible = true; empty = string.Empty; NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[] { NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2256"), "count", num2 }); this.m_kTotalEquipPoint.Text = empty; } this.SetPoint(); }