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()); }
public void RunThread() { GameAI.PlaceChessAI(game_state, ef); }