Exemple #1
0
        public Tile GetRandomTile(Tile.TileType type)
        {
            Tile temp =
                _tiles[Helper.Random.Next(0, _tiles.GetLength(0) - 1), Helper.Random.Next(0, _tiles.GetLength(1) - 1)];

            while (temp.Type != type)
            {
                temp =
                    _tiles[
                        Helper.Random.Next(0, _tiles.GetLength(0) - 1), Helper.Random.Next(0, _tiles.GetLength(1) - 1)];
            }

            return temp;
        }
 private static void ClearTerrain(Terrain terrain, Tile.TileType tileType)
 {
     for (int iY = 0; iY < terrain.SizeY; iY++)
     {
         for (int iX = 0; iX < terrain.SizeX; iX++)
         {
             terrain.Tiles[iX, iY] = new Tile(iX, iY, terrain, tileType);
         }
     }
 }