Esempio n. 1
0
    private static int CommoditySortCompare(CommodityInfo cInfo1, CommodityInfo cInfo2)
    {
        int result = 0;

        if (cInfo1.commodityId == cInfo2.commodityId)
        {
            result = 0;
        }
        else if (MarketManager.IsHighPriority2PVPLevel(cInfo1.commodityId, cInfo2.commodityId))
        {
            result = -1;
        }
        else if (MarketManager.IsHighPriority2PVPLevel(cInfo2.commodityId, cInfo1.commodityId))
        {
            result = 1;
        }
        else if (MarketManager.IsHighPriority2Pool(cInfo1.commodityId, cInfo2.commodityId))
        {
            result = -1;
        }
        else if (MarketManager.IsHighPriority2Pool(cInfo2.commodityId, cInfo1.commodityId))
        {
            result = 1;
        }
        else if (MarketManager.IsHighPriority2Weight(cInfo1.commodityId, cInfo2.commodityId))
        {
            result = -1;
        }
        else if (MarketManager.IsHighPriority2Weight(cInfo2.commodityId, cInfo1.commodityId))
        {
            result = 1;
        }
        else if (cInfo1.commodityId < cInfo2.commodityId)
        {
            result = -1;
        }
        else if (cInfo1.commodityId > cInfo2.commodityId)
        {
            return(1);
        }
        return(result);
    }