Exemple #1
0
    /// <summary>
    /// 获取商城物品总的购买次数限制---目前VIP等级会影响到这里,后期可能还会增加其他限制;
    /// </summary>
    /// <param name="shopT"></param>
    /// <param name="vipLv"></param>
    /// <returns></returns>
    public int GetShopItemTotalBuyTimes(ShopTemplate shopT, int vipLv)
    {
        if (shopT.getShelveMaxBuy() < 0)
        {
            return(-1);
        }

        int vipCount = 0;//根据VIP算出的附加值;

        return(shopT.getShelveMaxBuy() + vipCount);
    }
Exemple #2
0
    public static SHOP_LIMIT_TYPE GetShopLimitType(ShopTemplate shopT)
    {
        if (shopT == null)
        {
            return(SHOP_LIMIT_TYPE.NONE);
        }

        int daily = shopT.getDailyMaxBuy();
        int total = shopT.getShelveMaxBuy();

        if (daily != -1)
        {
            return(SHOP_LIMIT_TYPE.DAILY);
        }

        if (daily == -1 && total != -1)
        {
            return(SHOP_LIMIT_TYPE.TOTAL);
        }

        if (daily != -1 && total != -1)
        {
            LogManager.LogError("策划说不会有每天限购且永久限购类型的商品");
            return(SHOP_LIMIT_TYPE.NONE);
        }

        return(SHOP_LIMIT_TYPE.NONE);
    }
Exemple #3
0
    /// <summary>
    /// 该物品是否限购;
    /// </summary>
    /// <param name="shopT"></param>
    /// <returns></returns>
    public static bool IsShopBuyLimited(ShopTemplate shopT)
    {
        if (shopT == null)
        {
            return(false);
        }

        return(shopT.getDailyMaxBuy() > 0 || shopT.getShelveMaxBuy() > 0);
    }
    /****************检测商店的可购买礼包*****************/
    /// <summary>
    /// 检测商店的可购买礼包
    /// </summary>
    /// <returns></returns>
    public bool CheckNonPurchasedGiftSet()
    {
        bool _result = false;

        m_NonPurchasedGiftSetList.Clear();

        for (int i = 0; i < m_GiftSetList.Count; i++)
        {
            bool         _timesResult = true;
            ShopTemplate _shopT       = m_GiftSetList[i];
            if (_shopT.getVipLimit() > m_ObjectSelf.VipLevel)
            {
                continue;
            }

            int _maxTimes      = _shopT.getDailyMaxBuy();
            int _maxTotalTimes = _shopT.getShelveMaxBuy();

            var _shopBuy = m_ObjectSelf.GetShopBuyInfoByShopId(_shopT.GetID());

            if (_maxTimes > 0)
            {
                _timesResult &= _maxTimes > _shopBuy.todaynum;
            }

            if (_maxTotalTimes > 0)
            {
                _timesResult &= _maxTotalTimes > _shopBuy.buyallnum;
            }
            if (_timesResult)
            {
                _result |= true;
                m_NonPurchasedGiftSetList.Add(_shopT.GetID());
            }
        }

        return(_result);
    }