public void Checkmate(bool MovedIsHuman, bool LostIsHuman, int ColorWin) { string winloss = "Checkmate!\n"; if (MovedIsHuman) { if (!LostIsHuman) { winloss += "You won, congratulations!"; } else { winloss += (ColorWin == Color.White) ? "White wins!" : "Black wins!"; } } else { if (LostIsHuman) { winloss += "You lost:(\n\n\n\n\n\n (hehehe)"; } else { winloss += (ColorWin == Color.White) ? "White wins!" : "Black wins!"; } } TestOutput.ForeColor = System.Drawing.Color.Red; TestOutput.Text += winloss; TestOutput.SelectionStart = TestOutput.TextLength; TestOutput.ScrollToCaret(); }
public void Title(string Text) { this.Text = Text; TestOutput.SelectionStart = TestOutput.TextLength; TestOutput.ScrollToCaret(); }
public void Stalemate() { TestOutput.ForeColor = System.Drawing.Color.Green; TestOutput.Text += "Stalemate! It's a draw\n"; TestOutput.SelectionStart = TestOutput.TextLength; TestOutput.ScrollToCaret(); }
public void Check(bool Win) { TestOutput.ForeColor = System.Drawing.Color.Red; TestOutput.Text += "Check!\n"; TestOutput.SelectionStart = TestOutput.TextLength; TestOutput.ScrollToCaret(); }
public void Checkmate(bool Win) { TestOutput.ForeColor = System.Drawing.Color.Red; TestOutput.Text += "Checkmate!\n"; string winloss = Win ? "You won, congratulations!" : "You lost:(\n\n\n\n\n\n (hehehe)"; TestOutput.Text += winloss; TestOutput.SelectionStart = TestOutput.TextLength; TestOutput.ScrollToCaret(); }
public void PerformComputerMove(int Move) { TestOutput.ForeColor = SystemColors.WindowText; TestOutput.Text += "Engine: " + PerfectChess.Move.Details(Move) + "\n"; TestOutput.SelectionStart = TestOutput.TextLength; TestOutput.ScrollToCaret(); //BoardPanel.Restore(); PerformMove(Move); BoardPanel.DeleteEffects(false); BoardPanel.ShowLastMove(Square.Get(PerfectChess.Move.FromSquare(Move)), Square.Get(PerfectChess.Move.ToSquare(Move))); BoardPanel.Refresh(); }
public void FinishMove(int Move) { //BoardPanel.BackgroundImage = PreSavedBackground; //(PerfectChess.Move.FromPiece(Move) & Color.Mask) TestOutput.ForeColor = SystemColors.WindowText; TestOutput.Text = "";//_cachedText; TestOutput.Text += "You: " + PerfectChess.Move.Details(Move) + "\n"; TestOutput.SelectionStart = TestOutput.TextLength; TestOutput.ScrollToCaret(); TestOutput.Refresh(); BoardPanel.DeleteMove(Identifier, false); PerformMove(Move); BoardPanel.DeleteEffects(false); BoardPanel.ShowLastMove(Square.Get(PerfectChess.Move.FromSquare(Move)), Square.Get(PerfectChess.Move.ToSquare(Move))); BoardPanel.Refresh(); MoveStartAllowed = false; }