예제 #1
0
파일: Maze.cs 프로젝트: Tjakka5/MazeSolver
        /// <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);
        }
예제 #2
0
파일: Maze.cs 프로젝트: Tjakka5/MazeSolver
 /// <summary>
 /// Solve the maze
 /// </summary>
 public void Solve()
 {
     solution = new MazeSolver.Solution(this);
     MazeSolver.Solve(solution);
 }