Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
SourcePref.cs
Go to the documentation of this file.
1using System;
2using Newtonsoft.Json;
3using UnityEngine;
4
5[Serializable]
6public class SourcePref : EClass, ISerializationCallbackReceiver
7{
8 [JsonProperty]
9 public int[] ints = new int[25];
10
12
13 public int test
14 {
15 get
16 {
17 Validate();
18 return ints[0];
19 }
20 }
21
23 {
24 get
25 {
26 return ints[1].ToEnum<PrefFlag>();
27 }
28 set
29 {
30 ints[1] = (int)value;
31 }
32 }
33
34 public int shadow
35 {
36 get
37 {
38 return ints[0];
39 }
40 set
41 {
42 ints[0] = value;
43 }
44 }
45
46 public float height
47 {
48 get
49 {
50 return (float)ints[3] * 0.01f;
51 }
52 set
53 {
54 ints[3] = (int)(value * 100f);
55 }
56 }
57
58 public int liquidMod
59 {
60 get
61 {
62 return ints[16];
63 }
64 set
65 {
66 ints[16] = value;
67 }
68 }
69
70 public int liquidModMax
71 {
72 get
73 {
74 return ints[21];
75 }
76 set
77 {
78 ints[21] = value;
79 }
80 }
81
82 public float hatY
83 {
84 get
85 {
86 return (float)ints[23] * 0.01f;
87 }
88 set
89 {
90 ints[23] = (int)(value * 100f);
91 }
92 }
93
94 public float stackX
95 {
96 get
97 {
98 return (float)ints[17] * 0.01f;
99 }
100 set
101 {
102 ints[17] = (int)(value * 100f);
103 }
104 }
105
106 public float x
107 {
108 get
109 {
110 return (float)ints[4] * 0.01f;
111 }
112 set
113 {
114 ints[4] = (int)(value * 100f);
115 }
116 }
117
118 public float y
119 {
120 get
121 {
122 return (float)ints[5] * 0.01f;
123 }
124 set
125 {
126 ints[5] = (int)(value * 100f);
127 }
128 }
129
130 public float z
131 {
132 get
133 {
134 return (float)ints[2] * 0.01f;
135 }
136 set
137 {
138 ints[2] = (int)(value * 100f);
139 }
140 }
141
142 public int pivotX
143 {
144 get
145 {
146 return ints[6];
147 }
148 set
149 {
150 ints[6] = value;
151 }
152 }
153
154 public int pivotY
155 {
156 get
157 {
158 return ints[7];
159 }
160 set
161 {
162 ints[7] = value;
163 }
164 }
165
166 public int shadowX
167 {
168 get
169 {
170 return ints[8];
171 }
172 set
173 {
174 ints[8] = value;
175 }
176 }
177
178 public int shadowY
179 {
180 get
181 {
182 return ints[9];
183 }
184 set
185 {
186 ints[9] = value;
187 }
188 }
189
190 public int shadowRX
191 {
192 get
193 {
194 return ints[10];
195 }
196 set
197 {
198 ints[10] = value;
199 }
200 }
201
202 public int shadowRY
203 {
204 get
205 {
206 return ints[11];
207 }
208 set
209 {
210 ints[11] = value;
211 }
212 }
213
214 public int shadowBX
215 {
216 get
217 {
218 return ints[12];
219 }
220 set
221 {
222 ints[12] = value;
223 }
224 }
225
226 public int shadowBY
227 {
228 get
229 {
230 return ints[13];
231 }
232 set
233 {
234 ints[13] = value;
235 }
236 }
237
238 public int shadowBRX
239 {
240 get
241 {
242 return ints[14];
243 }
244 set
245 {
246 ints[14] = value;
247 }
248 }
249
250 public int shadowBRY
251 {
252 get
253 {
254 return ints[15];
255 }
256 set
257 {
258 ints[15] = value;
259 }
260 }
261
262 public int equipX
263 {
264 get
265 {
266 return ints[18];
267 }
268 set
269 {
270 ints[18] = value;
271 }
272 }
273
274 public int equipY
275 {
276 get
277 {
278 return ints[19];
279 }
280 set
281 {
282 ints[19] = value;
283 }
284 }
285
286 public int scaleIcon
287 {
288 get
289 {
290 return ints[20];
291 }
292 set
293 {
294 ints[20] = value;
295 }
296 }
297
298 public bool bypassShadow
299 {
300 get
301 {
302 return _bits1[0];
303 }
304 set
305 {
306 _bits1[0] = value;
307 }
308 }
309
310 public bool UsePref => (ints[1] & 1) != 0;
311
312 public bool Float => (ints[1] & 4) != 0;
313
314 public bool Surface => (ints[1] & 8) != 0;
315
316 public void OnAfterDeserialize()
317 {
318 if (ints.Length >= 25)
319 {
320 _bits1.SetInt(ints[22]);
321 }
322 else
323 {
324 Validate();
325 }
326 }
327
328 public void OnBeforeSerialize()
329 {
330 ints[22] = _bits1.ToInt();
331 }
332
333 public void Validate()
334 {
335 if (ints.Length < 25)
336 {
337 Array.Resize(ref ints, 25);
338 }
339 }
340}
PrefFlag
Definition: PrefFlag.cs:5
Definition: EClass.cs:5
void OnAfterDeserialize()
Definition: SourcePref.cs:316
bool bypassShadow
Definition: SourcePref.cs:299
int liquidModMax
Definition: SourcePref.cs:71
bool Surface
Definition: SourcePref.cs:314
int shadowBRY
Definition: SourcePref.cs:251
float height
Definition: SourcePref.cs:47
bool UsePref
Definition: SourcePref.cs:310
int liquidMod
Definition: SourcePref.cs:59
int shadowBRX
Definition: SourcePref.cs:239
bool Float
Definition: SourcePref.cs:312
int shadowRX
Definition: SourcePref.cs:191
int shadowRY
Definition: SourcePref.cs:203
PrefFlag flags
Definition: SourcePref.cs:23
int shadowBY
Definition: SourcePref.cs:227
int[] ints
Definition: SourcePref.cs:9
int shadowBX
Definition: SourcePref.cs:215
int scaleIcon
Definition: SourcePref.cs:287
int shadow
Definition: SourcePref.cs:35
float stackX
Definition: SourcePref.cs:95
BitArray32 _bits1
Definition: SourcePref.cs:11
void OnBeforeSerialize()
Definition: SourcePref.cs:328
float hatY
Definition: SourcePref.cs:83
void Validate()
Definition: SourcePref.cs:333
void SetInt(int i)
Definition: BitArray32.cs:89
int ToInt()
Definition: BitArray32.cs:84