public DungeonInfo GetDungeonInfo(int dungeonID) { DungeonInfo dungeonInfo = null; DungeonInfoDictionary.TryGetValue(dungeonID, out dungeonInfo); return(dungeonInfo); }
public void ResetDungeonInfoDictionary(int lastDungeonId, List <int> getRewardDungeonIds) { // List <ExpeditionDungeonInfo> infoList = DungeonInfoDictionary.GetValues(); int count = infoList.Count; //ExpeditionData data; ExpeditionDungeonInfo info; for (int i = 0; i < count; i++) { info = infoList[i]; info.SetFinished(info.id <= lastDungeonId); info.SetUnlocked(info.id <= lastDungeonId); info.SetGetReward(info.id <= lastDungeonId); } //unlock if (lastDungeonId == -1) { ExpeditionData firstData = ExpeditionData.ExpeditionDataDictionary.First().Value; CurrentExpeditionDungeonId = firstData.id; DungeonInfoDictionary[firstData.id].SetUnlocked(true); } else { ExpeditionData nextData = ExpeditionData.GetNextExpeditionData(lastDungeonId); if (nextData != null) { CurrentExpeditionDungeonId = nextData.id; DungeonInfoDictionary[nextData.id].SetUnlocked(true); if (nextData.type != (int)ExpeditionDungeonType.Expedition_Normal) { DungeonInfoDictionary[nextData.id].SetFinished(true); } } else { CurrentExpeditionDungeonId = lastDungeonId; } } //reward if (getRewardDungeonIds != null) { count = getRewardDungeonIds.Count; int rewardId; for (int i = 0; i < count; i++) { rewardId = getRewardDungeonIds[i]; if (DungeonInfoDictionary.ContainsKey(rewardId)) { DungeonInfoDictionary[rewardId].SetGetReward(true); } } } if (onUpdateResetSucDelegate != null) { onUpdateResetSucDelegate(); } }
public List <DungeonInfo> GetDungeonInfos(int[] dungeonIDs) { List <DungeonInfo> dungeonInfos = new List <DungeonInfo>(); int dungeonIDsCount = dungeonIDs.Length; for (int i = 0; i < dungeonIDsCount; i++) { DungeonInfo dungeonInfo = null; DungeonInfoDictionary.TryGetValue(dungeonIDs[i], out dungeonInfo); if (dungeonInfo != null) { dungeonInfos.Add(dungeonInfo); } } return(dungeonInfos); }
public List <ExpeditionDungeonInfo> GetDungeonInfoListByChapter(int chapterId) { List <ExpeditionDungeonInfo> infoList = DungeonInfoDictionary.GetValues(); List <ExpeditionDungeonInfo> infoTempList = new List <ExpeditionDungeonInfo>(); int count = infoList.Count; ExpeditionDungeonInfo data; for (int i = 0; i < count; i++) { data = infoList[i]; if (data.data.chapter == chapterId) { infoTempList.Add(data); } } return(infoTempList); }
public ExpeditionDungeonInfo GetDungeonInfo(int id) { ExpeditionDungeonInfo info = DungeonInfoDictionary.TryGet(id); return(info); }