Пример #1
0
 private void gameLogic_NewGame(object sender, MemoryGameEventArgs e)
 {
     r_GameLogic.ComputerMove       += gameLogic_ComputerMove;
     r_GameLogic.PlayersInfoChanged += gameLogic_PlayersInfoChanged;
     r_GameLogic.GameOver           += gameLogic_GameOver;
     setBoardCellsOnVisibilityChanged();
     m_BoardForm = new BoardForm(r_GameLogic.GameBoard, e.PlayerOneName, e.PlayerTwoName);
     m_BoardForm.CellsView.CellClicked += cellsView_CellClicked;
     m_BoardForm.ShowDialog();
 }
Пример #2
0
        public static void StartGame()
        {
            BoardForm   mainForm     = new BoardForm();
            SettingForm settingsForm = new SettingForm(mainForm);

            settingsForm.ShowDialog();
            while ((settingsForm.FirstPlayerName == string.Empty || settingsForm.SecondPlayerName == string.Empty) && !settingsForm.XButtunClicked)
            {
                settingsForm.ShowDialog();
            }

            if (settingsForm.DialogResult == DialogResult.OK)
            {
                mainForm.ShowDialog();
            }
        }