Example #1
0
 public static Tab_Event LoadTableItem(int nIdx, Hashtable _tab, DataTableStructure _tabStructure)
 {
     string[] rows = _tabStructure.GetRow(nIdx);
     if (rows != null)
     {
         return(SerializableTableItem(rows, nIdx, _tab));
     }
     return(null);
 }
Example #2
0
        public static bool LoadTable(Hashtable _tab, DataTableStructure _tabStructure, bool _isDeseriaAll)
        {
            if (!DataTable.ReaderPList(GetInstanceFile(), VALUE_NUM_PER_ROW, SerializableTable, _tab, _tabStructure, _isDeseriaAll))

            {
                throw  TableException.ErrorReader("Load File{0} Fail!!!", GetInstanceFile());
            }
            IsTableLoaded = true;
            return(true);
        }
Example #3
0
        public static bool ReaderPList(String _tabName, int valueNum, SerializableTable _fun, Hashtable _hash, DataTableStructure _tableStructture, bool _isDeseriaAll)

        {
            TextAsset txtAsset = Resources.Load(_tabName, typeof(TextAsset)) as TextAsset;

            string[] alldataRow = txtAsset.text.Split('\n');
            string[] values     = new string[valueNum];
            int      cnt        = alldataRow.Length;
            string   line       = "";

            for (int idx = 0; idx < cnt; ++idx)
            {
                line = alldataRow[idx];
                if (String.IsNullOrEmpty(line))
                {
                    continue;
                }
                string[] strCol = line.Split('\t');
                if (strCol.Length == 0)
                {
                    continue;
                }
                string skey = strCol[0];
                Array.Copy(strCol, 1, values, 0, valueNum);
                if (string.IsNullOrEmpty(skey))
                {
                    return(false);
                }
                _fun(values, int.Parse(skey), _hash);
            }

            return(true);
        }