terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
DunesBiome.cs
Go to the documentation of this file.
1using System;
9
11{
12 // Token: 0x020008EA RID: 2282
13 public class DunesBiome : MicroBiome
14 {
15 // Token: 0x170007EB RID: 2027
16 // (get) Token: 0x060045F8 RID: 17912 RVA: 0x00256738 File Offset: 0x00254938
17 public int MaximumWidth
18 {
19 get
20 {
22 }
23 }
24
25 // Token: 0x060045F9 RID: 17913 RVA: 0x00256750 File Offset: 0x00254950
26 public override bool Place(Point origin, StructureMap structures)
27 {
28 /*
29An exception occurred when decompiling this method (060045F9)
30
31ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean Terraria.GameContent.Biomes.DunesBiome::Place(Microsoft.Xna.Framework.Point,Terraria.WorldBuilding.StructureMap)
32
33 ---> System.Exception: Basic block has to end with unconditional control flow.
34{
35 Block_0:
36 stloc:UnifiedRandom(var_1_07, callgetter:UnifiedRandom(GenBase::get__random))
37 stloc:int32(var_2_0A, ldc.i4:int32(60))
38 stloc:int32(var_3_0D, ldc.i4:int32(100))
39 stloc:int32(var_4_16, call:int32(UnifiedRandom::Next, ldloc:UnifiedRandom(var_1_07), ldloc:int32(var_2_0A), ldloc:int32(var_3_0D)))
40 stloc:float64(var_5_1E, ldfld:float64(DunesBiome::_heightScale, ldloc:DunesBiome(this)))
41 stloc:UnifiedRandom(var_7_28, callgetter:UnifiedRandom(GenBase::get__random))
42 stloc:int32(var_8_2C, ldc.i4:int32(60))
43 stloc:int32(var_9_30, ldc.i4:int32(100))
44 stloc:int32(var_10_3D, call:int32(UnifiedRandom::Next, ldloc:UnifiedRandom(var_7_28), ldloc:int32(var_8_2C), ldloc:int32(var_9_30)))
45 stloc:float64(var_11_45, ldfld:float64(DunesBiome::_heightScale, ldloc:DunesBiome(this)))
46 stloc:WorldGenRange(var_12_4D, ldfld:WorldGenRange(DunesBiome::_singleDunesWidth, ldloc:DunesBiome(this)))
47 stloc:UnifiedRandom(var_14_57, callgetter:UnifiedRandom(GenBase::get__random))
48 stloc:int32(var_15_62, call:int32(WorldGenRange::GetRandom, ldloc:WorldGenRange(var_12_4D), ldloc:UnifiedRandom(var_14_57)))
49 stloc:WorldGenRange(var_16_6A, ldfld:WorldGenRange(DunesBiome::_singleDunesWidth, ldloc:DunesBiome(this)))
50 stloc:UnifiedRandom(var_18_74, callgetter:UnifiedRandom(GenBase::get__random))
51 stloc:int32(var_20_82, call:int32(WorldGenRange::GetRandom, ldloc:WorldGenRange(var_16_6A), ldloc:UnifiedRandom(var_18_74)))
52 call:void(DunesBiome::PlaceSingle, ldloc:DunesBiome(this), ldloc:DunesDescription(var_21), ldloc:StructureMap(structures))
53 call:void(DunesBiome::PlaceSingle, ldloc:DunesBiome(this), ldloc:DunesDescription(var_22), ldloc:StructureMap(structures))
54}
55
56 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
57 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
58 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
59 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
60 --- End of inner exception stack trace ---
61 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
62 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
63*/;
64 }
65
66 // Token: 0x060045FA RID: 17914 RVA: 0x002567F8 File Offset: 0x002549F8
67 private void PlaceSingle(DunesBiome.DunesDescription description, StructureMap structures)
68 {
70 int num = 3;
71 int num2 = random.Next(num);
72 Rectangle <Area>k__BackingField = description.<Area>k__BackingField;
73 int width = description.<Area>k__BackingField.Width;
75 int num3 = 6;
76 int num4 = random2.Next(num, num3);
77 double heightScale = this._heightScale;
79 int num5 = 2;
80 int num6 = random3.Next(num5);
81 Rectangle <Area>k__BackingField2 = description.<Area>k__BackingField;
82 int width2 = description.<Area>k__BackingField.Width;
83 long num7 = 0L;
85 int num8 = 11;
86 int num9 = random4.Next((int)num7, num8);
87 double heightScale2 = this._heightScale;
88 DunesBiome.PlaceHill(num9, (int)num7, heightScale2, description);
89 Rectangle <Area>k__BackingField3 = description.<Area>k__BackingField;
90 int width3 = description.<Area>k__BackingField.Width;
91 }
92
93 // Token: 0x060045FB RID: 17915 RVA: 0x002568D0 File Offset: 0x00254AD0
94 private static void PlaceHill(int startX, int endX, double scale, DunesBiome.DunesDescription description)
95 {
96 SurfaceMap <Surface>k__BackingField = description.<Surface>k__BackingField;
97 short num = <Surface>k__BackingField[startX];
98 SurfaceMap <Surface>k__BackingField2 = description.<Surface>k__BackingField;
99 long num2 = 0L;
100 short num3 = <Surface>k__BackingField2[endX];
101 DunesBiome.WindDirection <WindDirection>k__BackingField = description.<WindDirection>k__BackingField;
102 int num4 = WorldGen.genRand.Next(endX, (int)num2);
105 }
106
107 // Token: 0x060045FC RID: 17916 RVA: 0x0025693C File Offset: 0x00254B3C
108 private static void PlaceCurvedLine(Point startPoint, Point endPoint, Point anchorOffset, DunesBiome.DunesDescription description)
109 {
110 int num = 1;
111 if (num == 0)
112 {
113 }
114 Vector2D vector2D = startPoint.ToVector2D();
115 Vector2D vector2D2 = endPoint.ToVector2D();
116 if (num == 0)
117 {
118 }
119 if (num == 0)
120 {
121 }
122 Point point;
123 bool flag = point == anchorOffset;
124 Rectangle <Area>k__BackingField = description.<Area>k__BackingField;
125 int width = description.<Area>k__BackingField.Width;
126 SurfaceMap <Surface>k__BackingField = description.<Surface>k__BackingField;
127 Tile tile;
128 bool flag2 = tile.active();
129 Tile tile2;
130 ushort type = tile2.type;
131 Tile tile3;
133 int num2 = 53;
134 Tile tile4;
135 tile4.ResetToType((ushort)num2);
136 }
137
138 // Token: 0x060045FD RID: 17917 RVA: 0x002569C0 File Offset: 0x00254BC0
139 public DunesBiome()
140 {
141 if (!true)
142 {
143 }
145 base..ctor();
146 }
147
148 // Token: 0x04008250 RID: 33360
149 [JsonProperty("SingleDunesWidth")]
151
152 // Token: 0x04008251 RID: 33361
153 [JsonProperty("HeightScale")]
154 private double _heightScale;
155
156 // Token: 0x020008EB RID: 2283
157 private class DunesDescription
158 {
159 // Token: 0x170007EC RID: 2028
160 // (get) Token: 0x060045FE RID: 17918 RVA: 0x002569E0 File Offset: 0x00254BE0
161 // (set) Token: 0x060045FF RID: 17919 RVA: 0x002569F4 File Offset: 0x00254BF4
162 public bool IsValid
163 {
165 get
166 {
167 return this.<IsValid>k__BackingField;
168 }
170 private set
171 {
172 }
173 }
174
175 // Token: 0x170007ED RID: 2029
176 // (get) Token: 0x06004600 RID: 17920 RVA: 0x00256A04 File Offset: 0x00254C04
177 // (set) Token: 0x06004601 RID: 17921 RVA: 0x00256A18 File Offset: 0x00254C18
179 {
181 get
182 {
183 return this.<Surface>k__BackingField;
184 }
186 private set
187 {
189 }
190 }
191
192 // Token: 0x170007EE RID: 2030
193 // (get) Token: 0x06004602 RID: 17922 RVA: 0x00256A2C File Offset: 0x00254C2C
194 // (set) Token: 0x06004603 RID: 17923 RVA: 0x00256A50 File Offset: 0x00254C50
196 {
198 get
199 {
201 int width = this.<Area>k__BackingField.Width;
202 return rectangle;
203 }
205 private set
206 {
207 this.<Area>k__BackingField = value;
208 }
209 }
210
211 // Token: 0x170007EF RID: 2031
212 // (get) Token: 0x06004604 RID: 17924 RVA: 0x00256A64 File Offset: 0x00254C64
213 // (set) Token: 0x06004605 RID: 17925 RVA: 0x00256A78 File Offset: 0x00254C78
215 {
217 get
218 {
219 return this.<WindDirection>k__BackingField;
220 }
222 private set
223 {
225 }
226 }
227
228 // Token: 0x06004606 RID: 17926 RVA: 0x00256A8C File Offset: 0x00254C8C
230 {
231 }
232
233 // Token: 0x06004607 RID: 17927 RVA: 0x00256AA0 File Offset: 0x00254CA0
234 public static DunesBiome.DunesDescription CreateFromPlacement(Point origin, int width, int height)
235 {
236 int num = 1;
237 long num2 = 0L;
238 SurfaceMap surfaceMap = SurfaceMap.FromArea(-1073741824, (int)num2);
239 if (num == 0)
240 {
241 }
243 int num3 = 2;
244 int num4 = genRand.Next(num3);
245 return -1073741824;
246 }
247
248 // Token: 0x04008252 RID: 33362
250 private bool <IsValid>k__BackingField;
251
252 // Token: 0x04008253 RID: 33363
254 private SurfaceMap <Surface>k__BackingField;
255
256 // Token: 0x04008254 RID: 33364
258 private Rectangle <Area>k__BackingField;
259
260 // Token: 0x04008255 RID: 33365
263 }
264
265 // Token: 0x020008EC RID: 2284
266 private enum WindDirection
267 {
268 // Token: 0x04008257 RID: 33367
269 Left,
270 // Token: 0x04008258 RID: 33368
271 Right
272 }
273 }
274}
class f__AnonymousType0<< Count > j__TPar
static SurfaceMap FromArea(int startX, int width)
Definition SurfaceMap.cs:81
DunesBiome.WindDirection< WindDirection > k__BackingField
static DunesBiome.DunesDescription CreateFromPlacement(Point origin, int width, int height)
void PlaceSingle(DunesBiome.DunesDescription description, StructureMap structures)
Definition DunesBiome.cs:67
static void PlaceCurvedLine(Point startPoint, Point endPoint, Point anchorOffset, DunesBiome.DunesDescription description)
static void PlaceHill(int startX, int endX, double scale, DunesBiome.DunesDescription description)
Definition DunesBiome.cs:94
override bool Place(Point origin, StructureMap structures)
Definition DunesBiome.cs:26
static UnifiedRandom _random
Definition GenBase.cs:13
static UnifiedRandom genRand
Definition WorldGen.cs:38
void ResetToType(ushort type)
Definition Tile.cs:1298
ushort type
Definition Tile.cs:58
bool active()
Definition Tile.cs:1241
void ClearEverything()
Definition Tile.cs:355