You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
400 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#include "Man.h"
void Man::init(Chess* chess)
{
this->chess = chess;
}
void Man::go()
{
MOUSEMSG msg;
ChessPos pos;
while (1) {
//获取鼠标点击消息
msg = GetMouseMsg();
//通过chess对象来调用判断落子是否有效以及落子功能
if (msg.uMsg == WM_LBUTTONDOWN && chess->clickBoard(msg.x, msg.y, &pos)) {
break;
}
}
//落子
chess->chessDown(&pos, CHESS_BLACK);
}