예제 #1
0
파일: GameUI.cs 프로젝트: yuguorui/Gomoku
        private void Chessboard_MouseDown(object sender, MouseEventArgs e)
        {
            int x = Pixel2Index(e.X);
            int y = Pixel2Index(e.Y);

            if (gs.PlaceChess(x, y, gs.NextPlayer()))
            {
                DrawChess(x, y, gs.NextPlayer());
                Redraw();
                if (gs.WhoIsWin() != ChessPiece.EMPTY)
                {
                    Win(gs.WhoIsWin());
                    return;
                }

                if (enableNeuroSuccessful)
                {
                    GameAI.PlaceChessAI(gs, NeuroEvaluateFunction);
                }
                else
                {
                    GameAI.PlaceChessAI(gs, GameAI.EvaluateFunctionWithoutNervus);
                }

                DrawChess(gs.X, gs.Y, gs.NextPlayer());
                Redraw();
                if (gs.WhoIsWin() != ChessPiece.EMPTY)
                {
                    Win(gs.WhoIsWin());
                }
            }

            //MessageBox.Show(Pixel2Index(x).ToString() + ' ' + Pixel2Index(y).ToString());
        }
예제 #2
0
파일: GameUI.cs 프로젝트: yuguorui/Gomoku
 public void RunThread()
 {
     GameAI.PlaceChessAI(game_state, ef);
 }