Пример #1
0
 public static void LoadList()
 {
     PokeList   = OpenCsv("apse_pokelist.csv");
     itemlist   = OpenCsv("apse_item2list.csv");
     movelist   = OpenCsv("apse_move.csv");
     naturelist = OpenCsv("apse_pnature.csv");
 }
Пример #2
0
        public static SelectBoxItemArrayList OpenCsv(string fileName)
        {
            SelectBoxItemArrayList list = new SelectBoxItemArrayList();

            string[] strArray = File.ReadAllLines(DataDirectory + fileName, Encoding.GetEncoding("UTF-8"));
            for (int i = 0; i < strArray.Length; i++)
            {
                string[] strArray2 = strArray[i].Split(new char[] { ';' });
                if (!string.IsNullOrEmpty(strArray2[0]))
                {
                    string[] strArray3 = strArray2[0].Split(new char[] { ',', '\t' });
                    list.Add(strArray3[1], int.Parse(strArray3[0]));
                }
            }
            return(list);
        }