public bool Load(string filePath) { CSVLoader csvLoader = new CSVLoader(); if (!csvLoader.Load(filePath)) { return(false); } Read(csvLoader); IsLoaded = true; return(true); }
public bool Load(byte[] buffer) { CSVLoader csvLoader = new CSVLoader(); if (!csvLoader.SecuredLoad(buffer)) { return(false); } Read(csvLoader); IsLoaded = true; return(true); }
public override void Read(CSVLoader csvLoader) { dictionaryData.Clear(); int colIdx, stringId; string enumString; for (int i = 0; i < csvLoader.Rows; ++i) { colIdx = 0; Data newData = new Data(); csvLoader.ReadValue(colIdx++, i, 0, out newData.id); csvLoader.ReadValue(colIdx++, i, "", out enumString); if (Common.TryParseEnum(enumString, out newData.type) != true) { throw new System.Exception(string.Format("Table Skill unkown enum string:{0}, column:{1}", enumString, i + 1)); } csvLoader.ReadValue(colIdx++, i, 0, out newData.ap); csvLoader.ReadValue(colIdx++, i, 0, out newData.cooltime); dictionaryData.Add(newData.id, newData); } }
public virtual void Read(CSVLoader csvLoader) { Debug.LogError("ERROR : TABLE MUST BE OVERRIDE FUNCTION - Read"); }