public void SolveMaze(IMaze maze, ISolveMazes solver) { _ = maze ?? throw new ArgumentNullException(nameof(maze)); _ = solver ?? throw new ArgumentNullException(nameof(solver)); solver.Solve(maze, maze.Grid[0]); }
public SolvedMaze GenerateCarveAndSolve(Type algorithm, ISolveMazes solver, int width = Maze.DEFAULT_WIDTH, int height = Maze.DEFAULT_WIDTH) { _ = algorithm ?? throw new ArgumentNullException(nameof(algorithm)); _ = solver ?? throw new ArgumentNullException(nameof(solver)); var maze = GenerateMaze(width, height); var algo = CreateAlgorithm(algorithm); return(new SolvedMaze((Maze)maze, algo, solver)); }
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]); }
public DrawConsoleDistances(ISolveMazes solver) { _ = solver ?? throw new ArgumentNullException(nameof(solver)); this.solver = solver; }