Пример #1
0
 public static bool IsAllLevelsCleared()
 {
     if (!_hasCheckedAllLevelsCleared)
     {
         _isAllLevelsCleared = false;
         try
         {
             ChapterDataItem theLastStoryChapter = GetTheLastStoryChapter(Singleton <LevelModule> .Instance.AllChapterList);
             List <int>      chapterLevelIdList  = LevelMetaDataReaderExtend.GetChapterLevelIdList(theLastStoryChapter.chapterId);
             chapterLevelIdList.Sort();
             foreach (LevelDataItem item2 in theLastStoryChapter.GetAllLevelList())
             {
                 if (item2.levelId == chapterLevelIdList[chapterLevelIdList.Count - 1])
                 {
                     _isAllLevelsCleared = item2.status != 1;
                     break;
                 }
             }
             _hasCheckedAllLevelsCleared = true;
         }
         catch
         {
             return(false);
         }
     }
     return(_isAllLevelsCleared);
 }
Пример #2
0
        private List <LevelDataItem> AddStoryLevel(LevelDataItem m_level)
        {
            List <LevelDataItem> list = new List <LevelDataItem>();

            foreach (int num in LevelMetaDataReaderExtend.GetChapterLevelIdList(m_level.ChapterID))
            {
                LevelDataItem item = (m_level.levelId != num) ? new LevelDataItem(num) : m_level;
                if (!this._chapterLevelDict.ContainsKey(item.Diffculty))
                {
                    this._chapterLevelDict.Add(item.Diffculty, new List <LevelDataItem>());
                }
                this._chapterLevelDict[item.Diffculty].Add(item);
                list.Add(item);
            }
            return(list);
        }