Пример #1
0
        public bool GetHeroXPSkillInfo(int nHeroID, int nXPSkillID, ref cmd_Hero_XP_Skill_Info data)
        {
            if (!dicXPSkillInfoData.ContainsKey(nHeroID))
            {
                return(false);
            }

            foreach (cmd_Hero_XP_Skill_Info item in dicXPSkillInfoData[nHeroID])
            {
                if (item.nXPSkillID == nXPSkillID)
                {
                    data = item;
                    return(true);
                }
            }

            return(false);
        }
Пример #2
0
        // 更新XP技能信息
        public void UpdateHeroXPSkillInfo(IntPtr ptrParam, int nPtrLen)
        {
            if (dicXPSkillInfoData == null)
            {
                dicXPSkillInfoData = new Dictionary <int, List <cmd_Hero_XP_Skill_Info> >();
            }

            IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nPtrLen);
            cmd_count heroCount           = helper.get <cmd_count>();

            if (heroCount.nCount > 1)
            {
                dicXPSkillInfoData.Clear();
            }

            for (int i = 0; i < heroCount.nCount; ++i)
            {
                cmd_Hero_Additional_Info headHead = helper.get <cmd_Hero_Additional_Info>();

                int nHeroID = headHead.nHeroID;
                if (dicXPSkillInfoData.ContainsKey(nHeroID))
                {
                    dicXPSkillInfoData[nHeroID].Clear();
                }
                else
                {
                    dicXPSkillInfoData[nHeroID] = new List <cmd_Hero_XP_Skill_Info>();
                }

                for (int j = 0; j < headHead.nAdditionalCount; ++j)
                {
                    cmd_Hero_XP_Skill_Info cmdInfo = helper.get <cmd_Hero_XP_Skill_Info>();
                    dicXPSkillInfoData[nHeroID].Add(cmdInfo);
                }
            }

            USpeedUI.UISystem.Instance.SendWndMessage(USpeedUI.WndMsgID.WND_MSG_HERODETAIL_HERODETAILXPUPDATE, null);
        }