示例#1
0
        private void UpdateMoves()
        {
            player      = BackendHelper.SwapPlayer(player);
            label1.Text = BackendHelper.PlayerToString(player);
            label6.Text = board.Befores[player].ToString();

            moveListBox.Items.Clear();

            foreach (Move move in board.GetPossibleMoves(player))
            {
                moveListBox.Items.Add(move);
            }

            UpdateControls();
        }
示例#2
0
        private void PerformMove(Move move)
        {
            transistionListBox.Items.Add(board.PerformMove(move));

            if (board.Winner == player)
            {
                moveListBox.Items.Clear();

                boardControl.Enabled       = false;
                moveListBox.Enabled        = false;
                transistionListBox.Enabled = false;
                backButton.Enabled         = false;
                timer1.Enabled             = false;

                UpdateControls();

                MessageBox.Show("Wygra³ " + BackendHelper.PlayerToString(player));
            }
            else
            {
                UpdateMoves();
            }
        }