Exemple #1
0
 public void ParseLevelRewardData()
 {
     Dictionary <long, object> .Enumerator enumerator = GameDataMgr.resPvpLevelRewardDatabin.GetEnumerator();
     while (enumerator.MoveNext())
     {
         KeyValuePair <long, object> current           = enumerator.get_Current();
         ResPvpLevelReward           resPvpLevelReward = (ResPvpLevelReward)current.get_Value();
         if (resPvpLevelReward != null)
         {
             if (this.GetLevelRewardData(resPvpLevelReward.iLevel) == null)
             {
                 LevelRewardData levelRewardData = new LevelRewardData();
                 levelRewardData.m_level          = resPvpLevelReward.iLevel;
                 levelRewardData.m_resLevelReward = resPvpLevelReward;
                 DebugHelper.Assert(resPvpLevelReward.astLockInfo.Length <= 2, "ParseLevelRewardData 等级奖励配置表配 解锁数量不该超过2个, 翔哥 check out...");
                 for (int i = 0; i < resPvpLevelReward.astLockInfo.Length; i++)
                 {
                     ResDT_LevelReward_UnlockInfo resDT_LevelReward_UnlockInfo = resPvpLevelReward.astLockInfo[i];
                     if (resDT_LevelReward_UnlockInfo != null)
                     {
                         levelRewardData.astLockInfo[i] = resDT_LevelReward_UnlockInfo;
                     }
                 }
                 this.m_levelRewardDataMap.Add(levelRewardData);
             }
         }
     }
     Dictionary <long, object> .Enumerator enumerator2 = GameDataMgr.taskDatabin.GetEnumerator();
     while (enumerator2.MoveNext())
     {
         KeyValuePair <long, object> current2 = enumerator2.get_Current();
         ResTask resTask = (ResTask)current2.get_Value();
         if (resTask != null)
         {
             if (resTask.dwOpenType == 2u)
             {
                 int             iParam           = resTask.astOpenTaskParam[0].iParam;
                 LevelRewardData levelRewardData2 = this.GetLevelRewardData(iParam);
                 if (levelRewardData2 != null && levelRewardData2.GetResTaskIDIndex(resTask.dwTaskID) == -1)
                 {
                     int fristNullResTaskIndex = levelRewardData2.GetFristNullResTaskIndex();
                     if (fristNullResTaskIndex != -1)
                     {
                         levelRewardData2.task_ids[fristNullResTaskIndex] = resTask;
                     }
                 }
             }
         }
     }
 }
Exemple #2
0
 public void ParseLevelRewardData()
 {
     Dictionary <long, object> .Enumerator enumerator = GameDataMgr.resPvpLevelRewardDatabin.GetEnumerator();
     while (enumerator.MoveNext())
     {
         KeyValuePair <long, object> current = enumerator.Current;
         ResPvpLevelReward           reward  = (ResPvpLevelReward)current.Value;
         if (reward != null)
         {
             LevelRewardData item = null;
             if (this.GetLevelRewardData(reward.iLevel) == null)
             {
                 item = new LevelRewardData {
                     m_level          = reward.iLevel,
                     m_resLevelReward = reward
                 };
                 DebugHelper.Assert(reward.astLockInfo.Length <= 2, "ParseLevelRewardData 等级奖励配置表配 解锁数量不该超过2个, 翔哥 check out...");
                 for (int i = 0; i < reward.astLockInfo.Length; i++)
                 {
                     ResDT_LevelReward_UnlockInfo info = reward.astLockInfo[i];
                     if (info != null)
                     {
                         item.astLockInfo[i] = info;
                     }
                 }
                 this.m_levelRewardDataMap.Add(item);
             }
         }
     }
     Dictionary <long, object> .Enumerator enumerator2 = GameDataMgr.taskDatabin.GetEnumerator();
     while (enumerator2.MoveNext())
     {
         KeyValuePair <long, object> pair2 = enumerator2.Current;
         ResTask task = (ResTask)pair2.Value;
         if ((task != null) && (task.dwOpenType == 2))
         {
             int             iParam          = task.astOpenTaskParam[0].iParam;
             LevelRewardData levelRewardData = this.GetLevelRewardData(iParam);
             if ((levelRewardData != null) && (levelRewardData.GetResTaskIDIndex(task.dwTaskID) == -1))
             {
                 int fristNullResTaskIndex = levelRewardData.GetFristNullResTaskIndex();
                 if (fristNullResTaskIndex != -1)
                 {
                     levelRewardData.task_ids[fristNullResTaskIndex] = task;
                 }
             }
         }
     }
 }