Пример #1
0
    //过滤上架物品
    private List <GameItem> FilterSelShenQiStuff(GameItemContainer Container)
    {
        List <GameItem> resultlist = new List <GameItem>();

        for (int nIndex = 0; nIndex < Container.ContainerSize; ++nIndex)
        {
            GameItem item = Container.GetItem(nIndex);
            if (null != item && item.IsValid() && item.DataID == m_nNeedItemDataId)
            {
                resultlist.Add(item);
            }
        }
        return(ItemTool.ItemSort(resultlist));
    }
Пример #2
0
    //过滤上架物品
    private List <GameItem> FilterConsignSale(GameItemContainer Container, int nClass, int nSubClass = 0)
    {
        List <GameItem> resultlist = new List <GameItem>();

        for (int nIndex = 0; nIndex < Container.ContainerSize; ++nIndex)
        {
            GameItem item = Container.GetItem(nIndex);
            if (null != item && item.IsValid())
            {
                int itemclass    = TableManager.GetCommonItemByID(item.DataID, 0).ClassID;
                int itemsubclass = TableManager.GetCommonItemByID(item.DataID, 0).SubClassID;
                if ((itemclass == nClass || nClass == 0) &&
                    (itemsubclass == nSubClass || nSubClass == 0) &&
                    isCanConsignSale(item))
                {
                    resultlist.Add(item);
                }
            }
        }
        return(ItemTool.ItemSort(resultlist));
    }