Example #1
0
 public static Dictionary<int, List<AchievementConditionInfo>> LoadAchievementConditionInfoDB(Dictionary<int, AchievementInfo> achievementInfos)
 {
     Dictionary<int, List<AchievementConditionInfo>> dictionary = new Dictionary<int, List<AchievementConditionInfo>>();
     using (ProduceBussiness bussiness = new ProduceBussiness())
     {
         AchievementConditionInfo[] aLlAchievementCondition = bussiness.GetALlAchievementCondition();
         using (Dictionary<int, AchievementInfo>.ValueCollection.Enumerator enumerator = achievementInfos.Values.GetEnumerator())
         {
             Func<AchievementConditionInfo, bool> predicate = null;
             AchievementInfo achievementInfo;
             while (enumerator.MoveNext())
             {
                 achievementInfo = enumerator.Current;
                 if (predicate == null)
                 {
                     predicate = s => s.AchievementID == achievementInfo.ID;
                 }
                 IEnumerable<AchievementConditionInfo> source = aLlAchievementCondition.Where<AchievementConditionInfo>(predicate);
                 dictionary.Add(achievementInfo.ID, source.ToList<AchievementConditionInfo>());
                 if (source != null)
                 {
                     foreach (AchievementConditionInfo info in source)
                     {
                         if (!m_distinctCondition.Contains(info.CondictionType))
                         {
                             m_distinctCondition.Add(info.CondictionType, info.CondictionType);
                         }
                     }
                 }
             }
         }
         foreach (AchievementConditionInfo info2 in aLlAchievementCondition)
         {
             int condictionType = info2.CondictionType;
             int item = info2.Condiction_Para2;
             if (!m_recordLimit.ContainsKey(condictionType))
             {
                 m_recordLimit.Add(condictionType, new List<int>());
             }
             if (!m_recordLimit[condictionType].Contains(item))
             {
                 m_recordLimit[condictionType].Add(item);
             }
         }
         foreach (int num in m_recordLimit.Keys)
         {
             m_recordLimit[num].Sort();
         }
     }
     return dictionary;
 }