Elin Decompiled Documentation EA 23.291 Nightly Patch 1
Loading...
Searching...
No Matches
SourceThingV Class Reference
Inheritance diagram for SourceThingV:
SourceDataString< SourceThingV.Row > SourceFood

Classes

class  Row
 

Public Member Functions

override Row CreateRow ()
 
override void SetRow (Row r)
 
override void RestorePref ()
 
override void ValidatePref ()
 
override void Reset ()
 
override void OnAfterImportData ()
 
virtual void OnImportRow (Row _r, SourceThing.Row c)
 
- Public Member Functions inherited from SourceDataString< SourceThingV.Row >
override T GetRow (string id)
 

Properties

override string[] ImportFields [get]
 

Detailed Description

Definition at line 6 of file SourceThingV.cs.

Member Function Documentation

◆ CreateRow()

override Row SourceThingV.CreateRow ( )
inline

Definition at line 20 of file SourceThingV.cs.

21 {
22 return new Row
23 {
24 id = SourceData.GetString(0),
25 _origin = SourceData.GetString(1),
26 name_JP = SourceData.GetString(2),
27 unit_JP = SourceData.GetString(3),
28 name = SourceData.GetString(4),
29 unit = SourceData.GetString(5),
30 tiles = SourceData.GetIntArray(6),
31 skins = SourceData.GetIntArray(7),
32 parse = SourceData.GetStringArray(8),
33 vals = SourceData.GetStringArray(9),
34 trait = SourceData.GetStringArray(11),
35 LV = SourceData.GetInt(12),
36 chance = SourceData.GetInt(13),
37 value = SourceData.GetInt(14),
38 weight = SourceData.GetInt(15),
39 recipeKey = SourceData.GetStringArray(16),
40 factory = SourceData.GetStringArray(17),
41 components = SourceData.GetStringArray(18),
42 defMat = SourceData.GetString(19),
43 category = SourceData.GetString(20),
44 tag = SourceData.GetStringArray(21),
45 detail_JP = SourceData.GetString(22),
46 detail = SourceData.GetString(23)
47 };
48 }
static string[] GetStringArray(int id)
Definition: SourceData.cs:912
static string GetString(int id)
Definition: SourceData.cs:917
static int GetInt(int id)
Definition: SourceData.cs:882
static int[] GetIntArray(int id)
Definition: SourceData.cs:907

References SourceData< T, T2 >.GetInt(), SourceData< T, T2 >.GetIntArray(), SourceData< T, T2 >.GetString(), and SourceData< T, T2 >.GetStringArray().

◆ OnAfterImportData()

override void SourceThingV.OnAfterImportData ( )
inline

Definition at line 96 of file SourceThingV.cs.

