public bool Load(string text) { JsonData jsonData = JsonMapper.ToObject(text); for (int i = 0; i < jsonData.Count; i++) { JsonData data = jsonData[i]; ElementTable TableInstance = new ElementTable(); JsonData tempID = data["ID"]; TableInstance.ID = int.Parse(tempID.ToString()); JsonData tempArtResource1 = data["ArtResource1"]; TableInstance.ArtResource1 = tempArtResource1.ToString(); JsonData tempArtResource2 = data["ArtResource2"]; TableInstance.ArtResource2 = tempArtResource2.ToString(); JsonData tempStop = data["Stop"]; TableInstance.Stop = int.Parse(tempStop.ToString()); JsonData tempDestroy1 = data["Destroy1"]; TableInstance.Destroy1 = int.Parse(tempDestroy1.ToString()); JsonData tempDestroy2 = data["Destroy2"]; TableInstance.Destroy2 = int.Parse(tempDestroy2.ToString()); JsonData tempTime = data["Time"]; TableInstance.Time = int.Parse(tempTime.ToString()); JsonData tempInvisible = data["Invisible"]; TableInstance.Invisible = int.Parse(tempInvisible.ToString()); //////////////////// m_kDatas.Add(TableInstance); m_kMapDatas.Add(TableInstance.ID, TableInstance); } return(true); }
public ElementTable Get(int iID) { ElementTable rkRet = null; if (!m_kMapDatas.TryGetValue(iID, out rkRet)) { return(null); } return(rkRet); }