Exemplo n.º 1
0
        // 初始化csv表
        protected void InitMatchRoomOpenAILevelConfigCsv(string stPath)
        {
            // string stSchemeAllText = File.ReadAllText(stPath);
            ScpReader reader = new ScpReader(stPath, true, 2);

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                SSchemeMatchRoomOpenAILevel sConfig = new SSchemeMatchRoomOpenAILevel();
                sConfig.nMatchTypeID = reader.GetInt(i, (int)EMatchRoomOpenAILevel.ERC_MATCHTYPE_ID, 0);
                sConfig.AILevelDes   = reader.GetString(i, (int)EMatchRoomOpenAILevel.ERC_AILEVEL_DES, "");
                sConfig.AILevelScore = reader.GetString(i, (int)EMatchRoomOpenAILevel.ERC_AILEVEL_SCORE, "");

                // 配置检查
                string[] AILevelDesStr = sConfig.AILevelDes.Split(';');
                int      nDescLength   = AILevelDesStr.Length;

                string[] AIScoreArrayStr = sConfig.AILevelScore.Split(';');
                int      nScoreLength    = AIScoreArrayStr.Length;

                if (nDescLength != nScoreLength)
                {
                    Trace.LogError("配置出错 请检查 MatchRoomOpenAILevel.csv 位置:=(" + (i + 1) + ")行");
                }

                if (allOpenAILevelTable.ContainsKey(sConfig.nMatchTypeID))
                {
                    Trace.LogError("重复id 检查配置MatchRoomOpenAILevel.csv!id =" + sConfig.nMatchTypeID);
                }

                allOpenAILevelTable.Add(sConfig.nMatchTypeID, sConfig);
            }
        }
Exemplo n.º 2
0
 // 根据id获得天赋效果信息
 public void GetOpenAILevel(int nMatchTypeID, ref SSchemeMatchRoomOpenAILevel sAILevelConfig)
 {
     if (!allOpenAILevelTable.ContainsKey(nMatchTypeID))
     {
         sAILevelConfig = null;
     }
     sAILevelConfig = allOpenAILevelTable[nMatchTypeID] as SSchemeMatchRoomOpenAILevel;
 }