public float GetBiomeMax(int x, int z, int mask = -1) { byte num1 = 0; for (int index = 0; index < this.num; ++index) { if ((TerrainBiome.IndexToType(index) & mask) != 0) { byte num2 = this.src[(index * this.res + z) * this.res + x]; if ((int)num2 >= (int)num1) { num1 = num2; } } } return((float)num1); }
public float GetBiomeMax(int x, int z, int mask = -1) { byte num = 0; for (int i = 0; i < this.num; i++) { if ((TerrainBiome.IndexToType(i) & mask) != 0) { byte num1 = this.src[(i * this.res + z) * this.res + x]; if (num1 >= num) { num = num1; } } } return((float)num); }
public float GetBiome(int x, int z, int mask) { if (Mathf.IsPowerOfTwo(mask)) { return(BitUtility.Byte2Float((int)this.src[(TerrainBiome.TypeToIndex(mask) * this.res + z) * this.res + x])); } int num = 0; for (int index = 0; index < this.num; ++index) { if ((TerrainBiome.IndexToType(index) & mask) != 0) { num += (int)this.src[(index * this.res + z) * this.res + x]; } } return(Mathf.Clamp01(BitUtility.Byte2Float(num))); }
public int GetBiomeMaxIndex(int x, int z, int mask = -1) { byte num1 = 0; int num2 = 0; for (int index = 0; index < this.num; ++index) { if ((TerrainBiome.IndexToType(index) & mask) != 0) { byte num3 = this.src[(index * this.res + z) * this.res + x]; if ((int)num3 >= (int)num1) { num1 = num3; num2 = index; } } } return(num2); }
public int GetBiomeMaxIndex(int x, int z, int mask = -1) { byte num = 0; int num1 = 0; for (int i = 0; i < this.num; i++) { if ((TerrainBiome.IndexToType(i) & mask) != 0) { byte num2 = this.src[(i * this.res + z) * this.res + x]; if (num2 >= num) { num = num2; num1 = i; } } } return(num1); }
public int GetBiomeMaxType(int x, int z, int mask = -1) { return(TerrainBiome.IndexToType(this.GetBiomeMaxIndex(x, z, mask))); }
public int GetBiomeMaxType(float normX, float normZ, int mask = -1) { return(TerrainBiome.IndexToType(this.GetBiomeMaxIndex(normX, normZ, mask))); }
public int GetBiomeMaxType(Vector3 worldPos, int mask = -1) { return(TerrainBiome.IndexToType(this.GetBiomeMaxIndex(worldPos, mask))); }