Esempio n. 1
0
        static SkillCardConfig()
        {
            try
            {
                SKILLCardMaxBagSize       = AppsettingCache.Instance.GetAppSettingToInt(EnumAppsetting.SKILLCardMaxBagSize, SKILLCardMaxBagSize);
                SKILLCardMaxBagMapLen     = AppsettingCache.Instance.GetAppSettingToInt(EnumAppsetting.SKILLCardMaxBagMapLen, SKILLCardMaxBagMapLen);
                SKILLCardRAWSkillCellSize = AppsettingCache.Instance.GetAppSettingToInt(EnumAppsetting.SKILLCardRAWSkillCellSize, SKILLCardRAWSkillCellSize);

                SKILLCardMixVipLevel     = AppsettingCache.Instance.GetAppSettingToInt(EnumAppsetting.SKILLCardMixVipLevel, SKILLCardMixVipLevel);
                SKILLCardAskVipLevel     = AppsettingCache.Instance.GetAppSettingToInt(EnumAppsetting.SKILLCardAskVipLevel, SKILLCardAskVipLevel);
                SKILLCardAskSkipVipLevel = AppsettingCache.Instance.GetAppSettingToInt(EnumAppsetting.SKILLCardAskSkipVipLevel, SKILLCardAskSkipVipLevel);
                SKILLCardPickVipLevel    = AppsettingCache.Instance.GetAppSettingToInt(EnumAppsetting.SKILLCardPickVipLevel, SKILLCardPickVipLevel);
                _SkillUpgradeDic         = new Dictionary <int, ConfigSkillupgradeEntity>();
                var allconfig = ConfigSkillupgradeMgr.GetAll();
                foreach (var item in allconfig)
                {
                    var key = GetKey(item.SkillLevel, item.Quality);
                    if (!_SkillUpgradeDic.ContainsKey(key))
                    {
                        _SkillUpgradeDic.Add(key, item);
                    }
                    else
                    {
                        _SkillUpgradeDic[key] = item;
                    }
                }
            }
            catch (Exception ex)
            {
                SystemlogMgr.Error("SkillCardConfig:Init", ex);
            }
        }
