Beispiel #1
0
        public bool Load(string filePath)
        {
            CSVLoader csvLoader = new CSVLoader();

            if (!csvLoader.Load(filePath))
            {
                return(false);
            }

            Read(csvLoader);

            IsLoaded = true;

            return(true);
        }
Beispiel #2
0
        public bool Load(byte[] buffer)
        {
            CSVLoader csvLoader = new CSVLoader();

            if (!csvLoader.SecuredLoad(buffer))
            {
                return(false);
            }

            Read(csvLoader);

            IsLoaded = true;

            return(true);
        }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
0
 public virtual void Read(CSVLoader csvLoader)
 {
     Debug.LogError("ERROR : TABLE MUST BE OVERRIDE FUNCTION - Read");
 }