コード例 #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);
 }