public static void Parse(byte[] fileData) { m_DataCache.Clear(); DataStreamReader dataR = new DataStreamReader(fileData); int rowCount = dataR.GetRowCount(); int[] fieldIndex = dataR.GetFieldIndex(TDConst.GetFieldHeadIndex()); #if (UNITY_STANDALONE_WIN) || UNITY_EDITOR || UNITY_STANDALONE_OSX dataR.CheckFieldMatch(TDConst.GetFieldHeadIndex(), "TDConstTable"); #endif for (int i = 0; i < rowCount; ++i) { TDConst memberInstance = new TDConst(); memberInstance.ReadRow(dataR, fieldIndex); OnAddRow(memberInstance); } Log.i(string.Format("Parse Success TDConst")); }
public static string QueryString<T>(T type, string defaultValue = "") where T : IConvertible { TDConst td = GetData(type.ToInt32(null)); if (td != null) { return td.StringVal; } return defaultValue; }
public static float QueryFloat<T>(T type, float defaultValue = 0) where T : IConvertible { TDConst td = GetData(type.ToInt32(null)); if (td != null) { return td.FloatVal; } return defaultValue; }
public static void OnAddRow(TDConst memberInstance) { memberInstance.Reset(); string strKey = memberInstance.key; if (m_DataCache.ContainsKey(strKey)) { Log.e(string.Format("Invaild, TDConstTable Id already exists {0}", strKey)); } else { m_DataCache.Add(strKey, memberInstance); } }
static void CompleteRowAdd(TDConst tdData) { }