private void opponentmove(string [] cmds)
{
int chose_x = int.Parse(cmds[1]);
int chose_y = int.Parse(cmds[2]);
int dest_x = int.Parse(cmds[3]);
int dest_y = int.Parse(cmds[4]);
string promote = (cmds.Length > 5) ? cmds[5] : "";
tokenChosed = t_map[getIndex(chose_x, chose_y)] as Token;
//MessageBox.Show(tokenChosed.getType());
enPassant = null;
move(t_map,dest_x,dest_y,promote);
tokenChosed = null;
possiblemove.Clear();
drawScreen();
whosturn = (whosturn == "w") ? "b" : "w";
label1.Text = (whosturn == "w") ? "White's turn" : "Black's turn";
if (ischeck(t_map, whosturn))
{
if (ismate(whosturn))
{
MessageBox.Show("Checkmate!");
lose();
}
else
{
MessageBox.Show("Check!");
}
}
else if (ismate(whosturn))
{
MessageBox.Show("Stalemate!");
drawgame();
}
}