-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSettlementIconState.cs
361 lines (337 loc) · 7.17 KB
/
SettlementIconState.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
using System;
using Helpers;
using TaleWorlds.CampaignSystem;
using TaleWorlds.ObjectSystem;
namespace SettlementIcons
{
internal class SettlementIconState
{
public SettlementIconState()
{
}
public SettlementIconState(Settlement settlement)
{
foreach (Hero hero in settlement.Notables)
{
bool flag = Settings.SettlementIcons.IsNobleTroopIconEnabled && HeroHelper.HeroShouldGiveEliteTroop(hero);
if (flag)
{
this.IsPossibleNobleTroops = true;
}
bool flag2 = Settings.SettlementIcons.IsQuestIconEnabled && hero.Issue != null;
if (flag2)
{
this.IsQuestAvailable = true;
}
}
bool flag3 = Settings.SettlementIcons.IsTournamentIconEnabled && settlement.IsTown && Campaign.Current.TournamentManager.GetTournamentGame(settlement.Town) != null;
if (flag3)
{
this.IsTournamentAvailable = true;
}
bool flag4 = Settings.SettlementIcons.IsResourceIconsEnabled && settlement.IsVillage && settlement.Village.VillageType != null;
if (flag4)
{
string stringId = settlement.Village.VillageType.StringId;
uint num = 0U;
bool flag5 = stringId != null;
if (flag5)
{
num = 2166136261U;
string text = stringId;
for (int i = 0; i < text.Length; i++)
{
num = ((uint)text[i] ^ num) * 16777619U;
}
}
bool flag6 = num <= 1509806192U;
if (flag6)
{
bool flag7 = num <= 612390094U;
if (flag7)
{
bool flag8 = num <= 391430808U;
if (flag8)
{
bool flag9 = num != 311137604U;
if (flag9)
{
bool flag10 = num != 391430808U;
if (!flag10)
{
bool flag11 = stringId != "swine_farm";
if (!flag11)
{
this.IsSwine = true;
}
}
}
else
{
bool flag12 = stringId != "fisherman";
if (!flag12)
{
this.IsFish = true;
}
}
}
else
{
bool flag13 = num != 447076191U;
if (flag13)
{
bool flag14 = num != 584841567U;
if (flag14)
{
bool flag15 = num != 612390094U;
if (!flag15)
{
bool flag16 = stringId != "silk_plant";
if (!flag16)
{
this.IsSilk = true;
}
}
}
else
{
bool flag17 = stringId != "iron_mine";
if (!flag17)
{
this.IsIron = true;
}
}
}
else
{
bool flag18 = stringId != "desert_horse_ranch";
if (!flag18)
{
this.IsHorse = true;
}
}
}
}
else
{
bool flag19 = num <= 1077548801U;
if (flag19)
{
bool flag20 = num != 778525754U;
if (flag20)
{
bool flag21 = num != 1077548801U;
if (!flag21)
{
bool flag22 = stringId != "trapper";
if (!flag22)
{
this.IsHide = true;
}
}
}
else
{
bool flag23 = stringId != "battanian_horse_ranch";
if (!flag23)
{
this.IsHorse = true;
}
}
}
else
{
bool flag24 = num != 1294988078U;
if (flag24)
{
bool flag25 = num != 1323181873U;
if (flag25)
{
bool flag26 = num != 1509806192U;
if (!flag26)
{
bool flag27 = stringId != "europe_horse_ranch";
if (!flag27)
{
this.IsHorse = true;
}
}
}
else
{
bool flag28 = stringId != "salt_mine";
if (!flag28)
{
this.IsSalt = true;
}
}
}
else
{
bool flag29 = stringId != "silver_mine";
if (!flag29)
{
this.IsSilver = true;
}
}
}
}
}
else
{
bool flag30 = num <= 3023816321U;
if (flag30)
{
bool flag31 = num <= 1791522831U;
if (flag31)
{
bool flag32 = num != 1770050989U;
if (flag32)
{
bool flag33 = num != 1791522831U;
if (!flag33)
{
bool flag34 = stringId != "cattle_farm";
if (!flag34)
{
this.IsCattle = true;
}
}
}
else
{
bool flag35 = stringId != "lumberjack";
if (!flag35)
{
this.IsHardwood = true;
}
}
}
else
{
bool flag36 = num != 2590604115U;
if (flag36)
{
bool flag37 = num != 2685698454U;
if (flag37)
{
bool flag38 = num != 3023816321U;
if (!flag38)
{
bool flag39 = stringId != "wheat_farm";
if (!flag39)
{
this.IsGrain = true;
}
}
}
else
{
bool flag40 = stringId != "olive_trees";
if (!flag40)
{
this.IsOlive = true;
}
}
}
else
{
bool flag41 = stringId != "steppe_horse_ranch";
if (!flag41)
{
this.IsHorse = true;
}
}
}
}
else
{
bool flag42 = num <= 3979548289U;
if (flag42)
{
bool flag43 = num != 3120777606U;
if (flag43)
{
bool flag44 = num != 3979548289U;
if (!flag44)
{
bool flag45 = stringId != "vineyard";
if (!flag45)
{
this.IsGrape = true;
}
}
}
else
{
bool flag46 = stringId != "date_farm";
if (!flag46)
{
this.IsDate = true;
}
}
}
else
{
bool flag47 = num != 4007472742U;
if (flag47)
{
bool flag48 = num != 4200144624U;
if (flag48)
{
bool flag49 = num != 4237788325U;
if (!flag49)
{
bool flag50 = stringId != "sheep_farm";
if (!flag50)
{
this.IsWool = true;
}
}
}
else
{
bool flag51 = stringId != "flax_plant";
if (!flag51)
{
this.IsFlax = true;
}
}
}
else
{
bool flag52 = stringId != "clay_mine";
if (!flag52)
{
this.IsClay = true;
}
}
}
}
}
}
}
public MBGUID SettlementId { get; set; }
public bool IsPossibleNobleTroops { get; set; }
public bool IsQuestAvailable { get; set; }
public bool IsTournamentAvailable { get; set; }
public bool IsFlax { get; set; }
public bool IsClay { get; set; }
public bool IsGrain { get; set; }
public bool IsGrape { get; set; }
public bool IsHardwood { get; set; }
public bool IsHide { get; set; }
public bool IsHorse { get; set; }
public bool IsIron { get; set; }
public bool IsLeather { get; set; }
public bool IsOlive { get; set; }
public bool IsSilk { get; set; }
public bool IsWool { get; set; }
public bool IsCattle { get; set; }
public bool IsSilver { get; set; }
public bool IsFish { get; set; }
public bool IsDate { get; set; }
public bool IsSwine { get; set; }
public bool IsSalt { get; set; }
}
}