Example #1
0
        /// <summary>
        /// 根据某个战场类型ID取相应的物品
        /// </summary>
        /// <param name="_nWarID"></param>
        /// <param name="_dicNewTable"></param>
        public void GetGoodsSschemdTable(int _nWarID, ref Dictionary <int, SSchemeMobaGoods> _dicNewTable)
        {
            List <int> WarIdList = null;

            char[] charSeparator = new char[] { MobaSchemesConfig.separator };

            foreach (var goods in m_dicGoodsSchemeTable)
            {
                if (WarIdList != null)
                {
                    WarIdList.Clear();
                }
                if (!string.IsNullOrEmpty(goods.Value.GoodsWarLimit))
                {
                    WarIdList = ScpReader.ConvertStringToIntArray(goods.Value.GoodsWarLimit, charSeparator);
                    if (WarIdList.IndexOf(_nWarID) != -1)
                    {
                        _dicNewTable.Add(goods.Key, goods.Value);
                    }
                }
                else if (goods.Key == 0)
                {
                    _dicNewTable.Add(goods.Key, goods.Value);
                }
            }
        }
Example #2
0
        private void SetRecommendGoodsStage(List <int> _list, string _schemesStage)
        {
            char[]     charSeparator = new char[] { MobaSchemesConfig.separator };
            List <int> intArray      = ScpReader.ConvertStringToIntArray(_schemesStage, charSeparator);

            for (int index = 0; index < intArray.Count; index++)
            {
                _list.Add(intArray[index]);
            }
        }
Example #3
0
        public List <int> GetSexCreateHeroList(PERSON_SEX _eSex)
        {
            if (_eSex == PERSON_SEX.SEX_MAX || m_dicCreateHeroConfig == null || !m_dicCreateHeroConfig.ContainsKey(_eSex))
            {
                return(null);
            }

            string strHeroList = m_dicCreateHeroConfig[_eSex].strHeroIDs;

            return(ScpReader.ConvertStringToIntArray(strHeroList, new char[] { ';' }));
        }
Example #4
0
        /// <summary>
        /// 创建当前玩家英雄后设置
        /// </summary>
        /// <param name="_heroID">当前英雄ID</param>
        private void SetCurrentHeroRecommendGoods(CreateMainHeroEntityEventArgs e)
        {
            if (MobaRecommendGoodsReader == null)
            {
                return;
            }

            int SchemesHeroID = 0;

            for (int i = 0; i < MobaRecommendGoodsReader.GetRecordCount(); i++)
            {
                // 判断英雄ID
                SchemesHeroID = MobaRecommendGoodsReader.GetInt(i, (int)EMobaRecommendGoods.EMRG_HeroID, 0);
                if (SchemesHeroID == e.MainHeroID)
                {
                    // 判断比赛类型
                    string     strMatchType  = MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_MatchTypes, "");
                    char[]     charSeparator = new char[] { MobaSchemesConfig.separator };
                    List <int> intArray      = ScpReader.ConvertStringToIntArray(strMatchType, charSeparator);
                    if (!intArray.Contains((int)e.nMatchTypeID))
                    {
                        continue;
                    }

                    // 获取装备配置
                    SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_EerlyList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_EerlyStage, "0"));
                    SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_MiddleList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_MiddleStage, "0"));
                    SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_DownWindList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_DownWindStage, "0"));
                    SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_UpWindList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_UpWindStage, "0"));
                    SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_ConsumeGoodsList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_ConsumeGoods, "0"));
                    SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_DefaultGoodsTypeList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_DefaultTypes, "0"));
                    SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_UsedStageList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_UsedStage, "0"));
                    SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_DispositionStageList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_DispositionStage, "0"));

                    CurrentHeroRecommendGoods.RecommendGoods_SummerID = MobaRecommendGoodsReader.GetInt(i, (int)EMobaRecommendGoods.EMRG_SummerID, 0);
                    SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_SummerEerlyList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_SummerEerlyStage, "0"));
                    SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_SummerMiddleList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_SummerMiddleStage, "0"));
                    SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_SummerDownWindList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_SummerDownWindStage, "0"));
                }
            }
            MobaRecommendGoodsReader.Dispose();
            MobaRecommendGoodsReader = null;

            EntityFactory.CreateMainHeroEntityEvent -= SetCurrentHeroRecommendGoods;

            if (MobaGoodsSchemesInitEndEvent != null)
            {
                MobaGoodsSchemesEventArgs a = new MobaGoodsSchemesEventArgs();
                a.RecommendGoods        = CurrentHeroRecommendGoods;
                a.LabelDescirptionTable = labelDescirptionTable;
                MobaGoodsSchemesInitEndEvent(a);
            }
        }
