private void btnNewGame_Click(object sender, EventArgs e) { var result = MessageBox.Show("Are you sure you would like to start a new game?", "New Game", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (result == DialogResult.OK) { UIHelpers.CloseOpenWindows(); UIHelpers.ClearControls(this.Controls); _pencilMarks = new Canidates(); _setup = new ControlLogic.SetupPuzzle(_difficultySelection); _setup.UpdateCanidates(); puzzleReady = false; _difficultySelection = cmboxDifficulty.SelectedIndex; _userAnswers = new PuzzleNine(1); fillSetupPuzzle(); puzzleReady = true; _userAnswers.ResetCoordinates(); combineTruthSetupAndUsers(); toolStrip.Text = "Good luck and have fun!"; } }
public Solver(PuzzleNine puzzle) { // make sure that it is creating a new object and not passing a reference _puzzleObject = puzzle.CopyPuzzle(); _puzzleObject.ResetCoordinates(); _puzzleObject.UpdateCoordinates(); findPossibleAnswers(); SinglePosition(); }