少年修仙传客户端代码仓库
client_linchunjie
2018-10-24 e89c81f45f344186069dc9cfa8b4e232f6f9822d
System/OpenServerActivity/WishingPoolModel.cs
@@ -15,10 +15,12 @@
        public const int WishRedKey = 20915;
        public override void Init()
        {
            ParseConfig();
            OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
            OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
            OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
            OpenServerActivityCenter.Instance.Register((int)OpenServerActivityCenter.OSActivityType.WishingPool, this);
            SetWishRedpoint();
        }
        public void OnBeforePlayerDataInitialize()
@@ -120,7 +122,37 @@
            return false;
        }
        public bool IsBestItem()
        {
            foreach(var key in poolDataDict.Keys)
            {
                if(poolDataDict[key].isBest == 1)
                {
                    return true;
                }
            }
            return false;
        }
        public int handStartIndex { get; private set; }
        public int handEndIndex { get; private set;}
        public event Action UpdateHandMoveEvent;
        public void SetHandMovePos(int wishIndex)
        {
            foreach(var key in poolDataDict.Keys)
            {
                if(poolDataDict[key].itemId != 0)
                {
                    handStartIndex = key;
                    break;
                }
            }
            handEndIndex = wishIndex;
            if(UpdateHandMoveEvent != null)
            {
                UpdateHandMoveEvent();
            }
        }
        #region 本地数据
        public bool isDraging { get; set; }
@@ -168,8 +200,11 @@
            for (int i = 0; i < wishInfo.LastAwardCnt; i++)
            {
                var itemInfo = wishInfo.LastAwardItemInfo[i];
                WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID, itemInfo.ItemCnt, itemInfo.IsBind, itemInfo.IsSpecial);
                SetWishingAwardData(i, wellItem);
                if(itemInfo.ItemID != 0)
                {
                    WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID, itemInfo.ItemCnt, itemInfo.IsBind, itemInfo.IsSpecial);
                    SetWishingAwardData(i, wellItem);
                }
            }
            UpdateRedpoint();
            if(UpdateWishAwardEvent != null)
@@ -299,6 +334,16 @@
            GameNetSystem.Instance.SendInfo(wishingRefresh);
        }
        public void SendGetAwardQuest()
        {
            CA504_tagCMPlayerGetReward getReward = new CA504_tagCMPlayerGetReward();
            getReward.RewardType = (byte)GotServerRewardType.Def_RewardType_WishingWell;
            getReward.DataEx = 0;
            getReward.DataExStrLen = 0;
            getReward.DataExStr = string.Empty;
            GameNetSystem.Instance.SendInfo(getReward);
        }
        public void SendRefreshWishInfo(int poolIndex,int wishIndex)
        {
            CAA06_tagCMActWishing actWishing = new CAA06_tagCMActWishing();