少年修仙传客户端代码仓库
Client_PangDeRong
2018-08-18 35547f45969fabe7dcc81bae595017b3a81303e9
[1885]处理神兽数据
3个文件已修改
56 ■■■■■ 已修改文件
System/Dogz/DogzActiveWin.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dogz/DogzModel.cs 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/WindowBase/ModelCenter.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dogz/DogzActiveWin.cs
@@ -63,6 +63,7 @@
            UpdateDogzAssistCnt();
            model.UpdateSelectDogzEvent += UpdateSelectDogzEvent;
            model.UpdateAssistDogzEvent += UpdateDogzAssistCnt;
        }
        protected override void OnAfterOpen()
System/Dogz/DogzModel.cs
@@ -18,7 +18,7 @@
        public void OnBeforePlayerDataInitialize()
        {
            addAssistCnt = 0;
            dogzAssistStateDict.Clear();
            dogzAssistStateDict = new Dictionary<int, int>();
        }
        public void OnAfterPlayerDataInitialize()
@@ -156,7 +156,7 @@
        }
        public event Action UpdateAssistDogzEvent;
        Dictionary<int, int> dogzAssistStateDict = new Dictionary<int, int>(); //神兽助战
        public Dictionary<int, int> dogzAssistStateDict { get; private set; } //神兽助战
        public void SetServerAssistDogzState(HA3C1_tagMCDogzHelpbattleState info)
        {
            if(!dogzAssistStateDict.ContainsKey(info.DogzID))
@@ -196,7 +196,7 @@
        public void SetDogzEquipInfo()
        {
            m_DogzEquipDict.Clear();
            m_DogzEquipDict = new Dictionary<int, List<ItemModel>>();
            SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptDogzEquip);
            if (singlePack == null) return;
@@ -252,7 +252,8 @@
        /// <summary>
        /// 获得神兽穿戴的装备数据
        /// </summary>
        private Dictionary<int, List<ItemModel>> m_DogzEquipDict = new Dictionary<int, List<ItemModel>>();
        public Dictionary<int, List<ItemModel>> m_DogzEquipDict { get; private set; }
        public List<ItemModel> GetDogzEquips(int _dogzId)
        {
            List<ItemModel> _list = null;
@@ -298,6 +299,51 @@
            return false;
        }
        public void SendPutOnEquip(int dogzId,int index)
        {
            CA5C0_tagCMRuneCompound dogzPutOn = new CA5C0_tagCMRuneCompound();
            dogzPutOn.DogzID = (byte)dogzId;
            dogzPutOn.EquipIndex = (byte)index;
            GameNetSystem.Instance.SendInfo(dogzPutOn);
        }
        public void SendPutOffEquip(int dogzId, int equipPlace)
        {
            CA5C1_tagCMDogzUnEquipItem dogzPutOff = new CA5C1_tagCMDogzUnEquipItem();
            dogzPutOff.DogzID = (byte)dogzId;
            dogzPutOff.EquipPlace = (byte)equipPlace;
            GameNetSystem.Instance.SendInfo(dogzPutOff);
        }
        public void SendChangeDogzAssist(int dogzId, int assistState)
        {
            CA5C2_tagCMDogzBattleStateChange stateChange = new CA5C2_tagCMDogzBattleStateChange();
            stateChange.DogzID = (byte)dogzId;
            stateChange.BatteState = (byte)assistState;
            GameNetSystem.Instance.SendInfo(stateChange);
        }
        public void SendBuyAssistCnt()
        {
            CA5C3_tagCMDogzBuyBatteCount buyCnt = new CA5C3_tagCMDogzBuyBatteCount();
            GameNetSystem.Instance.SendInfo(buyCnt);
        }
        public void SendDogzEquipStrength(int index,List<int>indexlist,int isDouble)
        {
            CA5C4_tagCMDogzBattleStateChange dogzStren = new CA5C4_tagCMDogzBattleStateChange();
            dogzStren.EquipIndex = (byte)index;
            dogzStren.IndexCount = (byte)indexlist.Count;
            byte[] indexByte = new byte[indexlist.Count];
            for(int i = 0; i < indexByte.Length; i++)
            {
                indexByte[i] = (byte)indexlist[i];
            }
            dogzStren.IndexList = indexByte;
            dogzStren.IsDouble = (byte)isDouble;
            GameNetSystem.Instance.SendInfo(dogzStren);
        }
        #endregion
        #region 装备详细信息
System/WindowBase/ModelCenter.cs
@@ -187,6 +187,7 @@
            RegisterModel<TrialDungeonModel>();
            RegisterModel<ActivitiesPushMgr>();
            RegisterModel<MultipleRealmPointModel>();
            RegisterModel<DogzModel>();
            inited = true;
        }