Esempio n. 1
0
        private void InitCache()
        {
            var list = DicGiftpackprizeMgr.GetAll();

            foreach (var entity in list)
            {
                var key = entity.PackId;
                if (!_packDic.ContainsKey(key))
                {
                    _packDic.Add(key, new List <DicGiftpackprizeEntity>());
                }
                _packDic[key].Add(entity);
            }
        }
Esempio n. 2
0
        public static DescriptionConfigEntity ExportDescriptionDic()
        {
            var config = new DescriptionConfigEntity();
            var list   = DicGrowMgr.GetAll();

            config.GrowDic = new List <LDescriptionEntity>(list.Count);
            foreach (var dicGrowEntity in list)
            {
                config.GrowDic.Add(new LDescriptionEntity()
                {
                    Description = dicGrowEntity.Name, Idx = dicGrowEntity.Idx, GrowTip = dicGrowEntity.GrowTip
                });
            }
            var suitList = DicEquipmentsuitMgr.GetAll();

            config.EquipmentSuit = new List <EquipmentsuitEntity>(suitList.Count);
            foreach (var entity in suitList)
            {
                config.EquipmentSuit.Add(new EquipmentsuitEntity()
                {
                    Idx = entity.Idx, Memo1 = entity.Memo1, Memo2 = entity.Memo2, Memo3 = entity.Memo3, Name = entity.Name, SuitType = entity.SuitType
                });
            }
            var appsettings = ConfigAppsettingMgr.GetAllForCache();

            config.WChallengeNameTemplate = GetAppSettingName("WChallengeStageNameTemplate", appsettings);
            config.HighBallsoulName       = GetAppSettingName("HighBallsoulName", appsettings);
            config.NormalBallsoulName     = GetAppSettingName("NormalBallsoulName", appsettings);

            var funcs = ConfigFunctionopenMgr.GetAll();

            config.Functionopens = new List <WpfConfigFunctionopenEntity>();
            foreach (var entity in funcs)
            {
                if (entity.FunctionId > 0)
                {
                    config.Functionopens.Add(new WpfConfigFunctionopenEntity()
                    {
                        Idx = entity.FunctionId, LockMemo = entity.LockMemo, Name = entity.Name, ManagerLevel = entity.ManagerLevel
                    });
                }
            }
            config.BuffTips = new List <BuffTipsEntity>();
            foreach (var item in DicBuffMgr.GetAll())
            {
                if (item.BuffType == 2)
                {
                    config.BuffTips.Add(new BuffTipsEntity(item));
                }
            }
            config.BuffSrcTips = new List <BuffSrcTipsEntity>();
            foreach (var item in DicSkillMgr.GetAll())
            {
                if (item.BuffSrcType == 1)
                {
                    config.BuffSrcTips.Add(new BuffSrcTipsEntity(item));
                }
            }

            config.PlayerCardStrengthPlus = GetAppSettingName("PlayerCardStrengthPlus", appsettings);
            config.Equipmentplus          = ConfigEquipmentplusMgr.GetAll();
            config.Mails = DicMailMgr.GetAll();

            var ladderExchanges = DicLadderexchangeMgr.GetAll();

            config.LadderExchanges = new List <LadderExchangeEntity>();
            foreach (var entity in ladderExchanges)
            {
                var exchange = new LadderExchangeEntity()
                {
                    Idx        = entity.Type,
                    CostHonor  = entity.CostHonor,
                    LadderCoin = entity.LadderCoin
                };
                config.LadderExchanges.Add(exchange);
            }

            var leagueExchanges = DicLeagueexchangeMgr.GetAll();

            config.LeagueExchanges = new List <LeagueExchangeEntity>();
            foreach (var entity in leagueExchanges)
            {
                var exchange = new LeagueExchangeEntity()
                {
                    Idx       = entity.Idx,
                    CostScore = entity.CostScore
                };
                config.LeagueExchanges.Add(exchange);
            }

            var taskList  = ConfigTaskMgr.GetAll();
            var taskList2 = ConfigTaskrequireMgr.GetAll();
            var giftItems = DicGiftpackprizeMgr.GetAll();

            foreach (var entity in taskList2)
            {
                var task = taskList.Find(d => d.Idx == entity.TaskId);
                if (!string.IsNullOrEmpty(task.RequireFuncs))
                {
                    task.RequireFuncs += ",";
                }
                task.RequireFuncs += entity.RequireType;
            }

            config.Tasks = new List <TaskDescriptionEntity>(taskList.Count);
            foreach (var entity in taskList)
            {
                config.Tasks.Add(new TaskDescriptionEntity()
                {
                    Idx           = entity.Idx,
                    Name          = entity.Name,
                    Level         = entity.ManagerLevel,
                    Description   = entity.Tip,
                    PrizeCoin     = entity.PrizeCoin,
                    PrizeExp      = entity.PrizeExp,
                    PrizeItemCode = entity.PrizeItemCode,
                    PrizeItems    = GetGiftItems(giftItems, entity.PrizeItemCode),
                    RequireFuncs  = entity.RequireFuncs,
                    TaskType      = entity.TaskType,
                    Times         = entity.Times,
                    NpcIdx        = entity.NpcIdx
                });
            }

            config.Turntable = new List <ConfigTurntableprizeEntity>();
            var allturntable = ConfigTurntableprizeMgr.GetAll();

            config.Turntable = allturntable;

            return(config);
        }