Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ExcelIndex.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using NPOI.SS.UserModel;
3
4public class ExcelIndex
5{
6 public string type;
7
8 public string name;
9
10 public string enumName = "";
11
12 public bool serializable = true;
13
14 public static List<ExcelIndex> GetIndex(ISheet sheet)
15 {
16 List<ExcelIndex> list = new List<ExcelIndex>();
17 IRow row = sheet.GetRow(0);
18 IRow row2 = sheet.GetRow(1);
19 for (int i = 0; i < row.LastCellNum; i++)
20 {
21 ICell cell = row2.GetCell(i);
22 ExcelIndex item = new ExcelIndex(row.GetCell(i), cell);
23 list.Add(item);
24 }
25 return list;
26 }
27
28 public ExcelIndex(ICell titleCell, ICell dataCell)
29 {
30 name = titleCell.StringCellValue;
31 if (dataCell != null)
32 {
33 type = dataCell.StringCellValue;
34 }
35 if (type == "Sprite[]")
36 {
37 serializable = false;
38 }
39 }
40
41 public string GetTypeName()
42 {
43 if (type == null)
44 {
45 return null;
46 }
47 if (type.StartsWith("#"))
48 {
49 enumName = type.Replace("#", "");
50 return enumName;
51 }
52 if (type == "str")
53 {
54 return "string";
55 }
56 if (type == "element_id")
57 {
58 return "int";
59 }
60 if (type == "elements")
61 {
62 return "int[]";
63 }
64 return type;
65 }
66}
static List< ExcelIndex > GetIndex(ISheet sheet)
Definition: ExcelIndex.cs:14
bool serializable
Definition: ExcelIndex.cs:12
string enumName
Definition: ExcelIndex.cs:10
ExcelIndex(ICell titleCell, ICell dataCell)
Definition: ExcelIndex.cs:28
string type
Definition: ExcelIndex.cs:6
string name
Definition: ExcelIndex.cs:8
string GetTypeName()
Definition: ExcelIndex.cs:41