diff --git a/Man.cpp b/Man.cpp new file mode 100644 index 0000000..209cb69 --- /dev/null +++ b/Man.cpp @@ -0,0 +1,23 @@ +#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); +}