Esempio n. 2
0
        public static SkillTipsEntity ExportSkillTips(bool includeStarSkillLevel = false)
        {
            var tips = new SkillTipsEntity();

            tips.SkillCard     = DicSkillcardtipsMgr.GetAll();
            tips.StarSkill     = DicStarskilltipsMgr.GetAll();
            tips.ManagerTalent = DicManagertalenttipsMgr.GetAll();
            tips.ClubSkills    = DicClubskillMgr.GetAll();
            var wills     = DicManagerwilltipsMgr.GetAll();
            var willParts = DicManagerwillparttipsMgr.GetAll();
            var dicWill   = new Dictionary <string, DicManagerwilltipsEntity>(wills.Count);

            tips.LowWill  = new List <DicManagerwilltipsEntity>();
            tips.HighWill = new List <DicManagerwilltipsEntity>();
            var strengthList       = ConfigStrengthMgr.GetAll();
            var _configStrengthDic = new Dictionary <int, ConfigStrengthEntity>(strengthList.Count);

            foreach (var entity in strengthList)
            {
                var key = BuildStrengthKey(entity.CardLevel, entity.Source, entity.Target);
                if (!_configStrengthDic.ContainsKey(key))
                {
                    _configStrengthDic.Add(key, entity);
                }
            }
            tips.PlayerStrengthDic = _configStrengthDic;

            var allSkillConfig   = ConfigSkillupgradeMgr.GetAll();
            var _SkillUpgradeDic = new Dictionary <int, ConfigSkillupgradeEntity>(allSkillConfig.Count);

            foreach (var item in allSkillConfig)
            {
                var key = GetKey(item.SkillLevel, item.Quality);
                if (!_SkillUpgradeDic.ContainsKey(key))
                {
                    _SkillUpgradeDic.Add(key, item);
                }
                else
                {
                    _SkillUpgradeDic[key] = item;
                }
            }
            tips.SkillUpGradeDic = _SkillUpgradeDic;

            var allprpo = ConfigPrposellMgr.GetAll();

            tips.PrpoSelllist = allprpo;

            var allSkill     = DicSkillstreeMgr.GetAll();
            var allSkillDesc = DicSkillstreedesdicMgr.GetAll();
            var skillList    = new List <ManagerSkillTree>();

            foreach (var skill in allSkill)
            {
                var desc = allSkillDesc.FindAll(r => r.SkillCode == skill.SkillCode);
                foreach (var d in desc)
                {
                    var sk = new ManagerSkillTree();
                    sk.CoditionPoint = skill.ConditionPoint;
                    sk.Condition     = skill.Condition;
                    sk.Description   = d.Description;
                    sk.ManagerLevel  = skill.RequireManagerLevel;
                    sk.ManagerType   = skill.ManagerType;
                    sk.MaxPoint      = skill.MaxPoint;
                    sk.SkillCode     = skill.SkillCode;
                    sk.SkillLevel    = d.SkillLevel;
                    sk.SkillName     = skill.SkillName;
                    sk.Opener        = skill.Opener;
                    skillList.Add(sk);
                }
            }
            tips.ManagerSkillTree = skillList;
            #region CombLink
            //var combLinks = DicPlayerlinkMgr.GetAll();
            var cdic = new SortedDictionary <int, int>();
            int cno  = 0;
            int cnt  = 0;
            //foreach (var item in combLinks)
            //{
            //    if (!cdic.TryGetValue(item.Idx, out cno))
            //    {
            //        if (!cdic.TryGetValue(item.LinkId, out cno))
            //            cno = ++cnt;
            //    }
            //    cdic[item.Idx] = cno;
            //    cdic[item.LinkId] = cno;
            //}
            var dicComb = new Dictionary <int, string>();
            var list    = new List <int>();
            for (int i = 0; i <= cnt; i++)
            {
                cno = 0;
                list.Clear();
                foreach (var kvp in cdic)
                {
                    if (kvp.Value != i)
                    {
                        continue;
                    }
                    if (cno == 0)
                    {
                        cno = kvp.Key;
                    }
                    else
                    {
                        list.Add(kvp.Key);
                    }
                }
                if (list.Count > 0)
                {
                    dicComb[cno] = string.Join(",", list.ToArray());
                }
            }
            #endregion

            foreach (var item in wills)
            {
                if (item.WillRank == 1)
                {
                    tips.LowWill.Add(item);
                }
                else
                {
                    tips.HighWill.Add(item);
                }
                dicWill[item.SkillCode] = item;
            }
            DicManagerwilltipsEntity will = null;
            foreach (var g in willParts.GroupBy(i => i.SkillCode))
            {
                if (!dicWill.TryGetValue(g.Key, out will))
                {
                    continue;
                }
                will.PartList = g.ToList();
            }
            CombTipsEntity comb = null;
            tips.Combs = new List <CombTipsEntity>();
            foreach (var item in dicWill.Values)
            {
                if (item.WillRank == 1)
                {
                    continue;
                }
                comb          = new CombTipsEntity(item);
                comb.PartList = new List <CombPartTipsEntity>();
                foreach (var part in item.PartList)
                {
                    if (dicComb.ContainsKey(part.Pid))
                    {
                        part.LinkPid = dicComb[part.Pid];
                    }
                    else
                    {
                        part.LinkPid = string.Empty;
                    }
                    comb.PartList.Add(new CombPartTipsEntity(part));
                }
                tips.Combs.Add(comb);
            }
            //tips.StarArousalSkills = DicStararousalskillsMgr.GetAll();

            tips.Potential = new Dictionary <int, List <ConfigPotentialEntity> >();
            var allPotential = ConfigPotentialMgr.GetAll();
            foreach (var item in allPotential)
            {
                if (!tips.Potential.ContainsKey(item.PotentialId))
                {
                    tips.Potential.Add(item.PotentialId, new List <ConfigPotentialEntity>());
                }
                tips.Potential[item.PotentialId].Add(item);
            }
            if (includeStarSkillLevel)
            {
                tips.StarSkillLevels = DicStarskillleveltipsMgr.GetAll();
            }
            return(tips);
        }