private void Update_Tick(object sender, EventArgs e) { if (!game.GameIsEnded()) { game.Draw(); switch (game.WhoIsWon()) { case Player.X: game.EndGame(); MessageBox.Show("X"); break; case Player.O: game.EndGame(); MessageBox.Show("O"); break; case Player.DRAW: game.EndGame(); MessageBox.Show("DRAW"); break; } } }
private void GameUpdate() { game.Draw(); if (!game.GameIsEnded()) { Player winner = game.WhoIsWon(); if (winner != Player.NONE) { game.EndGame(); Client.SendMessage("endGame;" + Client.GetSelectedGame() + ";" + winner); turn.Text = ""; switch (winner) { case Player.X: turn.Text = "Blue player wins!"; break; case Player.O: turn.Text = "Red player wins!"; break; case Player.DRAW: turn.Text = "Draw!"; break; } } } }
private void update_Tick(object sender, EventArgs e) { game.Draw(); if (analysis.Checked) { diff.Enabled = true; } else { diff.Enabled = false; } }
private void botField_MouseClick(object sender, MouseEventArgs e) { if (botGameIsPlaying) { botGameCopy = botGame.Clone(); if (botGame.SetMark(new Point(e.X, e.Y), playerColor) == "ERROR") { return; } CheckGameState(); if (!botGame.GameIsEnded()) { String gameState = botGame.gameStateToString(); String botMove = bot.NextMove(gameState); Console.WriteLine(botMove); botGame.SetMark(botMove); CheckGameState(); if (analysis.Checked && botGameIsPlaying) { botGame.DisableAnalysis(); botGame.Draw(); String scores = bot.Analysis(botGame.gameStateToString()); botGame.EnableAnalysis(scores); } } botGame.Draw(); } }