using System.Collections.Generic; namespace MoleMole { public class LevelMetaDataReaderExtend { private static Dictionary> _chapterMap; public static void LoadFromFileAndBuildMap() { LevelMetaDataReader.LoadFromFile(); List itemList = LevelMetaDataReader.GetItemList(); _chapterMap = new Dictionary>(); foreach (LevelMetaData item in itemList) { if (!_chapterMap.ContainsKey(item.chapterId)) { _chapterMap.Add(item.chapterId, new List()); } _chapterMap[item.chapterId].Add(item.levelId); } } public static List GetChapterLevelIdList(int chapterId) { if (!_chapterMap.ContainsKey(chapterId)) { return new List(); } return _chapterMap[chapterId]; } } }