setContext -> setPosition
This commit is contained in:
parent
4cb10cf184
commit
551bff5860
|
@ -40,7 +40,7 @@ Game::Game()
|
|||
#endif
|
||||
|
||||
// 默认选择第1号规则,即“打三棋”
|
||||
setContext(&RULES[1]);
|
||||
setPosition(&RULES[1]);
|
||||
|
||||
// 比分归零
|
||||
score[1] = score[2] = score_draw = 0;
|
||||
|
@ -92,7 +92,7 @@ bool Game::configure(bool giveUpIfMostLose, bool randomMove)
|
|||
}
|
||||
|
||||
// 设置棋局状态和棋盘数据,用于初始化
|
||||
bool Game::setContext(const struct Rule *rule, step_t maxStepsLedToDraw, int maxTimeLedToLose,
|
||||
bool Game::setPosition(const struct Rule *rule, step_t maxStepsLedToDraw, int maxTimeLedToLose,
|
||||
step_t initialStep,
|
||||
phase_t phase, player_t turn, action_t action,
|
||||
const char *locations,
|
||||
|
@ -718,7 +718,7 @@ bool Game::command(const char *cmd)
|
|||
return false;
|
||||
}
|
||||
|
||||
return setContext(&RULES[r - 1], s, t);
|
||||
return setPosition(&RULES[r - 1], s, t);
|
||||
}
|
||||
|
||||
// 选子移动
|
||||
|
|
|
@ -103,7 +103,7 @@ public:
|
|||
bool configure(bool giveUpIfMostLose, bool randomMove);
|
||||
|
||||
// 设置棋局状态和棋局,用于初始化
|
||||
bool setContext(const struct Rule *rule,
|
||||
bool setPosition(const struct Rule *rule,
|
||||
step_t maxStepsLedToDraw = 0, // 限制步数
|
||||
int maxTimeLedToLose = 0, // 限制时间
|
||||
step_t initialStep = 0, // 默认起始步数为0
|
||||
|
|
|
@ -280,7 +280,7 @@ void GameController::setRule(int ruleNo, step_t stepLimited /*= -1*/, int timeLi
|
|||
}
|
||||
|
||||
// 设置模型规则,重置游戏
|
||||
game_.setContext(&RULES[ruleNo], stepsLimit, timeLimit);
|
||||
game_.setPosition(&RULES[ruleNo], stepsLimit, timeLimit);
|
||||
dummyGame = game_;
|
||||
|
||||
// 重置游戏
|
||||
|
|
Loading…
Reference in New Issue