Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SurfaceMap()

Terraria.GameContent.Biomes.Desert.SurfaceMap.SurfaceMap ( short[] heights,
int x )
inlineprivate

Definition at line 21 of file SurfaceMap.cs.

22 {
23 _heights = heights;
24 X = x;
25 int num = 0;
26 int num2 = int.MaxValue;
27 int num3 = 0;
28 for (int i = 0; i < heights.Length; i++)
29 {
30 num3 += heights[i];
31 num = Math.Max(num, heights[i]);
32 num2 = Math.Min(num2, heights[i]);
33 }
34 if ((double)num > Main.worldSurface - 10.0)
35 {
36 num = (int)Main.worldSurface - 10;
37 }
38 Bottom = num;
39 Top = num2;
40 Average = (double)num3 / (double)_heights.Length;
41 }
static byte Min(byte val1, byte val2)
Definition Math.cs:912
static byte Max(byte val1, byte val2)
Definition Math.cs:738

References Terraria.GameContent.Biomes.Desert.SurfaceMap._heights, Terraria.GameContent.Biomes.Desert.SurfaceMap.Average, Terraria.GameContent.Biomes.Desert.SurfaceMap.Bottom, System.Math.Max(), System.Math.Min(), Terraria.GameContent.Biomes.Desert.SurfaceMap.Top, Terraria.Main.worldSurface, and Terraria.GameContent.Biomes.Desert.SurfaceMap.X.

Referenced by Terraria.GameContent.Biomes.Desert.SurfaceMap.FromArea().