internal static Point getKing(Peice[,] board, PSide side) { for (int x = 0; x < 8; x++) { for (int y = 0; y < 8; y++) { if (board[x, y] != null && board[x, y].MySide == side && board[x, y].MyType == Peices.PType.King) { return new Point(x, y); } } } throw new Exception("Searched for king on board for " + side.ToString() + " side, not present"); }
internal static Point getKing(Peice[,] board, PSide side) { for (int x = 0; x < 8; x++) { for (int y = 0; y < 8; y++) { if (board[x, y] != null && board[x, y].MySide == side && board[x, y].MyType == Peices.PType.King) { return(new Point(x, y)); } } } throw new Exception("Searched for king on board for " + side.ToString() + " side, not present"); }
public void OnEndGame(PSide side, ChessGame.EndGames endType) { PlaySound(Sounds.endgame); switch (endType) { case (ChessGame.EndGames.Checkmate): { MessageBox.Show(null, side.ToString() + " has been checkmated!", "Game over", MessageBoxButtons.OK, MessageBoxIcon.Information); break; } case (ChessGame.EndGames.Draw): { MessageBox.Show(null, "Game drawn, 50/50", "Game over", MessageBoxButtons.OK, MessageBoxIcon.Information); break; } case (ChessGame.EndGames.Stalemate): { MessageBox.Show(null, "StaleMate, 50/50", "Game over", MessageBoxButtons.OK, MessageBoxIcon.Information); break; } } btn_reset.Enabled = true; }
public void OnEndGame(PSide side, ChessGame.EndGames endType) { PlaySound(Sounds.endgame); switch(endType) { case (ChessGame.EndGames.Checkmate): { MessageBox.Show(null, side.ToString() + " has been checkmated!", "Game over", MessageBoxButtons.OK, MessageBoxIcon.Information); break; } case (ChessGame.EndGames.Draw): { MessageBox.Show(null, "Game drawn, 50/50", "Game over", MessageBoxButtons.OK, MessageBoxIcon.Information); break; } case (ChessGame.EndGames.Stalemate): { MessageBox.Show(null, "StaleMate, 50/50", "Game over", MessageBoxButtons.OK, MessageBoxIcon.Information); break; } } btn_reset.Enabled = true; }