Пример #1
0
        public OthelloGameBoardForm(OthelloGameBoard i_OthelloGameBoard, OthelloGamePlayer i_FirstPlayer, OthelloGamePlayer i_SecondPlayer)
        {
            InitializeComponent();

            m_GameBoardSize     = i_OthelloGameBoard.OtheloGameBoardMatrixDimension;
            m_OthelloGameRules  = new OthelloGameRules(m_GameBoardSize, i_SecondPlayer);
            m_OthelloGameBoard  = i_OthelloGameBoard;
            m_FirstPlayer       = i_FirstPlayer;
            m_SecondPlayer      = i_SecondPlayer;
            m_CurrentSignalTurn = OthelloGamePlayer.ePlayerColorTypes.Black;
            m_ButtonsMatrix     = new ButtonWithPositionInMatrix[m_GameBoardSize, m_GameBoardSize];
        }
Пример #2
0
        public void OnClickStartPlayNewGameButton(object i_Sender, EventArgs i_EventArgs)
        {
            OthelloGamePlayer firstPlayer, secondPlayer;

            // Create the game board according to the user choise in the settings form
            OthelloGameBoard othelloGameBoard = new OthelloGameBoard(BoardSizeChoise);

            updateTheRequiredGameType(i_Sender);

            createThePlayers(out firstPlayer, out secondPlayer, this.GameStatus);

            // Display the board game form to user
            OthelloGameBoardForm othelloGameBoardForm = new OthelloGameBoardForm(othelloGameBoard, firstPlayer, secondPlayer);

            // Make setting form Invisible
            this.Visible = false;

            othelloGameBoardForm.ShowDialog();
        }