Example #1
0
        //public static DescriptionConfigPlayerKpiEntity ExportPlaryKpi()
        //{
        //    var config = new DescriptionConfigPlayerKpiEntity();
        //    var player = DicPlayerMgr.GetAll();

        //    var result = player.FindAll(r => r.Kpi >= 80 && r.Kpi <= 108);
        //    List<PlayerKpiEntity> list = new List<PlayerKpiEntity>();
        //    foreach (var item in result)
        //    {
        //        PlayerKpiEntity entity = new PlayerKpiEntity();
        //        entity.PlayerId = item.Idx;
        //        entity.Name = item.Name;
        //        entity.Kpi = item.Kpi;
        //        list.Add(entity);
        //    }
        //    config.Player = list.OrderByDescending(r => r.Kpi).ToList();
        //    return config;
        //}
        #endregion

        #region ExportNameLibrary
        public static NameLibraryEntity ExportNameLibrary()
        {
            var tips = new NameLibraryEntity();

            tips.Prefix      = DicNameprefixMgr.GetAll();
            tips.Suffix      = DicNamesuffixMgr.GetAll();
            tips.PlayerNames = TemplateRegisterMgr.GetPlayerNameList();

            return(tips);
        }
Example #2
0
        void CreateTemplate(List <DicPlayerEntity> list)
        {
            var        positionList  = BuildTemplatePosition();
            var        conditionList = BuildTemplateCondition();
            string     s             = "";
            List <int> ids           = new List <int>(11);
            //for (int i = 0; i < 11; i++)
            //{
            //    var items = list.FindAll(d => d.Position == (int)positionList[i].Position
            //        &&d.Kpi>=conditionList[i].MinPower && d.Kpi<=conditionList[i].MaxPower);
            //    var item = items[RandomHelper.GetInt32WithoutMax(0, items.Count)];
            //    while (ids.Contains(item.Idx))
            //    {
            //        item = items[RandomHelper.GetInt32WithoutMax(0, items.Count)];
            //    }
            //    ids.Add(item.Idx);
            //    s += item.Idx + ",";
            //}
            //不能有元老卡
            DTOBuffMemberView view = new DTOBuffMemberView();

            view.BuffMembers = new Dictionary <Guid, NbManagerbuffmemberEntity>();
            for (int i = 0; i < 7; i++)
            {
                var condition = conditionList[i];
                if (condition.MaxPower == 0)
                {
                    condition.MaxPower = 200;
                }
                var position = positionList[i];
                var items    = list.FindAll(d => d.Position == (int)position.Position && d.CardLevel == condition.CardLevel &&
                                            d.Capacity >= condition.MinPower && d.Capacity <= condition.MaxPower);
                var item = items[RandomHelper.GetInt32WithoutMax(0, items.Count)];
                while (ids.Contains(item.Idx))
                {
                    item = items[RandomHelper.GetInt32WithoutMax(0, items.Count)];
                }
                view.BuffMembers.Add(Guid.NewGuid(), BuildBuffMember(item));
                ids.Add(item.Idx);
                s += item.Idx + ",";
            }
            MatchDataHelper.CalKpi(view);
            s = s.TrimEnd(',');
            TemplateRegisterMgr.Add(s, view.Kpi);
        }
Example #3
0
 void InitCache()
 {
     _registerList = TemplateRegisterMgr.GetAll();
     foreach (var entity in _registerList)
     {
         var ss = entity.SolutionString.Split(',');
         foreach (var s in ss)
         {
             var pid    = ConvertHelper.ConvertToInt(s);
             var pcache = CacheFactory.PlayersdicCache.GetPlayer(pid);
             if (pcache != null && pcache.CardLevel == (int)EnumPlayerCardLevel.Orange)
             {
                 entity.OrangeCount++;
             }
         }
     }
     _registerDic = _registerList.ToDictionary(d => d.Idx, d => d);
 }