flutter: 如果是AI对战AI则用显示比分取代正在思考的提示

This commit is contained in:
Calcitem 2020-12-02 01:20:48 +08:00
parent ea492d8083
commit 4538b6a6d9
1 changed files with 11 additions and 1 deletions

View File

@ -197,7 +197,17 @@ class _GamePageState extends State<GamePage> {
while ((Config.isAutoRestart == true ||
Game.shared.position.winner == Color.nobody) &&
Game.shared.isAiToMove()) {
changeStatus(S.of(context).thinking);
if (widget.engineType == EngineType.aiVsAi) {
String score = Game.shared.position.score[Color.black].toString() +
" : " +
Game.shared.position.score[Color.white].toString() +
" : " +
Game.shared.position.score[Color.draw].toString();
changeStatus(score);
} else {
changeStatus(S.of(context).thinking);
}
final response = await widget.engine.search(Game.shared.position);