Пример #1
0
        void InitCache()
        {
            _itemList               = DicItemMgr.GetAllForCache();
            _itemsDic               = _itemList.ToDictionary(d => d.ItemCode, d => d);
            _itemListNoSystem       = new List <DicItemEntity>();
            _itemTypesDic           = new Dictionary <int, List <DicItemEntity> >();
            _itemTypeLinkDic        = new Dictionary <int, Dictionary <int, DicItemEntity> >();
            _ballsoulLevelupDic     = new Dictionary <int, Dictionary <int, int> >();
            _ballsoulMultiColorList = new List <int>();
            _ballsoulOtherColorList = new List <int>();
            _prpoSellDic            = new Dictionary <int, ConfigPrposellEntity>();
            _ballsoulColorLevelDic  = new Dictionary <int, List <int> >();

            foreach (var dicItem in _itemList)
            {
                if (dicItem.ItemType != (int)EnumItemType.PlayerCard)
                {
                    _itemListNoSystem.Add(dicItem);
                }
                else if (dicItem.PlayerCardLevel != (int)EnumPlayerCardLevel.White)
                {
                    _itemListNoSystem.Add(dicItem);
                }
                if (!_itemTypesDic.ContainsKey(dicItem.ItemType))
                {
                    _itemTypesDic.Add(dicItem.ItemType, new List <DicItemEntity>());
                }
                _itemTypesDic[dicItem.ItemType].Add(dicItem);

                if (!_itemTypeLinkDic.ContainsKey(dicItem.ItemType))
                {
                    _itemTypeLinkDic.Add(dicItem.ItemType, new Dictionary <int, DicItemEntity>());
                }
                _itemTypeLinkDic[dicItem.ItemType].Add(dicItem.LinkId, dicItem);
            }
            _ballsoulMultiColorCount = _ballsoulMultiColorList.Count;
            _ballsoulOtherColorCount = _ballsoulOtherColorList.Count;

            var list2 = DicItemtypeMgr.GetAll();

            _itemTypeLapoverDic = list2.ToDictionary(d => d.Idx, d => d.LapoverCount);

            var equipmentWashStoneList = AppsettingCache.Instance.GetAppSetting(EnumAppsetting.EquipmentWashStoneList);
            var ss = equipmentWashStoneList.Split(',');

            _washStoneLevelupDic = new Dictionary <int, int>(ss.Length - 1);
            for (int i = 0; i < ss.Length - 1; i++)
            {
                _washStoneLevelupDic.Add(ConvertHelper.ConvertToInt(ss[i]), ConvertHelper.ConvertToInt(ss[i + 1]));
            }
            list2 = null;

            var itemNewPackCodes = AppsettingCache.Instance.GetAppSetting(EnumAppsetting.ItemNewPackCodes);
            var ii = itemNewPackCodes.Split(',');

            _itemNewPackCodeDic = new Dictionary <int, int>(ii.Length);
            foreach (var s in ii)
            {
                _itemNewPackCodeDic.Add(ConvertHelper.ConvertToInt(s), 0);
            }
            _legendPlayerList = _itemTypesDic[1].FindAll(d => d.PlayerCardLevel == 1 || d.PlayerCardLevel == 7);

            _theContractList = DicItemMgr.GetContractItem();

            var list3 = ConfigPrposellMgr.GetAll();

            foreach (var item in list3)
            {
                var key = PrpoSellKey(item.ItemType, item.Quality);
                if (!_prpoSellDic.ContainsKey(key))
                {
                    _prpoSellDic.Add(key, item);
                }
                else
                {
                    _prpoSellDic[key] = item;
                }
            }
        }
Пример #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);
        }