Пример #1
0
    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);
    }
Пример #2
0
    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);
    }
Пример #3
0
    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)));
    }
Пример #4
0
    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);
    }
Пример #5
0
    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);
    }
Пример #6
0
 public int GetBiomeMaxType(int x, int z, int mask = -1)
 {
     return(TerrainBiome.IndexToType(this.GetBiomeMaxIndex(x, z, mask)));
 }
Пример #7
0
 public int GetBiomeMaxType(float normX, float normZ, int mask = -1)
 {
     return(TerrainBiome.IndexToType(this.GetBiomeMaxIndex(normX, normZ, mask)));
 }
Пример #8
0
 public int GetBiomeMaxType(Vector3 worldPos, int mask = -1)
 {
     return(TerrainBiome.IndexToType(this.GetBiomeMaxIndex(worldPos, mask)));
 }