Exemplo n.º 1
0
        private int m_LeftSide; // left side of matrix

        public FormCheckersBoard(int i_BoardSize, CheckersGame i_CheckersGame)
        {
            m_CheckersGame = i_CheckersGame;

            this.StartPosition = FormStartPosition.CenterScreen;

            m_CheckersBoard = new CheckersBoard(i_BoardSize);

            i_CheckersGame.RunGame(ref m_CheckersBoard); // runs logic, updates checkersboard

            generateButtonMatrix();

            InitializeComponent();
            this.FormBorderStyle = FormBorderStyle.Fixed3D;

            labelPlayer1.Text = m_CheckersGame.Controller.FirstPlayerName + ":";

            labelPlayer2.Text = m_CheckersGame.Controller.SecondPlayerName + ":";

            this.Left  = m_LeftSide;
            this.Width = m_Width + 90;

            UserClosing       = false;
            this.FormClosing += new FormClosingEventHandler(formCheckersBoard_FormClosing);

            m_CheckersGame.Controller.m_ChessPieceMoved += updateMatrix; // update matrix is notified whenever we update the checkersboard in the logic section and updates the UI
        }
Exemplo n.º 2
0
 public static void Main()
 {
     CheckersGame.RunGame();
 }