private void Form1_Load(object sender, System.EventArgs e) { _mIRowDimensions = (int)NumRows.Value; _mIColDimensions = (int)NumCols.Value; _iExitPointX = (int)NumRows.Value - 1; _iExitPointY = (int)NumCols.Value - 1; m_Maze = new MazeSolver.MazeSolver(_mIRowDimensions, _mIColDimensions); this.pictureMaze.Size = new System.Drawing.Size(_mIColDimensions * m_iSize + 3, _mIRowDimensions * m_iSize + 3); _mIMaze = m_Maze.GetMaze; this.lblCoordinates.Visible = true; this.lblTextGeneral.Visible = false; GenerateMaze(); }
private void cmdReset_Click(object sender, System.EventArgs e) { _mIRowDimensions = (int)NumRows.Value; _mIColDimensions = (int)NumCols.Value; if (_iStartPointX > (int)NumRows.Value - 1 || _iStartPointY > (int)NumCols.Value - 1) { _iStartPointX = _iStartPointY = 0; } if (_iExitPointX > (int)NumRows.Value - 1 || _iExitPointY > (int)NumCols.Value - 1) { _iExitPointX = (int)NumRows.Value - 1; _iExitPointY = (int)NumCols.Value - 1; } m_Maze = new MazeSolver.MazeSolver(_mIRowDimensions, _mIColDimensions); m_Maze.AllowDiagonals = this.chkDiagonal.Checked; _mIMaze = m_Maze.GetMaze; pictureMaze.Width = (_mIColDimensions + 1) * 20; pictureMaze.Height = (_mIRowDimensions + 1) * 20; this.Refresh(); GenerateMaze(); }