Example #1
0
 public Maze(int height, int width, IOutputMazeTileGrid grid)
 {
     this.Height  = height;
     this.Width   = width;
     this.cells   = new MazeTile[height * width];
     r            = new Random(DateTime.Now.Millisecond);
     mazeTileGrid = grid;
 }
Example #2
0
 public void Draw(IOutputMazeTileGrid tileGrid)
 {
     for (int x = 0; x < this.Width; x++)
     {
         for (int y = 0; y < this.Height; y++)
         {
             MazeTile tile = this.Get(x, y);
             if (tile == MazeTile.Open)
             {
                 tileGrid.MarkOpen(x, y);
             }
             else if (tile == MazeTile.Wall)
             {
                 tileGrid.MarkWall(x, y);
             }
         }
     }
     tileGrid.Draw();
 }
Example #3
0
 public void Initialize(int height, int width, int tileSize)
 {
     outputGrid = new ColoredGrid(height, width, tileSize, Color.Black, graphics);
     maze       = new Maze(height, width, outputGrid);
     maze.SetAlgorithm(this.algo);
 }