Beispiel #1
0
 private float TryGetHeightScale(Tile t)
 {
     try
     {
         return t.HeightScale;
     }
     catch (NullReferenceException)
     {
         return -255;
     }
 }
Beispiel #2
0
        public void SeedMap(Tile north, Tile east, Tile south, Tile west)
        {
            for (int i = 0; i < this.Size; i++)
            {
                if (north != null)
                    this.HeightMap[i, this.SubSize] = north.HeightMap[i, 0];

                if (east != null)
                    this.HeightMap[this.SubSize, i] = east.HeightMap[0, i];

                if (south != null)
                    this.HeightMap[i, 0] = south.HeightMap[i, this.SubSize];

                if (west != null)
                    this.HeightMap[0, i] = west.HeightMap[this.SubSize, i];
            }

            SeedHeightScale(north, east, south, west);

            SeedCorners();

            if (north == null) SeedNorth();
            if (east == null) SeedEast();
            if (south == null) SeedSouth();
            if (west == null) SeedWest();
        }