public DungeonTable Get(int iID) { DungeonTable rkRet = null; if (!m_kMapDatas.TryGetValue(iID, out rkRet)) { return(null); } return(rkRet); }
public bool Load(string text) { JsonData jsonData = JsonMapper.ToObject(text); for (int i = 0; i < jsonData.Count; i++) { JsonData data = jsonData[i]; DungeonTable TableInstance = new DungeonTable(); JsonData tempID = data["ID"]; TableInstance.ID = int.Parse(tempID.ToString()); JsonData tempDungeon = data["Dungeon"]; TableInstance.Dungeon = tempDungeon.ToString(); JsonData tempPlaying = data["Playing"]; TableInstance.Playing = int.Parse(tempPlaying.ToString()); JsonData tempBirthPoint1 = data["BirthPoint1"]; TableInstance.BirthPoint1 = new List <int>(); for (int j = 0; j < tempBirthPoint1.Count; j++) { string v = tempBirthPoint1[j].ToString(); if (v == "") { continue; } TableInstance.BirthPoint1.Add(int.Parse(v)); } JsonData tempBirthPoint2 = data["BirthPoint2"]; TableInstance.BirthPoint2 = new List <int>(); for (int j = 0; j < tempBirthPoint2.Count; j++) { string v = tempBirthPoint2[j].ToString(); if (v == "") { continue; } TableInstance.BirthPoint2.Add(int.Parse(v)); } //////////////////// m_kDatas.Add(TableInstance); m_kMapDatas.Add(TableInstance.ID, TableInstance); } return(true); }