From 9e5d6feb7d664b7792d558ce095f9dc80f5059c4 Mon Sep 17 00:00:00 2001 From: CalciteM Date: Sun, 23 Jun 2019 15:27:50 +0800 Subject: [PATCH] refactor --- NineChess/src/ninechess.cpp | 3 ++- NineChess/src/ninechess.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NineChess/src/ninechess.cpp b/NineChess/src/ninechess.cpp index 829c7f03..bb36fb6a 100644 --- a/NineChess/src/ninechess.cpp +++ b/NineChess/src/ninechess.cpp @@ -119,8 +119,9 @@ int NineChess::millTable[(N_RINGS + 2) * N_SEATS][N_DIRECTIONS][N_RINGS - 1] = { NineChess::NineChess() { - // 单独提出board,免得每次都写data.board; + // 单独提出 board,免得每次都写 context.board; board_ = context.board; + // 默认选择第1号规则,即“打三棋” setContext(&RULES[1]); } diff --git a/NineChess/src/ninechess.h b/NineChess/src/ninechess.h index 0ce797f6..de108a1b 100644 --- a/NineChess/src/ninechess.h +++ b/NineChess/src/ninechess.h @@ -240,6 +240,7 @@ public: { return context.board; } + // 获取棋子位置(c, p) bool getPieceCP(const Player &player, const int &number, int &c, int &p);