Esempio n. 1
0
        /// <summary>
        /// 填充球员数据
        /// 装备数据,副卡加成,成长加点,阵型加成,等级加成
        /// </summary>
        /// <param name="buffPack"></param>
        /// <param name="homeFlag"></param>
        public static void FillTeammemberData(DTOBuffPack buffPack, bool homeFlag, string siteId = "")
        {
            try
            {
                var managerSBMList = new List <string>();
                buffPack.SetSBM(homeFlag, managerSBMList);

                var members     = buffPack.GetRawMembers(homeFlag);
                var buffPlayers = buffPack.GetBuffPlayers(homeFlag);
                //套装字典 套装id->数量
                Dictionary <int, List <int> > suitDic = new Dictionary <int, List <int> >();
                //套装id->套装类型
                Dictionary <int, int> suitTypeDic = new Dictionary <int, int>();
                foreach (var teammember in members.Values)
                {
                    var buffPlayer = buffPlayers[teammember.Idx];
                    buffPlayer.SBMList   = new List <string>();
                    buffPlayer.Strength  = teammember.Strength;
                    buffPlayer.Level     = teammember.Level;
                    buffPlayer.ArousalLv = teammember.ArousalLv;
                    ////球星技能
                    buffPlayer.StarSkill = CacheFactory.PlayersdicCache.GetStarSkill(buffPlayer.AsPid, buffPlayer.Strength, teammember.ArousalLv);
                    //装备和副卡 徽章
                    FillEquipData(buffPlayer, teammember.Equipment, ref suitDic, ref suitTypeDic);
                    //成长
                    FillTeammemberGrowData(teammember, buffPlayer);
                    //等级
                    FillTeammemberLevelData(teammember, buffPlayer);
                    //球员星级
                    TheStarPlayerCardData(teammember, buffPlayer);
                    //球星潜力
                    FillPlayerCardData(buffPlayer, teammember);
                }
                //套装
                FillSuitData(suitDic, suitTypeDic, ref managerSBMList);
                //阵型加成
                var solution = buffPack.GetSolution(homeFlag);
                FillFormationData(solution.FormationId, solution.FormationLevel, ref managerSBMList);
                //教练加成
                FillCoachData(buffPack.GetMid(homeFlag), managerSBMList, siteId);
            }
            catch (Exception ex)
            {
                LogHelper.Insert(ex, "TeammemberDataHelper:FillTeammemberData");
            }
        }