Elin Modding Docs Doc
Loading...
Searching...
No Matches
SourceCategory.cs
1using System;
2using System.Collections.Generic;
3
4// Token: 0x02000013 RID: 19
5public class SourceCategory : SourceDataString<SourceCategory.Row>
6{
7 // Token: 0x060000E4 RID: 228 RVA: 0x00009824 File Offset: 0x00007A24
8 public override SourceCategory.Row CreateRow()
9 {
10 return new SourceCategory.Row
11 {
12 id = SourceData.GetString(0),
13 uid = SourceData.GetInt(1),
14 name_JP = SourceData.GetString(2),
15 name = SourceData.GetString(3),
16 _parent = SourceData.GetString(4),
17 recipeCat = SourceData.GetString(5),
18 slot = Core.GetElement(SourceData.GetStr(6, false)),
19 skill = Core.GetElement(SourceData.GetStr(7, false)),
20 maxStack = SourceData.GetInt(8),
21 tileDummy = SourceData.GetInt(9),
22 installOne = SourceData.GetBool(10),
23 ignoreBless = SourceData.GetInt(11),
24 tag = SourceData.GetStringArray(12),
25 idThing = SourceData.GetString(13),
26 recycle = SourceData.GetStringArray(14),
27 costSP = SourceData.GetInt(15),
28 gift = SourceData.GetInt(16),
29 deliver = SourceData.GetInt(17),
30 offer = SourceData.GetInt(18),
31 ticket = SourceData.GetInt(19),
32 sortVal = SourceData.GetInt(20),
33 flag = SourceData.GetInt(21)
34 };
35 }
36
37 // Token: 0x060000E5 RID: 229 RVA: 0x00009957 File Offset: 0x00007B57
38 public override void SetRow(SourceCategory.Row r)
39 {
40 this.map[r.id] = r;
41 }
42
43 // Token: 0x060000E6 RID: 230 RVA: 0x0000996C File Offset: 0x00007B6C
44 public override void OnInit()
45 {
46 foreach (SourceCategory.Row row in this.rows)
47 {
48 row.children = new List<SourceCategory.Row>();
49 }
50 foreach (SourceCategory.Row row2 in this.rows)
51 {
52 if (!row2._parent.IsEmpty())
53 {
54 SourceCategory.Row row3 = this.map[row2._parent];
55 row2.parent = row3;
56 row3.children.Add(row2);
57 }
58 }
59 }
60
61 // Token: 0x02000793 RID: 1939
62 [Serializable]
63 public class Row : SourceData.BaseRow
64 {
65 // Token: 0x170010C5 RID: 4293
66 // (get) Token: 0x06003708 RID: 14088 RVA: 0x0012A202 File Offset: 0x00128402
67 public override bool UseAlias
68 {
69 get
70 {
71 return false;
72 }
73 }
74
75 // Token: 0x170010C6 RID: 4294
76 // (get) Token: 0x06003709 RID: 14089 RVA: 0x0012A205 File Offset: 0x00128405
77 public override string GetAlias
78 {
79 get
80 {
81 return "n";
82 }
83 }
84
85 // Token: 0x0600370A RID: 14090 RVA: 0x0012A20C File Offset: 0x0012840C
86 public bool IsChildOf(string id)
87 {
88 return this.IsChildOf(EClass.sources.categories.map[id]);
89 }
90
91 // Token: 0x0600370B RID: 14091 RVA: 0x0012A229 File Offset: 0x00128429
92 public bool IsChildOf(SourceCategory.Row r)
93 {
94 return r == this || (this.parent != null && this.parent.IsChildOf(r));
95 }
96
97 // Token: 0x0600370C RID: 14092 RVA: 0x0012A247 File Offset: 0x00128447
98 public bool IsChildOf(int _uid)
99 {
100 return this.uid == _uid || (this.parent != null && this.parent.IsChildOf(_uid));
101 }
102
103 // Token: 0x0600370D RID: 14093 RVA: 0x0012A26C File Offset: 0x0012846C
104 public bool Contatin(int _uid)
105 {
106 if (this.uid == _uid)
107 {
108 return true;
109 }
110 using (List<SourceCategory.Row>.Enumerator enumerator = this.children.GetEnumerator())
111 {
112 while (enumerator.MoveNext())
113 {
114 if (enumerator.Current.Contatin(_uid))
115 {
116 return true;
117 }
118 }
119 }
120 return false;
121 }
122
123 // Token: 0x0600370E RID: 14094 RVA: 0x0012A2D4 File Offset: 0x001284D4
124 public SourceCategory.Row GetRoot()
125 {
126 if (this.parent == null)
127 {
128 return this;
129 }
130 return this.parent.GetRoot();
131 }
132
133 // Token: 0x0600370F RID: 14095 RVA: 0x0012A2EB File Offset: 0x001284EB
134 public SourceCategory.Row GetSecondRoot()
135 {
136 if (this.parent == null || this.parent.parent == null)
137 {
138 return this;
139 }
140 return this.parent.GetSecondRoot();
141 }
142
143 // Token: 0x06003710 RID: 14096 RVA: 0x0012A30F File Offset: 0x0012850F
144 public string GetIdThing()
145 {
146 if (!this.idThing.IsEmpty())
147 {
148 return this.idThing;
149 }
150 return this.parent.GetIdThing();
151 }
152
153 // Token: 0x04001F0C RID: 7948
154 public string id;
155
156 // Token: 0x04001F0D RID: 7949
157 public int uid;
158
159 // Token: 0x04001F0E RID: 7950
160 public string name_JP;
161
162 // Token: 0x04001F0F RID: 7951
163 public string name;
164
165 // Token: 0x04001F10 RID: 7952
166 public string _parent;
167
168 // Token: 0x04001F11 RID: 7953
169 public string recipeCat;
170
171 // Token: 0x04001F12 RID: 7954
172 public int slot;
173
174 // Token: 0x04001F13 RID: 7955
175 public int skill;
176
177 // Token: 0x04001F14 RID: 7956
178 public int maxStack;
179
180 // Token: 0x04001F15 RID: 7957
181 public int tileDummy;
182
183 // Token: 0x04001F16 RID: 7958
184 public bool installOne;
185
186 // Token: 0x04001F17 RID: 7959
187 public int ignoreBless;
188
189 // Token: 0x04001F18 RID: 7960
190 public string[] tag;
191
192 // Token: 0x04001F19 RID: 7961
193 public string idThing;
194
195 // Token: 0x04001F1A RID: 7962
196 public string[] recycle;
197
198 // Token: 0x04001F1B RID: 7963
199 public int costSP;
200
201 // Token: 0x04001F1C RID: 7964
202 public int gift;
203
204 // Token: 0x04001F1D RID: 7965
205 public int deliver;
206
207 // Token: 0x04001F1E RID: 7966
208 public int offer;
209
210 // Token: 0x04001F1F RID: 7967
211 public int ticket;
212
213 // Token: 0x04001F20 RID: 7968
214 public int sortVal;
215
216 // Token: 0x04001F21 RID: 7969
217 public int flag;
218
219 // Token: 0x04001F22 RID: 7970
220 [NonSerialized]
221 public SourceCategory.Row parent;
222
223 // Token: 0x04001F23 RID: 7971
224 [NonSerialized]
225 public List<SourceCategory.Row> children;
226
227 // Token: 0x04001F24 RID: 7972
228 public string name_L;
229 }
230}