13 if (spawnList !=
null)
15 if (spawnList.filter != filter && filter !=
null)
17 spawnList.CreateMaster(filter, parent);
24 spawnList.CreateMaster(filter, parent);
38 bool flag = row.type ==
"chara";
40 cardFilter.isChara = flag;
41 cardFilter.strTag = row.tag;
42 cardFilter.strFilter = row.filter;
43 cardFilter.filterCategory = row.category;
44 cardFilter.idCard = row.idCard;
45 this.CreateMaster(cardFilter, row.parent);
55 this.totalChance += row.chance;
59 public void CreateMaster(
CardFilter _filter,
string parent =
null)
63 this.filter = _filter;
64 List<CardRow> list = parent.IsEmpty() ? EClass.sources.cards.rows :
SpawnList.Get(parent,
null,
null).rows;
65 for (
int i = 0; i < list.Count; i++)
68 if (cardRow.chance > 0 &&
this.filter.Pass(cardRow))
73 if (!this.filter.idCard.IsEmpty())
75 foreach (
string key
in this.filter.idCard)
84 public SpawnList Filter(
int lv,
int levelRange = -1)
87 SpawnList.tempList.totalChance = 0;
88 SpawnList.tempList.filter = this.filter;
90 while (i < this.rows.Count)
95 if (Mathf.Abs(cardRow.LV - lv) < levelRange)
100 else if (cardRow.LV <= lv)
109 SpawnList.tempList.totalChance += cardRow.chance;
114 Debug.Log(
"list contains no item: " + this.
id +
"/" + lv.ToString());
121 public CardRow Select(
int lv = -1,
int levelRange = -1)
125 if (levelRange != -1)
127 for (
int i = 0; i < 50; i++)
129 SpawnList spawnList = this.Filter(lv + i - i * i, levelRange + i * i);
130 if (spawnList.rows.Count > 5)
132 return spawnList.Select(-1, -1);
137 return this.Filter(lv, -1).Select(-1, -1);
139 if (this.filter !=
null && this.filter.categoriesInclude.Count > 0)
142 for (
int j = 0; j < 100; j++)
144 CardRow cardRow = this.<Select>g___Select|11_0();
145 if (cardRow !=
null && cardRow.Category.IsChildOf(r))
151 return this.<Select>g___Select|11_0();
157 return this.rows[
EClass.rnd(this.rows.Count)];
168 private CardRow <Select>g___Select|11_0()
170 int num =
EClass.rnd(this.totalChance);
172 foreach (
CardRow cardRow
in this.rows)
174 num2 += cardRow.chance;
180 if (this.rows.Count == 0)
182 Debug.Log(
"no item:" + this.
id);
185 Debug.Log(filterItem.name +
"/" + filterItem.exclude.ToString());
189 return this.rows[
EClass.rnd(this.rows.Count)];
193 public static Dictionary<string, SpawnList> allList =
new Dictionary<string, SpawnList>();
202 public List<CardRow> rows =
new List<CardRow>();
208 public int totalChance;