public static Dictionary <int, List <AchievementConditionInfo> > LoadAchievementConditionInfoDB(Dictionary <int, AchievementInfo> achievementInfos)
        {
            Dictionary <int, List <AchievementConditionInfo> > list = new Dictionary <int, List <AchievementConditionInfo> >();

            using (ProduceBussiness db = new ProduceBussiness())
            {
                AchievementConditionInfo[] infos = db.GetALlAchievementCondition();
                foreach (AchievementInfo achievementInfo in achievementInfos.Values)
                {
                    IEnumerable <AchievementConditionInfo> temp =
                        from s in infos
                        where s.AchievementID == achievementInfo.ID
                        select s;
                    list.Add(achievementInfo.ID, temp.ToList <AchievementConditionInfo>());
                    if (temp != null)
                    {
                        foreach (AchievementConditionInfo info in temp)
                        {
                            if (!AchievementMgr.m_distinctCondition.Contains(info.CondictionType))
                            {
                                AchievementMgr.m_distinctCondition.Add(info.CondictionType, info.CondictionType);
                            }
                        }
                    }
                }
            }
            return(list);
        }
Exemple #2
0
        public static Dictionary <int, List <AchievementConditionInfo> > LoadAchievementConditionInfoDB(Dictionary <int, AchievementInfo> achievementInfos)
        {
            Dictionary <int, List <AchievementConditionInfo> > dictionary = new Dictionary <int, List <AchievementConditionInfo> >();

            using (ProduceBussiness produceBussiness = new ProduceBussiness())
            {
                AchievementConditionInfo[] aLlAchievementCondition = produceBussiness.GetALlAchievementCondition();
                using (Dictionary <int, AchievementInfo> .ValueCollection.Enumerator enumerator = achievementInfos.Values.GetEnumerator())
                {
                    Func <AchievementConditionInfo, bool> func = null;
                    AchievementInfo achievementInfo;
                    while (enumerator.MoveNext())
                    {
                        achievementInfo = enumerator.Current;
                        if (func == null)
                        {
                            func = ((AchievementConditionInfo s) => s.AchievementID == achievementInfo.ID);
                        }
                        IEnumerable <AchievementConditionInfo> enumerable = aLlAchievementCondition.Where(func);
                        dictionary.Add(achievementInfo.ID, enumerable.ToList <AchievementConditionInfo>());
                        if (enumerable != null)
                        {
                            foreach (AchievementConditionInfo current in enumerable)
                            {
                                if (!AchievementMgr.m_distinctCondition.Contains(current.CondictionType))
                                {
                                    AchievementMgr.m_distinctCondition.Add(current.CondictionType, current.CondictionType);
                                }
                            }
                        }
                    }
                }
                AchievementConditionInfo[] array = aLlAchievementCondition;
                for (int i = 0; i < array.Length; i++)
                {
                    AchievementConditionInfo achievementConditionInfo = array[i];
                    int condictionType  = achievementConditionInfo.CondictionType;
                    int condiction_Para = achievementConditionInfo.Condiction_Para2;
                    if (!AchievementMgr.m_recordLimit.ContainsKey(condictionType))
                    {
                        AchievementMgr.m_recordLimit.Add(condictionType, new List <int>());
                    }
                    if (!AchievementMgr.m_recordLimit[condictionType].Contains(condiction_Para))
                    {
                        AchievementMgr.m_recordLimit[condictionType].Add(condiction_Para);
                    }
                }
                foreach (int current2 in AchievementMgr.m_recordLimit.Keys)
                {
                    AchievementMgr.m_recordLimit[current2].Sort();
                }
            }
            return(dictionary);
        }
        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);
        }
Exemple #4
0
        public static Dictionary <int, List <AchievementConditionInfo> > LoadAchievementConditionInfoDB(Dictionary <int, AchievementInfo> achievementInfos)
        {
            Dictionary <int, List <AchievementConditionInfo> > dictionary = new Dictionary <int, List <AchievementConditionInfo> >();

            using (ProduceBussiness produceBussiness = new ProduceBussiness())
            {
                AchievementConditionInfo[] achievementCondition = produceBussiness.GetALlAchievementCondition();
                using (Dictionary <int, AchievementInfo> .ValueCollection.Enumerator enumerator = achievementInfos.Values.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        AchievementInfo achievementInfo = enumerator.Current;
                        IEnumerable <AchievementConditionInfo> source = Enumerable.Where <AchievementConditionInfo>((IEnumerable <AchievementConditionInfo>)achievementCondition, (Func <AchievementConditionInfo, bool>)(s => s.AchievementID == achievementInfo.ID));
                        dictionary.Add(achievementInfo.ID, Enumerable.ToList <AchievementConditionInfo>(source));
                        if (source != null)
                        {
                            foreach (AchievementConditionInfo achievementConditionInfo in source)
                            {
                                if (!AchievementMgr.m_distinctCondition.Contains((object)achievementConditionInfo.CondictionType))
                                {
                                    AchievementMgr.m_distinctCondition.Add((object)achievementConditionInfo.CondictionType, (object)achievementConditionInfo.CondictionType);
                                }
                            }
                        }
                    }
                }
                foreach (AchievementConditionInfo achievementConditionInfo in achievementCondition)
                {
                    int condictionType  = achievementConditionInfo.CondictionType;
                    int condictionPara2 = achievementConditionInfo.Condiction_Para2;
                    if (!AchievementMgr.m_recordLimit.ContainsKey(condictionType))
                    {
                        AchievementMgr.m_recordLimit.Add(condictionType, new List <int>());
                    }
                    if (!AchievementMgr.m_recordLimit[condictionType].Contains(condictionPara2))
                    {
                        AchievementMgr.m_recordLimit[condictionType].Add(condictionPara2);
                    }
                }
                foreach (int index in AchievementMgr.m_recordLimit.Keys)
                {
                    AchievementMgr.m_recordLimit[index].Sort();
                }
            }
            return(dictionary);
        }