Example #5
0
        /// <summary>
        /// 根据物品ID查找可合成物品列表
        /// </summary>
        /// <param name="_goodsID">要查找的物品ID</param>
        /// <returns>可合成物品列表ID</returns>
        private List <int> GetCanComposeGoodsIDList(int _goodsID)
        {
            SSchemeMobaGoods goods;

            LogicDataCenter.warMobaGoodsDataManager.GetMobaGoods_Out(_goodsID, out goods);

            if (goods != null && goods.GoodsCanComposeList != null && goods.GoodsCanComposeList.Length != 0)
            {
                char[] charSeparator = new char[] { MobaSchemesConfig.separator };

                return(ScpReader.ConvertStringToIntArray(goods.GoodsCanComposeList, charSeparator));
            }

            return(null);
        }
Example #6
0
        private void InitRecommendPrizeCsv(string stPath)
        {
            char[]    charSeparator = new char[] { ';' };
            ScpReader reader        = new ScpReader(stPath, true, 2);

            for (int i = 0; i < reader.GetRecordCount(); ++i)
            {
                SSchemeRecommendPrize config = new SSchemeRecommendPrize();
                config.targetID      = reader.GetInt(i, (int)ECOLUMNType.TARGET_ID, 0);
                config.totalNumGames = reader.GetInt(i, (int)ECOLUMNType.TOTAL_NUMBER_OF_GAMES, 0);
                string szPrizes = reader.GetString(i, (int)ECOLUMNType.PRIZE_ID, "");
                config.prizeList = ScpReader.ConvertStringToIntArray(szPrizes, charSeparator);
                m_listConfig.Add(config);
            }
        }
Example #7
0
        /// <summary>
        /// 获取指定物品合成所需物品ID列表
        /// </summary>
        /// <param name="_nGoodsID"></param>
        /// <returns></returns>
        public List <int> GetSchemeGoodsNeedComposeList(int _nGoodsID)
        {
            SSchemeMobaGoods goods;

            GetMobaGoods_Out(_nGoodsID, out goods);


            if (goods.GoodsNeedComposeList != null && goods.GoodsNeedComposeList.Length != 0)
            {
                char[] charSeparator = new char[] { MobaSchemesConfig.separator };

                return(ScpReader.ConvertStringToIntArray(goods.GoodsNeedComposeList, charSeparator));
            }

            return(null);
        }
Example #8
0
        /// <summary>
        /// 从配置获取各推荐物品
        /// </summary>
        /// <param name="_list">推荐物品列表</param>
        /// <param name="_schemesStage">推荐物品配置值</param>
        private void SetRecommendGoodsStage(List <SSchemeMobaGoods> _list, string _schemesStage)
        {
            char[]     charSeparator = new char[] { MobaSchemesConfig.separator };
            List <int> intArray      = ScpReader.ConvertStringToIntArray(_schemesStage, charSeparator);

            for (int index = 0; index < intArray.Count; index++)
            {
                SSchemeMobaGoods goods = null;

                if (!LogicDataCenter.warMobaGoodsDataManager.GetMobaGoods_Out(intArray[index], out goods))
                {
                    goods = new SSchemeMobaGoods();
                }

                _list.Add(goods);
            }
        }
Example #9
0
        private void InitLifeHeroPrizeCsv(string stPath)
        {
            char[]    charSeparator = new char[] { ';' };
            ScpReader reader        = new ScpReader(stPath, true, 2);

            for (int i = 0; i < reader.GetRecordCount(); ++i)
            {
                int col = 0;
                SSchemeLifeHeroPrize lifeHero = new SSchemeLifeHeroPrize();
                int key = reader.GetInt(i, col++, 0);
                lifeHero.heroCount = reader.GetInt(i, col++, 0);
                lifeHero.starLv    = reader.GetInt(i, col++, 0);
                string prizeIDs = reader.GetString(i, col++, "");
                lifeHero.prizeIDList = ScpReader.ConvertStringToIntArray(prizeIDs, charSeparator);
                lifeHero.prizeDesc   = reader.GetString(i, col++, "");
                lifeHeroPrizeList.Add(lifeHero);
            }
        }
