public void CarveMaze(IMaze maze, IAlgorithm algorithm) { _ = maze ?? throw new ArgumentNullException(nameof(maze)); _ = algorithm ?? throw new ArgumentNullException(nameof(algorithm)); algorithm.Carve(maze); }
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]); }