예제 #1
0
파일: CSVSheet.cs 프로젝트: pb0/ID0_Test
 public static CSVSheet Create(string filePath)
 {
     TextAsset csvFile = Resources.Load(filePath) as TextAsset;
     if (csvFile != null)
     {
         var ret = new CSVSheet(filePath, new TextLine(csvFile.text));
         //Debug.Log(ret.Dump());
         return ret;
     }
     return null;
 }
예제 #2
0
        private void LoadCategoriesFromSheet(CategoryCollection categories, CSVSheet sheet)
        {
            categories.Clear();
            for (int x = 0; x < sheet.Columns; x++) {
                string category = sheet[x, 0];
                if (String.IsNullOrEmpty(category))
                    continue;

                for (int y = 1; y < sheet.Rows; y++)
                    if (!String.IsNullOrEmpty(sheet[x, y]))
                        categories.AddCard(category, sheet[x, y]);
            }
        }
예제 #3
0
 private CSVSheet SaveCategoriesToSheet(CategoryCollection categories)
 {
     CSVSheet sheet = new CSVSheet();
     for (int x = 0; x < categories.Count; x++) {
         sheet[x, 0] = categories[x].Name;
         for (int y = 0; y < categories[x].Cards.Count; y++)
             sheet[x, y + 1] = categories[x].Cards[y];
     }
     return sheet;
 }
예제 #4
0
 StringEnumGenerator(string resPath)
 {
     this.sheet = CSVSheet.Create(resPath);
     Assert.IsTrue(sheet != null);
 }