/// <summary> /// Solve one step of the maze /// </summary> /// <returns>Done</returns> public bool SolveStep() { if (solutionRoutine == null) { if (solution == null) { solution = new MazeSolver.Solution(this); } solutionRoutine = MazeSolver.SolveStep(solution); } solutionRoutine.MoveNext(); bool done = false; if (solutionRoutine.Current != null) { done = (bool)solutionRoutine.Current; } if (done) { solutionRoutine = null; } return(done); }
/// <summary> /// Solve the maze /// </summary> public void Solve() { solution = new MazeSolver.Solution(this); MazeSolver.Solve(solution); }