-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLotTile.cs
More file actions
856 lines (815 loc) · 34.9 KB
/
LotTile.cs
File metadata and controls
856 lines (815 loc) · 34.9 KB
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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
// Decompiled with JetBrains decompiler
// Type: SC4Tool.LotTile
// Assembly: SC4Tool, Version=2.2.7.0, Culture=neutral, PublicKeyToken=null
// MVID: 69A50BC4-87A5-4C5E-BEFC-08274BC6D498
// Assembly location: C:\Program Files (x86)\SC4 Utilities\SC4Tool\SC4Tool.exe
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using sr_Resources;
using sr_SC4Lib;
using System;
using System.Collections;
using System.Drawing;
namespace SC4Tool
{
public class LotTile : CollectionBase
{
private const int RepSpalte = 3;
private const int RepZeile = 5;
private string m_Name;
private int m_Zeile;
private int m_Spalte;
private LotTile.LotTexture[] m_Textures;
private ArrayList m_WerteString;
private ArrayList m_SaveWerteString;
private string m_TransitArt;
private bool m_isWater;
private bool m_isLand;
private LotTile.BitmapAusgabe[] m_Bitmaps;
private ArrayList m_EingabeWerte;
private ArrayList m_DirectionArray;
private bool m_HasRep16;
private bool m_MustExpert;
public bool MustExpert => this.m_MustExpert;
public bool HasRep16
{
get => this.m_HasRep16;
set => this.m_HasRep16 = false;
}
public ArrayList DirectionArray
{
get => this.m_DirectionArray;
set => this.m_DirectionArray = (ArrayList) value.Clone();
}
public ArrayList SaveWerteString
{
get => this.m_SaveWerteString;
set => this.m_SaveWerteString = (ArrayList) value.Clone();
}
public ArrayList WerteString => this.m_WerteString;
public LotTile.BitmapAusgabe[] Bitmaps => this.m_Bitmaps;
public bool isLand => this.m_isLand;
public bool isWater => this.m_isWater;
public string TransitArt => this.m_TransitArt;
public LotTile.LotTexture[] Textures => this.m_Textures;
public int Spalte => this.m_Spalte;
public int Zeile => this.m_Zeile;
public string Name => this.m_Name;
public LotTile(int RechtsWert, int HochWert)
{
this.m_WerteString = new ArrayList();
this.m_SaveWerteString = new ArrayList();
this.m_EingabeWerte = new ArrayList();
this.m_DirectionArray = new ArrayList();
this.m_HasRep16 = false;
this.m_MustExpert = false;
this.m_EingabeWerte.Clear();
this.m_Zeile = HochWert;
this.m_Spalte = RechtsWert;
this.m_DirectionArray.Add((object) "00");
this.m_DirectionArray.Add((object) "00");
this.m_DirectionArray.Add((object) "00");
this.m_DirectionArray.Add((object) "00");
this.m_Name = RechtsWert.ToString() + ":" + HochWert.ToString();
this.m_WerteString = new ArrayList();
this.m_WerteString.Clear();
this.m_Textures = new LotTile.LotTexture[0];
this.m_Bitmaps = new LotTile.BitmapAusgabe[0];
this.m_TransitArt = "";
this.m_isWater = false;
this.m_isLand = false;
this.m_HasRep16 = false;
}
public bool addWerte(ArrayList Werte)
{
this.m_EingabeWerte.Clear();
this.m_EingabeWerte = (ArrayList) Werte.Clone();
if (this.CheckCellPosition())
{
this.SetTile();
this.FillWerteString();
this.m_EingabeWerte.Clear();
return true;
}
this.m_EingabeWerte.Clear();
return false;
}
public string GetRep14()
{
string str = "";
if (this.m_WerteString.Count > 0)
{
int num = checked (this.m_WerteString.Count - 1);
int index = 0;
while (index <= num)
{
string[] strArray = this.m_WerteString[index].ToString().Split(',');
if (StringType.StrCmp(strArray[0].ToUpper(), "0X00000007", false) == 0 && strArray.GetUpperBound(0) >= 13)
{
str = strArray[13];
break;
}
checked { ++index; }
}
}
return str;
}
public string GetRep16()
{
string str = "";
if (this.m_WerteString.Count > 0)
{
int num = checked (this.m_WerteString.Count - 1);
int index = 0;
while (index <= num)
{
string[] strArray = this.m_WerteString[index].ToString().Split(',');
if (StringType.StrCmp(strArray[0].ToUpper(), "0X00000007", false) == 0 && strArray.GetUpperBound(0) == 15)
{
str = strArray[15];
break;
}
checked { ++index; }
}
}
return str;
}
public object AddRep16(string RepValue)
{
if (this.m_WerteString.Count > 0)
{
int num = checked (this.m_WerteString.Count - 1);
int index = 0;
while (index <= num)
{
string[] strArray = this.m_WerteString[index].ToString().Split(',');
if (StringType.StrCmp(strArray[0].ToUpper(), "0X00000007", false) == 0 && strArray.GetUpperBound(0) == 14)
{
this.m_WerteString[index] = ObjectType.StrCatObj(ObjectType.StrCatObj(this.m_WerteString[index], (object) ","), (object) RepValue);
this.m_HasRep16 = true;
break;
}
checked { ++index; }
}
}
object obj;
return obj;
}
public object ModifyRep14(string RepValue)
{
if (this.m_WerteString.Count > 0)
{
int num = checked (this.m_WerteString.Count - 1);
int index1 = 0;
while (index1 <= num)
{
string[] strArray = this.m_WerteString[index1].ToString().Split(',');
if (StringType.StrCmp(strArray[0].ToUpper(), "0X00000007", false) == 0 && strArray.GetUpperBound(0) >= 13)
{
strArray[13] = RepValue;
this.WerteString[index1] = (object) strArray[0];
int upperBound = strArray.GetUpperBound(0);
int index2 = 1;
while (index2 <= upperBound)
{
this.WerteString[index1] = ObjectType.StrCatObj(ObjectType.StrCatObj(this.WerteString[index1], (object) ","), (object) strArray[index2]);
checked { ++index2; }
}
break;
}
checked { ++index1; }
}
}
object obj;
return obj;
}
public object ModifyRep16(string RepValue)
{
this.RemoveRep16();
this.AddRep16(RepValue);
object obj;
return obj;
}
public object SetDirectionArray(ArrayList newArray)
{
this.m_DirectionArray = (ArrayList) newArray.Clone();
string str1 = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(this.m_DirectionArray[0], this.m_DirectionArray[1]), this.m_DirectionArray[2]), this.m_DirectionArray[3]));
newArray.Clear();
if (this.m_WerteString.Count > 0)
{
int num = checked (this.m_WerteString.Count - 1);
int index1 = 0;
while (index1 <= num)
{
string[] strArray = this.m_WerteString[index1].ToString().Split(',');
if (StringType.StrCmp(strArray[0].ToUpper(), "0X00000007", false) == 0)
{
strArray[14] = "0X" + str1;
this.RemoveTraffic();
string str2 = strArray[0];
newArray.Add((object) str2);
int upperBound = strArray.GetUpperBound(0);
int index2 = 1;
while (index2 <= upperBound)
{
newArray.Add((object) strArray[index2]);
checked { ++index2; }
}
this.addWerte(newArray);
break;
}
checked { ++index1; }
}
}
object obj;
return obj;
}
public object RemoveTexture(string TextureID)
{
LotTile.BitmapAusgabe[] bitmapAusgabeArray = new LotTile.BitmapAusgabe[0];
if (this.m_Bitmaps.GetUpperBound(0) > -1)
{
int upperBound = this.m_Bitmaps.GetUpperBound(0);
int index = 0;
while (index <= upperBound)
{
string typ = this.m_Bitmaps[index].Typ;
if (StringType.StrCmp(typ, "Water", false) == 0 || StringType.StrCmp(typ, "Land", false) == 0)
{
bitmapAusgabeArray = (LotTile.BitmapAusgabe[]) Utils.CopyArray((Array) bitmapAusgabeArray, (Array) new LotTile.BitmapAusgabe[checked (bitmapAusgabeArray.GetUpperBound(0) + 1 + 1)]);
bitmapAusgabeArray[bitmapAusgabeArray.GetUpperBound(0)] = this.m_Bitmaps[index];
}
else if (StringType.StrCmp(typ, "TrafficArt", false) == 0 || StringType.StrCmp(typ, "TrafficDirection", false) == 0)
{
bitmapAusgabeArray = (LotTile.BitmapAusgabe[]) Utils.CopyArray((Array) bitmapAusgabeArray, (Array) new LotTile.BitmapAusgabe[checked (bitmapAusgabeArray.GetUpperBound(0) + 1 + 1)]);
bitmapAusgabeArray[bitmapAusgabeArray.GetUpperBound(0)] = this.m_Bitmaps[index];
}
else if (StringType.StrCmp(this.m_Bitmaps[index].Instance.ToUpper(), TextureID.ToUpper(), false) != 0)
{
bitmapAusgabeArray = (LotTile.BitmapAusgabe[]) Utils.CopyArray((Array) bitmapAusgabeArray, (Array) new LotTile.BitmapAusgabe[checked (bitmapAusgabeArray.GetUpperBound(0) + 1 + 1)]);
bitmapAusgabeArray[bitmapAusgabeArray.GetUpperBound(0)] = this.m_Bitmaps[index];
}
checked { ++index; }
}
}
if ((uint) checked (bitmapAusgabeArray.GetUpperBound(0) - 1) > 0U)
{
this.m_Bitmaps = new LotTile.BitmapAusgabe[checked (bitmapAusgabeArray.GetUpperBound(0) + 1)];
this.m_Bitmaps = bitmapAusgabeArray;
}
else
this.m_Bitmaps = new LotTile.BitmapAusgabe[0];
if (this.m_WerteString.Count > 0)
{
int num = checked (this.m_WerteString.Count - 1);
int index = 0;
while (index <= num)
{
string[] strArray = this.m_WerteString[index].ToString().Split(',');
if (StringType.StrCmp(strArray[0].ToUpper(), "0X00000002", false) == 0 && StringType.StrCmp(strArray[12], TextureID, false) == 0)
{
this.m_WerteString.RemoveAt(index);
break;
}
checked { ++index; }
}
}
LotTile.LotTexture[] lotTextureArray = new LotTile.LotTexture[0];
if (this.m_Textures.GetUpperBound(0) > -1)
{
int upperBound = this.m_Textures.GetUpperBound(0);
int index = 0;
while (index <= upperBound)
{
if (StringType.StrCmp(this.m_Textures[index].Gruppe, TextureID, false) != 0)
{
bitmapAusgabeArray = (LotTile.BitmapAusgabe[]) Utils.CopyArray((Array) bitmapAusgabeArray, (Array) new LotTile.BitmapAusgabe[checked (bitmapAusgabeArray.GetUpperBound(0) + 1 + 1)]);
lotTextureArray[lotTextureArray.GetUpperBound(0)] = this.m_Textures[index];
}
checked { ++index; }
}
}
if ((uint) checked (lotTextureArray.GetUpperBound(0) - 1) > 0U)
{
this.m_Textures = new LotTile.LotTexture[checked (lotTextureArray.GetUpperBound(0) + 1)];
this.m_Textures = lotTextureArray;
}
else
this.m_Textures = new LotTile.LotTexture[0];
object obj;
return obj;
}
public bool RemoveLand()
{
LotTile.BitmapAusgabe[] bitmapAusgabeArray = new LotTile.BitmapAusgabe[0];
if (this.m_Bitmaps.GetUpperBound(0) > -1)
{
int upperBound = this.m_Bitmaps.GetUpperBound(0);
int index = 0;
while (index <= upperBound)
{
if (StringType.StrCmp(this.m_Bitmaps[index].Typ, "Land", false) != 0)
{
bitmapAusgabeArray = (LotTile.BitmapAusgabe[]) Utils.CopyArray((Array) bitmapAusgabeArray, (Array) new LotTile.BitmapAusgabe[checked (bitmapAusgabeArray.GetUpperBound(0) + 1 + 1)]);
bitmapAusgabeArray[bitmapAusgabeArray.GetUpperBound(0)] = this.m_Bitmaps[index];
}
checked { ++index; }
}
if ((uint) checked (bitmapAusgabeArray.GetUpperBound(0) - 1) > 0U)
{
this.m_Bitmaps = new LotTile.BitmapAusgabe[checked (bitmapAusgabeArray.GetUpperBound(0) + 1)];
this.m_Bitmaps = bitmapAusgabeArray;
}
else
this.m_Bitmaps = new LotTile.BitmapAusgabe[0];
this.RemoveWerteString("0X00000006");
}
bool flag;
return flag;
}
public bool RemoveWater()
{
LotTile.BitmapAusgabe[] bitmapAusgabeArray = new LotTile.BitmapAusgabe[0];
if (this.m_Bitmaps.GetUpperBound(0) > -1)
{
int upperBound = this.m_Bitmaps.GetUpperBound(0);
int index = 0;
while (index <= upperBound)
{
if (StringType.StrCmp(this.m_Bitmaps[index].Typ, "Land", false) != 0)
{
bitmapAusgabeArray = (LotTile.BitmapAusgabe[]) Utils.CopyArray((Array) bitmapAusgabeArray, (Array) new LotTile.BitmapAusgabe[checked (bitmapAusgabeArray.GetUpperBound(0) + 1 + 1)]);
bitmapAusgabeArray[bitmapAusgabeArray.GetUpperBound(0)] = this.m_Bitmaps[index];
}
checked { ++index; }
}
if ((uint) checked (bitmapAusgabeArray.GetUpperBound(0) - 1) > 0U)
{
this.m_Bitmaps = new LotTile.BitmapAusgabe[checked (bitmapAusgabeArray.GetUpperBound(0) + 1)];
this.m_Bitmaps = bitmapAusgabeArray;
}
else
this.m_Bitmaps = new LotTile.BitmapAusgabe[0];
this.RemoveWerteString("0X00000005");
}
bool flag;
return flag;
}
public bool RemoveTraffic()
{
LotTile.BitmapAusgabe[] bitmapAusgabeArray = new LotTile.BitmapAusgabe[0];
if (this.m_Bitmaps.GetUpperBound(0) > -1)
{
int upperBound = this.m_Bitmaps.GetUpperBound(0);
int index = 0;
while (index <= upperBound)
{
if (StringType.StrCmp(this.m_Bitmaps[index].Typ, "TrafficArt", false) != 0 && StringType.StrCmp(this.m_Bitmaps[index].Typ, "TrafficDirection", false) != 0)
{
bitmapAusgabeArray = (LotTile.BitmapAusgabe[]) Utils.CopyArray((Array) bitmapAusgabeArray, (Array) new LotTile.BitmapAusgabe[checked (bitmapAusgabeArray.GetUpperBound(0) + 1 + 1)]);
bitmapAusgabeArray[bitmapAusgabeArray.GetUpperBound(0)] = this.m_Bitmaps[index];
}
checked { ++index; }
}
if (bitmapAusgabeArray.GetUpperBound(0) > -1)
{
this.m_Bitmaps = new LotTile.BitmapAusgabe[checked (bitmapAusgabeArray.GetUpperBound(0) + 1)];
this.m_Bitmaps = bitmapAusgabeArray;
}
else
this.m_Bitmaps = new LotTile.BitmapAusgabe[0];
this.RemoveWerteString("0X00000007");
this.m_TransitArt = "";
this.m_MustExpert = false;
this.m_DirectionArray[0] = (object) "00";
this.m_DirectionArray[1] = (object) "00";
this.m_DirectionArray[2] = (object) "00";
this.m_DirectionArray[3] = (object) "00";
}
bool flag;
return flag;
}
public object RemoveRep16()
{
if (this.m_WerteString.Count > 0)
{
int num1 = checked (this.m_WerteString.Count - 1);
int index1 = 0;
while (index1 <= num1)
{
string[] strArray = this.m_WerteString[index1].ToString().Split(',');
if (StringType.StrCmp(strArray[0].ToUpper(), "0X00000007", false) == 0 && strArray.GetUpperBound(0) == 15)
{
string str = strArray[0];
int num2 = checked (strArray.GetUpperBound(0) - 1);
int index2 = 1;
while (index2 <= num2)
{
str = str + "," + strArray[index2];
checked { ++index2; }
}
this.m_WerteString[index1] = (object) str;
this.m_HasRep16 = false;
break;
}
checked { ++index1; }
}
}
object obj;
return obj;
}
public object RemoveWerteString(string Kennung)
{
if (this.m_WerteString.Count > 0)
{
int num = checked (this.m_WerteString.Count - 1);
int index = 0;
while (index <= num)
{
if (StringType.StrCmp(this.m_WerteString[index].ToString().Split(',')[0].ToUpper(), Kennung, false) == 0)
{
this.m_WerteString.RemoveAt(index);
break;
}
checked { ++index; }
}
}
object obj;
return obj;
}
public string GetRotateMirrorString()
{
if (this.m_WerteString.Count > 0)
{
int num = checked (this.m_WerteString.Count - 1);
int index = 0;
while (index <= num)
{
string[] strArray = this.m_WerteString[index].ToString().Split(',');
if (StringType.StrCmp(strArray[0].ToUpper(), "0X00000007", false) == 0)
return strArray[2];
checked { ++index; }
}
}
return "";
}
public object SetRotateMirrorString(string EingabeString)
{
if (this.m_WerteString.Count > 0)
{
int num = checked (this.m_WerteString.Count - 1);
int index1 = 0;
while (index1 <= num)
{
string[] strArray = this.m_WerteString[index1].ToString().Split(',');
if (StringType.StrCmp(strArray[0].ToUpper(), "0X00000007", false) == 0)
{
string str = strArray[0];
int upperBound = strArray.GetUpperBound(0);
int index2 = 1;
while (index2 <= upperBound)
{
str = index2 != 2 ? str + "," + strArray[index2] : str + "," + EingabeString;
checked { ++index2; }
}
this.m_WerteString[index1] = (object) str;
break;
}
checked { ++index1; }
}
}
object obj;
return obj;
}
private object SetTile()
{
if (this.m_EingabeWerte.Count > 11)
{
string sLeft = StringType.FromObject(LateBinding.LateGet(this.m_EingabeWerte[0], (Type) null, "toupper", new object[0], (string[]) null, (bool[]) null));
if (StringType.StrCmp(sLeft, "0X00000002", false) == 0 | StringType.StrCmp(sLeft, "0X00000007", false) == 0 | StringType.StrCmp(sLeft, "0X00000005", false) == 0 | StringType.StrCmp(sLeft, "0X00000006", false) == 0)
{
object o1 = LateBinding.LateGet(this.m_EingabeWerte[0], (Type) null, "toupper", new object[0], (string[]) null, (bool[]) null);
if (ObjectType.ObjTst(o1, (object) "0X00000002", false) == 0)
this.GetTextureData();
else if (ObjectType.ObjTst(o1, (object) "0X00000005", false) == 0)
{
this.m_isWater = true;
this.GetWaterAndLand();
}
else if (ObjectType.ObjTst(o1, (object) "0X00000006", false) == 0)
{
this.m_isLand = true;
this.GetWaterAndLand();
}
else if (ObjectType.ObjTst(o1, (object) "0X00000007", false) == 0 && this.m_EingabeWerte.Count >= 15)
{
string str = "";
string upper = this.m_EingabeWerte[12].ToString().ToUpper();
if (StringType.StrCmp(upper, "0X00000000", false) == 0)
str = StringType.FromObject(ClassThisProg.DefReader.LanguageArray[330]);
else if (StringType.StrCmp(upper, "0X00000001", false) == 0)
str = StringType.FromObject(ClassThisProg.DefReader.LanguageArray[331]);
else if (StringType.StrCmp(upper, "0X00000002", false) == 0)
str = StringType.FromObject(ClassThisProg.DefReader.LanguageArray[332]);
else if (StringType.StrCmp(upper, "0X00000003", false) == 0)
str = StringType.FromObject(ClassThisProg.DefReader.LanguageArray[333]);
else if (StringType.StrCmp(upper, "0X00000006", false) == 0)
str = StringType.FromObject(ClassThisProg.DefReader.LanguageArray[334]);
else if (StringType.StrCmp(upper, "0X00000008", false) == 0)
str = StringType.FromObject(ClassThisProg.DefReader.LanguageArray[335]);
else if (StringType.StrCmp(upper, "0X00000009", false) == 0)
str = StringType.FromObject(ClassThisProg.DefReader.LanguageArray[336]);
else if (StringType.StrCmp(upper, "0X0000000A", false) == 0)
str = StringType.FromObject(ClassThisProg.DefReader.LanguageArray[337]);
else if (StringType.StrCmp(upper, "0X0000000C", false) == 0)
str = StringType.FromObject(ClassThisProg.DefReader.LanguageArray[338]);
this.m_TransitArt = str;
this.GetTrafficDirection(StringType.FromObject(this.m_EingabeWerte[14]));
this.GetTraffic(StringType.FromObject(this.m_EingabeWerte[2]));
if (this.m_EingabeWerte.Count == 16)
this.m_HasRep16 = true;
}
}
}
object obj;
return obj;
}
private object GetTextureData()
{
int p = checked (this.m_Textures.GetUpperBound(0) + 1);
this.m_Textures = (LotTile.LotTexture[]) Utils.CopyArray((Array) this.m_Textures, (Array) new LotTile.LotTexture[checked (p + 1)]);
this.m_Textures[p].Gruppe = this.m_EingabeWerte[12].ToString();
this.m_Textures[p].Rotation = "0";
this.m_Textures[p].mirror = false;
this.m_Textures[p].isBase = false;
string str = this.m_EingabeWerte[2].ToString();
if (str.Length == 10)
{
if (DoubleType.FromString(str.Substring(2, 1)) == 8.0)
this.m_Textures[p].mirror = true;
string sLeft = str.Substring(9, 1);
if (StringType.StrCmp(sLeft, "0", false) == 0)
this.m_Textures[p].Rotation = "180";
else if (StringType.StrCmp(sLeft, "1", false) == 0)
this.m_Textures[p].Rotation = "270";
else if (StringType.StrCmp(sLeft, "2", false) == 0)
this.m_Textures[p].Rotation = "0";
else if (StringType.StrCmp(sLeft, "3", false) == 0)
this.m_Textures[p].Rotation = "90";
}
this.GetTexture(p);
object obj;
return obj;
}
private object GetTexture(int p)
{
TextureReader.TextureImage textureImage = ClassThisProg.DefReader.TextureListe.SelectTextureWithImage(this.m_Textures[p].Gruppe, 64);
if (!Information.IsNothing((object) textureImage.TextureBitmap))
{
this.m_Bitmaps = (LotTile.BitmapAusgabe[]) Utils.CopyArray((Array) this.m_Bitmaps, (Array) new LotTile.BitmapAusgabe[checked (this.m_Bitmaps.GetUpperBound(0) + 1 + 1)]);
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].AusgabeBild = textureImage.TextureBitmap;
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].Typ = "Texture";
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].isBase = textureImage.isBase;
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].Instance = this.m_Textures[p].Gruppe;
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].isTransparent = true;
this.m_Textures[p].isBase = textureImage.isBase;
string str = "NORTH";
string rotation = this.m_Textures[p].Rotation;
if (StringType.StrCmp(rotation, "0", false) == 0)
str = "NORTH";
else if (StringType.StrCmp(rotation, "90", false) == 0)
str = "EAST";
else if (StringType.StrCmp(rotation, "180", false) == 0)
str = "SOUTH";
else if (StringType.StrCmp(rotation, "270", false) == 0)
str = "WEST";
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].Direction = str;
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].isMirror = this.m_Textures[p].mirror;
}
else
{
Loader loader = new Loader();
this.m_Bitmaps = (LotTile.BitmapAusgabe[]) Utils.CopyArray((Array) this.m_Bitmaps, (Array) new LotTile.BitmapAusgabe[checked (this.m_Bitmaps.GetUpperBound(0) + 1 + 1)]);
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].AusgabeBild = loader.GetPictureFromResource("notfound.bmp");
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].Typ = "Texture";
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].isBase = false;
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].Instance = this.m_Textures[p].Gruppe;
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].isTransparent = true;
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].Direction = "NORTH";
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].isMirror = false;
loader.Dispose();
}
object obj;
return obj;
}
private object GetWaterAndLand()
{
Loader loader = new Loader();
Bitmap pictureFromResource1;
string str;
if (this.m_isLand)
{
pictureFromResource1 = loader.GetPictureFromResource("Land.bmp");
str = "Land";
}
else
{
pictureFromResource1 = loader.GetPictureFromResource("Water.bmp");
str = "Water";
}
Bitmap pictureFromResource2 = loader.GetPictureFromResource("GreyScale.bmp");
Bitmap bitmapWithAlpha = AllgemeineKlasse.GetBitmapWithAlpha(pictureFromResource1, pictureFromResource2);
loader.Dispose();
this.m_Bitmaps = (LotTile.BitmapAusgabe[]) Utils.CopyArray((Array) this.m_Bitmaps, (Array) new LotTile.BitmapAusgabe[checked (this.m_Bitmaps.GetUpperBound(0) + 1 + 1)]);
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].AusgabeBild = bitmapWithAlpha;
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].Typ = str;
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].Direction = "NORTH";
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].isTransparent = false;
object obj;
return obj;
}
private object GetTraffic(string RotateString)
{
ArrayList arrayList = new ArrayList();
Loader loader = new Loader();
string str = "NORTH";
bool flag = false;
string sLeft = RotateString.Substring(9, 1);
if (StringType.StrCmp(sLeft, "2", false) == 0)
{
this.m_MustExpert = true;
str = "SOUTH";
}
else if (StringType.StrCmp(sLeft, "3", false) == 0)
{
this.m_MustExpert = true;
str = "WEST";
}
else if (StringType.StrCmp(sLeft, "0", false) == 0)
{
this.m_MustExpert = false;
str = "NORTH";
}
else if (StringType.StrCmp(sLeft, "1", false) == 0)
{
this.m_MustExpert = true;
str = "EAST";
}
if (DoubleType.FromString(RotateString.Substring(2, 1)) == 8.0)
{
this.m_MustExpert = true;
flag = true;
}
if (StringType.StrCmp(this.m_TransitArt, "", false) != 0)
{
string transitArt = this.m_TransitArt;
Bitmap pictureFromResource;
if (StringType.StrCmp(transitArt, StringType.FromObject(ClassThisProg.DefReader.LanguageArray[333]), false) == 0)
pictureFromResource = loader.GetPictureFromResource("A.bmp");
else if (StringType.StrCmp(transitArt, StringType.FromObject(ClassThisProg.DefReader.LanguageArray[337]), false) == 0)
pictureFromResource = loader.GetPictureFromResource("B.bmp");
else if (StringType.StrCmp(transitArt, StringType.FromObject(ClassThisProg.DefReader.LanguageArray[330]), false) == 0)
pictureFromResource = loader.GetPictureFromResource("C.bmp");
else if (StringType.StrCmp(transitArt, StringType.FromObject(ClassThisProg.DefReader.LanguageArray[334]), false) == 0)
pictureFromResource = loader.GetPictureFromResource("D.bmp");
else if (StringType.StrCmp(transitArt, StringType.FromObject(ClassThisProg.DefReader.LanguageArray[332]), false) == 0)
pictureFromResource = loader.GetPictureFromResource("E.bmp");
else if (StringType.StrCmp(transitArt, StringType.FromObject(ClassThisProg.DefReader.LanguageArray[338]), false) == 0)
pictureFromResource = loader.GetPictureFromResource("F.bmp");
else if (StringType.StrCmp(transitArt, StringType.FromObject(ClassThisProg.DefReader.LanguageArray[331]), false) == 0)
pictureFromResource = loader.GetPictureFromResource("G.bmp");
else if (StringType.StrCmp(transitArt, StringType.FromObject(ClassThisProg.DefReader.LanguageArray[335]), false) == 0)
pictureFromResource = loader.GetPictureFromResource("H.bmp");
else if (StringType.StrCmp(transitArt, StringType.FromObject(ClassThisProg.DefReader.LanguageArray[336]), false) == 0)
pictureFromResource = loader.GetPictureFromResource("I.bmp");
LotTile.BitmapAusgabe bitmapAusgabe;
if (ObjectType.ObjTst(this.m_DirectionArray[0], (object) "00", false) != 0)
{
bitmapAusgabe.Direction = str;
bitmapAusgabe.AusgabeBild = loader.GetPictureFromResource("North.bmp");
bitmapAusgabe.Typ = "TrafficDirection";
bitmapAusgabe.isMirror = flag;
arrayList.Add((object) bitmapAusgabe);
}
if (ObjectType.ObjTst(this.m_DirectionArray[1], (object) "00", false) != 0)
{
bitmapAusgabe.Direction = str;
bitmapAusgabe.AusgabeBild = loader.GetPictureFromResource("West.bmp");
bitmapAusgabe.Typ = "TrafficDirection";
bitmapAusgabe.isMirror = flag;
arrayList.Add((object) bitmapAusgabe);
}
if (ObjectType.ObjTst(this.m_DirectionArray[2], (object) "00", false) != 0)
{
bitmapAusgabe.Direction = str;
bitmapAusgabe.AusgabeBild = loader.GetPictureFromResource("South.bmp");
bitmapAusgabe.Typ = "TrafficDirection";
bitmapAusgabe.isMirror = flag;
arrayList.Add((object) bitmapAusgabe);
}
if (ObjectType.ObjTst(this.m_DirectionArray[3], (object) "00", false) != 0)
{
bitmapAusgabe.Direction = str;
bitmapAusgabe.AusgabeBild = loader.GetPictureFromResource("East.bmp");
bitmapAusgabe.Typ = "TrafficDirection";
bitmapAusgabe.isMirror = flag;
arrayList.Add((object) bitmapAusgabe);
}
int num1 = checked (this.m_DirectionArray.Count - 1);
int index1 = 0;
while (index1 <= num1)
{
if (BooleanType.FromObject(ObjectType.BitAndObj(ObjectType.BitAndObj(ObjectType.BitAndObj(ObjectType.BitAndObj(ObjectType.BitAndObj((object) (ObjectType.ObjTst(LateBinding.LateGet(this.m_DirectionArray[index1], (Type) null, "toupper", new object[0], (string[]) null, (bool[]) null), (object) "00", false) != 0), (object) (ObjectType.ObjTst(LateBinding.LateGet(this.m_DirectionArray[index1], (Type) null, "toupper", new object[0], (string[]) null, (bool[]) null), (object) "01", false) != 0)), (object) (ObjectType.ObjTst(LateBinding.LateGet(this.m_DirectionArray[index1], (Type) null, "toupper", new object[0], (string[]) null, (bool[]) null), (object) "02", false) != 0)), (object) (ObjectType.ObjTst(LateBinding.LateGet(this.m_DirectionArray[index1], (Type) null, "toupper", new object[0], (string[]) null, (bool[]) null), (object) "03", false) != 0)), (object) (ObjectType.ObjTst(LateBinding.LateGet(this.m_DirectionArray[index1], (Type) null, "toupper", new object[0], (string[]) null, (bool[]) null), (object) "04", false) != 0)), (object) (ObjectType.ObjTst(LateBinding.LateGet(this.m_DirectionArray[index1], (Type) null, "toupper", new object[0], (string[]) null, (bool[]) null), (object) "FF", false) != 0))))
{
this.m_MustExpert = true;
break;
}
checked { ++index1; }
}
if (arrayList.Count > 0 && !Information.IsNothing((object) pictureFromResource))
{
this.m_Bitmaps = (LotTile.BitmapAusgabe[]) Utils.CopyArray((Array) this.m_Bitmaps, (Array) new LotTile.BitmapAusgabe[checked (this.m_Bitmaps.GetUpperBound(0) + 1 + 1)]);
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].AusgabeBild = pictureFromResource;
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].Typ = "TrafficArt";
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].Direction = "NORTH";
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)].isMirror = false;
int num2 = checked (arrayList.Count - 1);
int index2 = 0;
while (index2 <= num2)
{
this.m_Bitmaps = (LotTile.BitmapAusgabe[]) Utils.CopyArray((Array) this.m_Bitmaps, (Array) new LotTile.BitmapAusgabe[checked (this.m_Bitmaps.GetUpperBound(0) + 1 + 1)]);
this.m_Bitmaps[this.m_Bitmaps.GetUpperBound(0)] = (LotTile.BitmapAusgabe) (arrayList[index2] ?? Activator.CreateInstance(typeof (LotTile.BitmapAusgabe)));
checked { ++index2; }
}
}
}
loader.Dispose();
object obj;
return obj;
}
private object GetTrafficDirection(string EingabeString)
{
string str = EingabeString.ToUpper().Replace("0X", "");
if (str.Length == 8)
{
this.m_DirectionArray[0] = (object) str.Substring(0, 2);
this.m_DirectionArray[1] = (object) str.Substring(2, 2);
this.m_DirectionArray[2] = (object) str.Substring(4, 2);
this.m_DirectionArray[3] = (object) str.Substring(6, 2);
}
object obj;
return obj;
}
private object FillWerteString()
{
string str = "";
int num = checked (this.m_EingabeWerte.Count - 1);
int index = 0;
while (index <= num)
{
str = str + "," + this.m_EingabeWerte[index].ToString();
checked { ++index; }
}
if (str.StartsWith(","))
str = str.Substring(1, checked (str.Length - 1));
this.m_WerteString.Add((object) str);
object obj;
return obj;
}
private bool CheckCellPosition()
{
int num1 = 0;
int num2 = 0;
string str1 = this.m_EingabeWerte[3].ToString().Substring(0, 5).Replace("0x", "&h");
string str2 = this.m_EingabeWerte[5].ToString().Substring(0, 5).Replace("0x", "&h");
if (StringType.StrCmp(this.m_EingabeWerte[3].ToString().Substring(5, 1), "0", false) != 0)
num2 = 1;
if (StringType.StrCmp(this.m_EingabeWerte[5].ToString().Substring(5, 1), "0", false) != 0)
num1 = 1;
if (Information.IsNumeric((object) str1) & Information.IsNumeric((object) str2))
{
string str3 = StringType.FromDouble(DoubleType.FromString(str1) - 1.0);
if (checked (IntegerType.FromString(StringType.FromDouble(unchecked (DoubleType.FromString(str2) - 1.0))) + num1) == this.m_Zeile & checked (IntegerType.FromString(str3) + num2) == this.m_Spalte)
return true;
}
return false;
}
public struct BitmapAusgabe
{
public Bitmap AusgabeBild;
public string Typ;
public string Direction;
public bool isBase;
public bool isMirror;
public string Instance;
public bool isTransparent;
}
public struct LotTexture
{
public string Gruppe;
public string Rotation;
public bool mirror;
public bool isBase;
}
}
}