private int CompareItemLevel(ITEM a, ITEM b)
    {
        ITEMINFO itemInfo = NrTSingleton <ItemManager> .Instance.GetItemInfo(a.m_nItemUnique);

        ITEMINFO itemInfo2 = NrTSingleton <ItemManager> .Instance.GetItemInfo(b.m_nItemUnique);

        if (itemInfo.m_nQualityLevel != itemInfo2.m_nQualityLevel)
        {
            return(-itemInfo.m_nQualityLevel.CompareTo(itemInfo2.m_nQualityLevel));
        }
        if (a.GetRank() != b.GetRank())
        {
            return(-a.GetRank().CompareTo(b.GetRank()));
        }
        return(-itemInfo.GetUseMinLevel(a).CompareTo(itemInfo2.GetUseMinLevel(b)));
    }
Пример #2
0
    private string ItemRankText(ITEM item)
    {
        eITEM_RANK_TYPE rank   = item.GetRank();
        string          result = string.Empty;

        switch (rank)
        {
        case eITEM_RANK_TYPE.ITEM_RANK_D:
            result = "D";
            break;

        case eITEM_RANK_TYPE.ITEM_RANK_C:
            result = "C";
            break;

        case eITEM_RANK_TYPE.ITEM_RANK_B:
            result = "B";
            break;

        case eITEM_RANK_TYPE.ITEM_RANK_A:
            result = "A";
            break;

        case eITEM_RANK_TYPE.ITEM_RANK_S:
            result = "S";
            break;

        case eITEM_RANK_TYPE.ITEM_RANK_SS:
            result = "SS";
            break;
        }
        return(result);
    }
Пример #3
0
    private int CompareItem(NkSoldierInfo a, NkSoldierInfo b)
    {
        long num  = 0L;
        long num2 = 0L;
        ITEM equipItemByUnique  = a.GetEquipItemByUnique(this.m_nSearch_ItemUnique);
        ITEM equipItemByUnique2 = b.GetEquipItemByUnique(this.m_nSearch_ItemUnique);

        if (equipItemByUnique != null)
        {
            ITEMINFO itemInfo = NrTSingleton <ItemManager> .Instance.GetItemInfo(equipItemByUnique.m_nItemUnique);

            if (itemInfo != null)
            {
                num = (long)(itemInfo.GetUseMinLevel(equipItemByUnique) * 100 + equipItemByUnique.GetRank());
            }
        }
        if (equipItemByUnique2 != null)
        {
            ITEMINFO itemInfo2 = NrTSingleton <ItemManager> .Instance.GetItemInfo(equipItemByUnique2.m_nItemUnique);

            if (itemInfo2 != null)
            {
                num2 = (long)(itemInfo2.GetUseMinLevel(equipItemByUnique) * 100 + equipItemByUnique2.GetRank());
            }
        }
        if (num < num2)
        {
            return(1);
        }
        if (num > num2)
        {
            return(-1);
        }
        return(0);
    }
Пример #4
0
    private void SetInvItemData()
    {
        bool flag = true;

        this.m_SolID = 0L;
        this.m_NewListBox.Clear();
        this.m_InvenItemList.Clear();
        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)
                {
                    if (item.GetRank() != eITEM_RANK_TYPE.ITEM_RANK_SS)
                    {
                        if (NrTSingleton <ItemManager> .Instance.GetItemInfo(item.m_nItemUnique) != null)
                        {
                            item = NkUserInventory.GetInstance().GetItem(i, j);
                            this.m_InvenItemList.Add(item);
                            flag = false;
                        }
                    }
                }
            }
        }
        if (this.m_InvenItemList.Count > 0)
        {
            this.m_InvenItemList.Sort(new Comparison <ITEM>(this.CompareItemLevel));
            for (int k = 0; k < this.m_InvenItemList.Count; k++)
            {
                NewListItem item2 = new NewListItem(this.m_NewListBox.ColumnNum, true, string.Empty);
                this.SetItemColum(this.m_InvenItemList[k], k, ref item2);
                this.m_NewListBox.Add(item2);
            }
        }
        this.m_NewListBox.RepositionItems();
        if (flag)
        {
            this.m_lbText.Visible = true;
        }
        else
        {
            this.m_lbText.Visible = false;
        }
    }
Пример #5
0
    public void SetData(ITEM item, long money, int nMatItemUni, int nMatItemNum)
    {
        string name = NrTSingleton <ItemManager> .Instance.GetName(item);

        eITEM_RANK_TYPE rank     = item.GetRank();
        string          rankName = NrTSingleton <ItemManager> .Instance.GetRankName(item);

        string text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1992");

        string empty = string.Empty;

        if (money != 0L)
        {
            text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1992");

            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                text,
                "money",
                money.ToString(),
                "itemname2",
                ItemManager.RankTextColor(rank) + name,
                "grade",
                rankName
            });
        }
        else
        {
            text = NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox("178");

            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                text,
                "targetname",
                NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique(nMatItemUni),
                "count",
                nMatItemNum.ToString(),
                "targetname1",
                ItemManager.RankTextColor(rank) + name
            });
        }
        this.m_lbContext.Text = empty;
    }