Elin Decompiled Documentation EA 23.102 Nightly
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:741
static string GetString(int id)
Definition: SourceData.cs:746
static int GetInt(int id)
Definition: SourceData.cs:711
static int[] GetIntArray(int id)
Definition: SourceData.cs:736

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

References CardRow._origin, RenderRow.category, RenderRow.chance, RenderRow.components, RenderRow.defMat, RenderRow.detail, RenderRow.detail_JP, CardRow.elements, SourceManager.elements, RenderRow.factory, Core.GetCurrent(), CardRow.id, RenderRow.LV, RenderRow.name, RenderRow.name_JP, SourceThing.Row.OnImportData(), 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 288 of file SourceThingV.cs.

289 {
290 }

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:20
SourceAsset asset
Dictionary< string, Row > _rows
Definition: SourceThing.cs:144
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: