Ejemplo n.º 1
0
        void solveButton_Click(object sender, EventArgs e)
        {
            SolveForm f = new SolveForm(this.DesktopLocation);

            f.Show();
            this.Hide();
            f.FormClosed += new FormClosedEventHandler((s, args) => {
                this.Show();
                if (method == Method.CANCELED)
                {
                    return;
                }

                switch (method)
                {
                case Method.BFS:
                    BFS bfs = new BFS(gridCopy(grid));
                    bfs.Show();
                    break;

                case Method.DFS:
                    DFS dfs = new DFS(gridCopy(grid));
                    dfs.Show();
                    break;

                case Method.DIJKSTRA:
                    Dijkstra dijkstra = new Dijkstra(gridCopy(grid));
                    dijkstra.Show();
                    break;

                case Method.ASTAR:
                    AStarPathfinding astar = new AStarPathfinding(gridCopy(grid));
                    astar.Show();
                    break;
                }
            });
        }