/****************检测商店的可购买礼包*****************/ /// <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); }
protected virtual void OnClickUI_Btn_Sell() { if (ObjectSelf.GetInstance().Gold < m_Number * m_ShopTemp.getCost() [0]) { InterfaceControler.GetInst().AddMsgBox("元宝不足"); return; } if (m_Number > 0) { CShopBuy proto = new CShopBuy(); proto.shopid = m_ShopTemp.GetID(); proto.num = m_Number; proto.isdiscount = 0; IOControler.GetInstance().SendProtocol(proto); } }