示例#1
0
 internal SettingForm(BoardForm io_FormToInitiate)
 {
     m_BoardSizeOptionsIndex = 1;
     r_BoardSizeOptions      = new List <string>();
     r_MainFormReference     = io_FormToInitiate;
     FormClosing            += settingForm_FormClosing;
     boardSizeOption();
     InitializeComponent();
 }
示例#2
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();
 }
示例#3
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();
            }
        }