Esempio n. 1
0
        internal TileType GetTileForHeight(float height)
        {
            TileBiome tb = TileType.Where(x => x.minHeight <= height && x.maxHeight >= height).OrderBy(x => Utils.Random(0, 100)).FirstOrDefault();

            if (tb == null)
            {
                Utils.LogError("No tileBiome found for height: " + height);
                return(null);
            }
            return(biomes.GetTileTypeWithTag(tb.tags));
        }
Esempio n. 2
0
        internal void LoadFromCSV(string[] lineData)
        {
            TileBiome tb = new TileBiome();
            int       i  = 0;//0=name

            tb.name      = lineData[i++];
            tb.minHeight = float.Parse(lineData[i++]);
            tb.maxHeight = float.Parse(lineData[i++]);
            tb.tags      = lineData[i++];

            TileType.Add(tb);
        }