private static void _loadDataQuest(AbstractDb <int> db, string file) { var table = db.Table; TextFileHelper.LatestFile = file; try { foreach (string[] elements in TextFileHelper.GetElementsInt(db.ProjectDatabase.MetaGrf.GetData(file))) { int itemId = Int32.Parse(elements[0]); table.SetRaw(itemId, ClientQuestsAttributes.Name, elements[1]); table.SetRaw(itemId, ClientQuestsAttributes.SG, elements[2]); table.SetRaw(itemId, ClientQuestsAttributes.QUE, elements[3]); table.SetRaw(itemId, ClientQuestsAttributes.FullDesc, elements[4]); table.SetRaw(itemId, ClientQuestsAttributes.ShortDesc, elements[5]); } Debug.Ignore(() => DbDebugHelper.OnLoaded(db.DbSource, db.ProjectDatabase.MetaGrf.FindTkPath(file), db)); } catch (Exception err) { Debug.Ignore(() => DbDebugHelper.OnExceptionThrown(db.DbSource, file, db)); throw new Exception(TextFileHelper.GetLastError(), err); } }
private static void _loadData <T>(AbstractDb <T> db, string file, DbAttribute attribute, bool allowCutLine = true, bool removeUnderscore = false) { var table = db.Table; TextFileHelper.LatestFile = file; try { foreach (string[] elements in TextFileHelper.GetElements(db.ProjectDatabase.MetaGrf.GetData(file), allowCutLine)) { T itemId = (T)TypeDescriptor.GetConverter(typeof(T)).ConvertFrom(elements[0]); table.SetRaw(itemId, attribute, removeUnderscore ? elements[1].Replace("_", " ") : elements[1]); } Debug.Ignore(() => DbDebugHelper.OnLoaded(db.DbSource, db.ProjectDatabase.MetaGrf.FindTkPath(file), db)); } catch (Exception err) { Debug.Ignore(() => DbDebugHelper.OnExceptionThrown(db.DbSource, file, db)); throw new Exception(TextFileHelper.GetLastError(), err); } }