ADD file via upload

main
peauxh9ov 5 months ago
parent 45d9dd949d
commit 4ca680b2fa

@ -0,0 +1,24 @@
#include "Player.h"
void Player::init(Chess* chess)
{
this->chess = chess;
}
void Player::go()
{
MOUSEMSG msg;
ChessPos pos;
while (1)
{
//获取鼠标点击信息
msg = GetMouseMsg();
//判断落子是否有效,以及实现落子
if (msg.uMsg == WM_LBUTTONDOWN && chess->clickBoard(msg.x, msg.y, &pos))
break;
}
//落子
chess->ChessMove(&pos, CHESS_BLACK);
}
Loading…
Cancel
Save