97 {
98 Dictionary<string, SourceThing.Row> dictionary = new Dictionary<string, SourceThing.Row>();
99 foreach (SourceThing.Row row2 in EClass.sources.things.rows)
100 {
101 dictionary[row2.id] = row2;
102 }
103 Dictionary<string, System.Reflection.FieldInfo> rowFields = new SourceThing.Row().GetRowFields();
104 foreach (Row row3 in rows)
105 {
106 SourceThing.Row row = new SourceThing.Row();
107 SourceThing.Row obj = dictionary[row3._origin];
108 string key;
109 foreach (KeyValuePair<string, System.Reflection.FieldInfo> item in rowFields)
110 {
111 item.Deconstruct(out key, out var value);
112 string text = key;
113 System.Reflection.FieldInfo fieldInfo = value;
114 if (!(text == "parse"))
115 {
116 fieldInfo.SetValue(row, fieldInfo.GetValue(obj));
117 }
118 }
119 row.id = row3.id;
120 row._origin = row3._origin;
121 if (row3.LV != 0)
122 {
123 row.LV = row3.LV;
124 }
125 if (row3.chance != -1)
126 {
127 row.chance = row3.chance;
128 }
129 if (row3.value != -1)
130 {
131 row.value = row3.value;
132 }
133 else
134 {
135 row.value += EClass.rnd(row.value / 2);
136 }
137 if (row3.weight != -1)
138 {
139 row.weight = row3.weight;
140 }
141 if (!row3.tiles.IsEmpty())
142 {
143 row.tiles = row3.tiles;
144 }
145 if (!row3.skins.IsEmpty())
146 {
147 row.skins = row3.skins;
148 }
149 if (!row3.name.IsEmpty())
150 {
151 row.name = row3.name;
152 }
153 if (!row3.name_JP.IsEmpty())
154 {
155 row.name_JP = row3.name_JP;
156 }
157 if (!row3.detail.IsEmpty())
158 {
159 row.detail = row3.detail;
160 }
161 if (!row3.detail_JP.IsEmpty())
162 {
163 row.detail_JP = row3.detail_JP;
164 }
165 if (!row3.unit.IsEmpty())
166 {
167 row.unit = row3.unit;
168 }
169 if (!row3.unit_JP.IsEmpty())
170 {
171 row.unit_JP = row3.unit_JP;
172 }
173 if (!row3.vals.IsEmpty())
174 {
175 row.vals = row3.vals;
176 }
177 if (!row3.components.IsEmpty())
178 {
179 row.components = row3.components;
180 }
181 if (!row3.defMat.IsEmpty())
182 {
183 row.defMat = row3.defMat;
184 }
185 if (!row3.trait.IsEmpty())
186 {
187 row.trait = row3.trait;
188 }
189 if (!row3.category.IsEmpty())
190 {
191 row.category = row3.category;
192 }
193 if (!row3.factory.IsEmpty())
194 {
195 row.factory = row3.factory;
196 }
197 if (!row3.tag.IsEmpty())
198 {
199 row.tag = row3.tag;
200 }
201 row.recipeKey = row3.recipeKey;
202 if (!row3.parse.IsEmpty())
203 {
204 key = row3._origin;
205 switch (key)
206 {
207 case "lamp_ceil2":
208 case "window":
209 case "windowL":
210 row.idExtra = row3.parse[0];
211 break;
212 default:
213 {
214 string[] parse = row3.parse;
215 for (int i = 0; i < parse.Length; i++)
216 {
217 string[] array = parse[i].Split('/');
218 switch (array[0])
219 {
220 case "elec":
221 row.electricity = array[1].ToInt();
222 break;
223 case "render":
224 row._idRenderData = array[1];
225 break;
226 case "tiletype":
227 row._tileType = array[1];
228 break;
229 case "anime":
230 row.anime = ((array.Length <= 4) ? ((array.Length <= 3) ? new int[2]
231 {
232 array[1].ToInt(),
233 array[2].ToInt()
234 } : new int[3]
235 {
236 array[1].ToInt(),
237 array[2].ToInt(),
238 array[3].ToInt()
239 }) : new int[4]
240 {
241 array[1].ToInt(),
242 array[2].ToInt(),
243 array[3].ToInt(),
244 array[4].ToInt()
245 });
246 break;
247 case "skin":
248 {
249 string[] array2 = array[1].Split('|');
250 row.skins = new int[array2.Length];
251 for (int j = 0; j < array2.Length; j++)
252 {
253 row.skins[j] = array2[j].ToInt();
254 }
255 break;
256 }
257 case "alt":
258 row.altTiles = new int[1] { array[1].ToInt() };
259 row.ignoreAltFix = true;
260 break;
261 case "naming":
262 row.naming = array[1];
263 break;
264 case "ex":
265 row.idActorEx = array[1];
266 break;
267 case "sound":
268 row.idSound = array[1];
269 break;
270 case "color":
271 row.colorMod = 100;
272 break;
273 case "no_color":
274 row.colorMod = 0;
275 break;
276 case "unique":
277 row.quality = 4;
278 break;
279 case "ele":
280 {
281 int[] second = new int[2]
282 {
283 Core.GetCurrent().sources.elements.alias[array[1]].id,
284 array[2].ToInt()
285 };
286 row.elements = row.elements.Concat(second).ToArray();
287 break;
288 }
289 }
290 }
291 break;
292 }
293 }
294 }
295 OnImportRow(row3, row);
297 EClass.sources.things.rows.Add(row);
298 }
299 rows.Clear();
300 }
int[] elements
Definition: CardRow.cs:21
Definition: Core.cs:14
SourceManager sources
Definition: Core.cs:33
static Core GetCurrent()
Definition: Core.cs:605
Definition: EClass.cs:6
static int rnd(long a)
Definition: EClass.cs:59
static SourceManager sources
Definition: EClass.cs:43
int[] skins
Definition: RenderRow.cs:14
int value
Definition: RenderRow.cs:20
Dictionary< string, FieldInfo > GetRowFields()
Definition: SourceData.cs:595
SourceThing things
SourceElement elements
virtual void OnImportRow(Row _r, SourceThing.Row c)
override void OnImportData(SourceData data)
Definition: SourceThing.cs:81

