Example #1
0
        /// <summary>
        /// Creates the maze change start position.
        /// </summary>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public override IMaze CreateMazeChangeStartPosition()
        {
            MatrixMaze newMaze = new MatrixMaze(this);

            newMaze.ChangeStartPosition();
            return(newMaze);
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MatrixMaze"/> class.
 /// using an existing maze
 /// </summary>
 /// <param name="maze">The maze to copy.</param>
 public MatrixMaze(MatrixMaze maze)
 {
     this.width         = maze.width;
     this.height        = maze.height;
     this.solution      = maze.solution;
     this.startPosition = new MazePosition(maze.startPosition.Row,
                                           maze.startPosition.Colomn);
     this.endPosition = new MazePosition(maze.endPosition.Row,
                                         maze.endPosition.Colomn);
     this.mazeMatrix = new char[this.height, this.width];
     for (int i = 0; i < this.height; i++)
     {
         for (int j = 0; j < this.width; j++)
         {
             this.mazeMatrix[i, j] = maze.mazeMatrix[i, j];
         }
     }
 }