示例#1
0
文件: Reversi.cs 项目: Joseph24/AI
        //
        // Calculates a computer move.
        // Note: Executed in the worker thread.
        //
        private void CalculateComputerMove()
        {
            int invoker = 1;

            if (invoker == 1)
            {
                // Load the AI parameters.
                this.SetAIParameters();

                // Find the best available move.
                ComputerMove move = this.GetBestMove(this.board);
                MessageBox.Show(null, move.row.ToString(), move.col.ToString(), MessageBoxButtons.OK);
                // Perform a callback to make the move.
                Object[] args = { move.row, move.col };
                MakeComputerMoveDelegate moveDelegate = new MakeComputerMoveDelegate(this.MakeComputerMove);
                this.BeginInvoke(moveDelegate, args);

            }

            else
            {
                // Load the AI parameters.
                this.SetAIParameters();

                // Find the best available move.
                ComputerMove move = this.GetBestMove(this.board);

                // Perform a callback to make the move.
                Object[] args = { move.row, move.col };

                MessageBox.Show(null, "test", "tess", MessageBoxButtons.OK);
                // MakeComputerMoveDelegate moveDelegate = new MakeComputerMoveDelegate(this.MakeComputerMove);
               // this.BeginInvoke(moveDelegate, args);

            }
        }
示例#2
0
文件: Reversi.cs 项目: ukscone/code
        //
        // Calculates a computer move.
        // Note: Executed in the worker thread.
        //
        private void CalculateComputerMove()
        {
            // Load the AI parameters.
            this.SetAIParameters();

            // Find the best available move.
            ComputerMove move = this.GetBestMove(this.board);

            // Perform a callback to make the move.
            Object[] args = { move.row, move.col };
            MakeComputerMoveDelegate moveDelegate = new MakeComputerMoveDelegate(this.MakeComputerMove);
            this.BeginInvoke(moveDelegate, args);
        }