1using System.Collections.Generic;
3using NPOI.SS.UserModel;
24 public Item(IRow row,
string c0,
string c1,
string c2,
int c4)
26 ICell cell = row.GetCell(3);
35 string text = cell.ToString();
47 gender = ((c2 ==
"F") ? 1 : ((c2 ==
"M") ? 2 : 0));
69 public List<Item>
items =
new List<Item>();
71 public StringBuilder
Apply(ref
string text,
int gender)
74 StringBuilder stringBuilder =
new StringBuilder();
80 gender = ((
Rand.
rnd(3) != 0) ? 1 : 2);
82 while (num < text.Length)
91 string[] keys = item2.
keys;
92 foreach (
string text3
in keys)
95 for (
int j = 0; j < text3.Length; j++)
97 if (num + j >= text.Length || text[num + j] != text3[j])
103 if (flag && item2.
suffix !=
null)
106 if (num + text3.Length >= text.Length)
110 string[] suffix = item2.
suffix;
111 foreach (
string text4
in suffix)
113 if (text[num + text3.Length] == text4[0])
132 if (flag && text2.Length > 0)
139 stringBuilder.Append(text[num]);
143 stringBuilder.Replace(
"…ー",
"ー…");
144 return stringBuilder;
147 public override void BuildMap(
string sheetName =
null)
150 ISheet sheetAt =
book.GetSheetAt(0);
151 if (sheetAt.LastRowNum <= 3)
155 for (
int i = 3; i <= sheetAt.LastRowNum; i++)
157 IRow row = sheetAt.GetRow(i);
158 if (row.Cells.Count == 0)
160 Debug.LogWarning(
path +
"/" +
book?.ToString() +
"/" + sheetName +
"/" + sheetAt.LastRowNum +
"/" + i);
163 string text = row.GetCell(0).ToString();
166 Debug.LogWarning(
path +
"/" +
book?.ToString() +
"/" + sheetName +
"/" + sheetAt.LastRowNum +
"/" + i);
169 string text2 = row.GetCell(1).ToString();
170 string text3 = row.GetCell(2)?.ToString() ??
"";
174 switch (text +
"_" + text3)
177 I_M = (
I_F = text2.Split(
','));
185 I_M = text2.Split(
',');
189 you_M = text2.Split(
',');
193 I_F = text2.Split(
',');
197 you_F = text2.Split(
',');
201 tags = text2.Split(
',');
205 items.Add(
new Item(row, text, text2, text3, @
int));
static bool GetBool(int id)
static int GetInt(int id)
static int Range(int min, int max)
static string[] DefaultSuffix
Item(IRow row, string c0, string c1, string c2, int c4)
StringBuilder Apply(ref string text, int gender)
override void BuildMap(string sheetName=null)