References CardRow._origin, RenderRow.category, RenderRow.chance, RenderRow.components, RenderRow.defMat, RenderRow.detail, RenderRow.detail_JP, SourceManager.elements, RenderRow.factory, Core.GetCurrent(), SourceData< T, T2 >.BaseRow.GetRowFields(), CardRow.id, item, RenderRow.LV, RenderRow.name, RenderRow.name_JP, OnImportRow(), SourceThingV.Row.parse, RenderRow.recipeKey, EClass.rnd(), RenderRow.skins, Core.sources, EClass.sources, RenderRow.tag, SourceManager.things, RenderRow.tiles, CardRow.trait, SourceThing.Row.unit, SourceThing.Row.unit_JP, CardRow.vals, RenderRow.value, and SourceThing.Row.weight.

◆ OnImportRow()

virtual void SourceThingV.OnImportRow ( Row  _r,
SourceThing::Row  c 
)
inlinevirtual

Reimplemented in SourceFood.

Definition at line 302 of file SourceThingV.cs.

303 {
304 }

Referenced by OnAfterImportData().

◆ Reset()

override void SourceThingV.Reset ( )
inline

Definition at line 90 of file SourceThingV.cs.

91 {
92 base.Reset();
93 EClass.sources.things.Reset();
94 }

References EClass.sources, and SourceManager.things.

◆ RestorePref()

override void SourceThingV.RestorePref ( )
inline

Definition at line 55 of file SourceThingV.cs.

56 {
57 foreach (SourceThing.Row row2 in EClass.sources.things.rows)
58 {
59 SourcePref sourcePref = EClass.sources.things._rows.TryGetValue(row2.id)?.pref;
60 if (sourcePref == null && EClass.sources.asset.renames.ContainsKey(row2.id))
61 {
62 sourcePref = EClass.sources.things._rows.TryGetValue(EClass.sources.asset.renames[row2.id])?.pref;
63 }
64 row2.pref = sourcePref ?? new SourcePref();
65 }
66 Dictionary<string, SourceThing.Row> dictionary = new Dictionary<string, SourceThing.Row>();
67 foreach (SourceThing.Row row3 in EClass.sources.things.rows)
68 {
69 dictionary[row3.id] = row3;
70 }
71 foreach (SourceThing.Row row4 in EClass.sources.things.rows)
72 {
73 if (!row4.pref.UsePref && !row4._origin.IsEmpty())
74 {
75 SourceThing.Row row = dictionary[row4._origin];
76 row4.pref = IO.DeepCopy(row.pref);
77 row4.pref.flags |= PrefFlag.UsePref;
78 }
79 }
80 }
PrefFlag
Definition: PrefFlag.cs:5
Definition: IO.cs:11
SourcePref pref
Definition: RenderRow.cs:68
UD_String_String renames
Definition: SourceAsset.cs:23
SourceAsset asset
Dictionary< string, Row > _rows
Definition: SourceThing.cs:147
bool ContainsKey(TKey key)
Definition: UDictionary.cs:151

References SourceThing._rows, SourceManager.asset, UDictionary< TKey, TValue >.ContainsKey(), RenderRow.pref, SourceAsset.renames, EClass.sources, and SourceManager.things.

◆ SetRow()

override void SourceThingV.SetRow ( Row  r)
inline

Definition at line 50 of file SourceThingV.cs.

51 {
52 map[r.id] = r;
53 }

References CardRow.id.

◆ ValidatePref()

override void SourceThingV.ValidatePref ( )
inline

Definition at line 82 of file SourceThingV.cs.

83 {
84 foreach (SourceThing.Row row in EClass.sources.things.rows)
85 {
86 row.pref.Validate();
87 }
88 }

References EClass.sources, and SourceManager.things.

Referenced by SourcePrefInspector.ValidatePrefs().

Property Documentation

◆ ImportFields

override string [] SourceThingV.ImportFields
get

Definition at line 18 of file SourceThingV.cs.


The documentation for this class was generated from the following file: