From 359d8f37639bd4407d8794f0373fabec1cc1aee4 Mon Sep 17 00:00:00 2001 From: pwhjurltz <2624989522@qq.com> Date: Tue, 9 Jan 2024 20:38:47 +0800 Subject: [PATCH] ADD file via upload --- Man.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Man.cpp 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); +}