private bool isGameOverOrNewTurn() { bool isGameOver; if (isGameOver = m_GameModel.IsGameOver()) { string winOrTie; if (m_GameModel.IsWin) { winOrTie = "A Win!"; } else { winOrTie = "A Tie!"; } DialogResult isAnotherGame = MessageBox.Show(string.Format("{0}Would you like to play another round?", m_GameModel.WinnerMsg), winOrTie, MessageBoxButtons.YesNo); if (isAnotherGame == DialogResult.Yes) { m_CurrentOpponent = m_GameModel.OpponentX; newGame(); } else { DialogResult isNewGameBord = MessageBox.Show(string.Format("Do you want to play a New Game with other players or a different board size?"), "New Game or Exit", MessageBoxButtons.YesNo); if (isNewGameBord == DialogResult.Yes) { this.Dispose(); BoardGame newBoardGame = new BoardGame(); newBoardGame.ShowDialog(); } else { MessageBox.Show("Thank you for playing X Mix Drix!"); Application.Exit(); } } } else { updateTurn(); } return(isGameOver); }
public static void Main() { BoardGame newBoardGame = new BoardGame(); newBoardGame.ShowDialog(); }