Example #10
0
        private void InitGodRecommdEquip(string _defaultViewConfigPath)
        {
            string    stPath = _defaultViewConfigPath + MobaSchemesConfig.GOD_RECOMMD_EQUIPSCHEME;
            ScpReader reader = new ScpReader(stPath, true, 2);

            godRecommdEquipConfigList = new Dictionary <int, List <SSchemeGodRecommdEquip> >();
            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                SSchemeGodRecommdEquip sConfig = new SSchemeGodRecommdEquip();
                sConfig.LeagueName = reader.GetString(i, (int)EGodRecommdEquip.EGRE_LeagueName, "");
                sConfig.LeagueType = reader.GetInt(i, (int)EGodRecommdEquip.EGRE_LeagueType, 0);
                sConfig.Title      = reader.GetString(i, (int)EGodRecommdEquip.EGRE_Title, "");
                sConfig.HeroID     = reader.GetInt(i, (int)EGodRecommdEquip.EGRE_HeroID, 0);
                sConfig.SchemeName = reader.GetString(i, (int)EGodRecommdEquip.EGRE_SchemeName, "");
                sConfig.AuthorName = reader.GetString(i, (int)EGodRecommdEquip.EGRE_AuthorName, "");

                sConfig.nEquipList = new int[USpeedUI.UDefines.nEquipSchemeMaxEquipNum];
                string strEquipList  = reader.GetString(i, (int)EGodRecommdEquip.EGRE_EquipList, "");
                char[] charSeparator = new char[] { MobaSchemesConfig.separator };

                List <int> intList = ScpReader.ConvertStringToIntArray(strEquipList, charSeparator);
                if (intList.Count != USpeedUI.UDefines.nEquipSchemeMaxEquipNum)
                {
                    UnityEngine.Debug.LogError("装备列表数量不对,请策划检查配置:" + stPath + ",第" + i + 1 + "条数据");
                    return;
                }
                for (int j = 0; j < USpeedUI.UDefines.nEquipSchemeMaxEquipNum; j++)
                {
                    sConfig.nEquipList[j] = intList[j];
                }

                if (!godRecommdEquipConfigList.ContainsKey(sConfig.HeroID))
                {
                    godRecommdEquipConfigList.Add(sConfig.HeroID, new List <SSchemeGodRecommdEquip>());
                }

                godRecommdEquipConfigList[sConfig.HeroID].Add(sConfig);
            }

            reader.Dispose();
        }
Example #11
0
        protected void _LoadGuideNodeConfig(string _strPath)
        {
            dicGuideConfigTable = new Dictionary <EGuideNodeID, SSchemeGuideNodeData>();

            ScpReader reader = new ScpReader(_strPath, true);

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                SSchemeGuideNodeData sConfig = new SSchemeGuideNodeData();
                sConfig.nGuideID = reader.GetInt(i, (int)EGuideNodeConfig.GuideID, -1);

                sConfig.GuideStringParams = ScpReader.ToStringList(reader.GetString(i, (int)EGuideNodeConfig.GuideActionStringParams, ""), new char[] { ';' });
                sConfig.GuideIntParams    = ScpReader.ConvertStringToIntArray(reader.GetString(i, (int)EGuideNodeConfig.GuideActionIntParams, ""), new char[] { ';' });
                //sConfig.GuidePreconditionIntParams = ScpReader.ConvertStringToIntArray(reader.GetString(i, (int)EGuideNodeConfig.GuidePreconditionIntParams, ""), new char[] { ';' });

                sConfig.nGuideActionLayerType = reader.GetInt(i, (int)EGuideNodeConfig.GuideActionLayerType, 0);

                dicGuideConfigTable.Add((EGuideNodeID)sConfig.nGuideID, sConfig);
            }
            reader.Dispose();
            reader = null;
        }
Example #12
0
        protected void _LoadGuideStateConfig(string _strPath)
        {
            dicGuideStateConfigTable = new List <SSchemeGuideStateData>();

            ScpReader reader = new ScpReader(_strPath, true);

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                SSchemeGuideStateData sConfig = new SSchemeGuideStateData();

                sConfig.GuideStateID     = reader.GetInt(i, (int)EGuideStateData.EGSD_GuideStateID, -1);
                sConfig.GameStateID      = (EStage_State)reader.GetInt(i, (int)EGuideStateData.EGSD_GameState, 0);
                sConfig.UserIDType       = (EGuideStateUserIDType)reader.GetInt(i, (int)EGuideStateData.EGSD_UserIDType, 0);
                sConfig.UserID           = reader.GetInt(i, (int)EGuideStateData.EGSD_UserID, -1);
                sConfig.GuideRootType    = (EGuideActionLayerType)reader.GetInt(i, (int)EGuideStateData.EGSD_GuideRootType, -1);
                sConfig.GuideNodeIDList  = ScpReader.ConvertStringToIntArray(reader.GetString(i, (int)EGuideStateData.EGSD_GuideNodeIDList, ""), new char[] { ';' });
                sConfig.PlayerLevelLimit = reader.GetInt(i, (int)EGuideStateData.EGSD_PlayerLevelLimit, -1);

                dicGuideStateConfigTable.Add(sConfig);
            }
            reader.Dispose();
            reader = null;
        }