Exemplo n.º 1
0
        public void CarveMaze(IMaze maze, IAlgorithm algorithm)
        {
            _ = maze ?? throw new ArgumentNullException(nameof(maze));
            _ = algorithm ?? throw new ArgumentNullException(nameof(algorithm));

            algorithm.Carve(maze);
        }
Exemplo n.º 2
0
        public SolvedMaze(Maze maze, IAlgorithm algorithm, ISolveMazes solver)
        {
            _ = maze ?? throw new ArgumentNullException(nameof(maze));
            _ = algorithm ?? throw new ArgumentNullException(nameof(algorithm));
            _ = solver ?? throw new ArgumentNullException(nameof(solver));

            this.maze = maze;
            Algorithm = algorithm;
            Solver    = solver;

            Algorithm.Carve(maze);
            Solver.Solve(maze, Grid[0]);
        }