private void buttonDone_Click(object sender, EventArgs e) { string playerOneName = textBoxplayer1.Text; string playerTwoName = "Computer"; int boardSize; bool isTwoPlayers = checkBoxPlayer2.Checked; if (isTwoPlayers) { playerTwoName = textBoxPlayer2.Text; } if (radioButtonSix.Checked == true) { boardSize = 6; } else if (radioButtonEight.Checked == true) { boardSize = 8; } else { boardSize = 10; } DamkaForm damka = new DamkaForm(boardSize, playerOneName, playerTwoName, isTwoPlayers); this.Hide(); damka.ShowDialog(); this.Close(); }
private void gameIsOver(string i_EndOfGame) { DialogResult userChoice; userChoice = MessageBox.Show(string.Format("{0}{1}Would you like another Game?", i_EndOfGame, System.Environment.NewLine), "Game is over!", MessageBoxButtons.YesNo); if (userChoice == DialogResult.Yes) { DamkaForm anotherGame = new DamkaForm(m_BoardSize, m_FirstPlayerName, m_SecondPlayerName, m_IsTwoPlayer); this.Hide(); anotherGame.ShowDialog(); this.Close(); } else { this.Close(); } }