예제 #1
0
        private void initializeComponent(int i_BoardSize, bool i_AgainstComputer)
        {
            SuspendLayout();
            ForeColor     = SystemColors.ButtonHighlight;
            Name          = "Game";
            Text          = "Otello - Yellow's turn";
            m_BoardMatrix = new BoardMatrix(i_BoardSize, this);
            for (int i = 0; i < r_SizeOfBoard; i++)
            {
                for (int j = 0; j < r_SizeOfBoard; j++)
                {
                    this.Controls.Add(m_BoardMatrix.Get_Button(i, j));
                }
            }

            CenterToScreen();
            m_GameLogic         = new Game(i_BoardSize, i_AgainstComputer);
            AutoScaleDimensions = new SizeF(6F, 13F);
            AutoScaleMode       = AutoScaleMode.Font;
            ClientSize          = new Size((i_BoardSize * 40) + 40, (i_BoardSize * 40) + 40);
            FormBorderStyle     = FormBorderStyle.FixedToolWindow;
            MaximizeBox         = false;
            m_UserPossibleMove  = ShowUserLegalMoves();
        }
예제 #2
0
 public ButtonHandler(BoardMatrix i_BoardMatrix)
 {
     m_BoardMatrix = i_BoardMatrix;
     m_Game        = m_BoardMatrix.GetGameForm;
     InitializeComponent();
 }