From 3974f36868aa86ec9ca46c338984f060ed2f4e3f Mon Sep 17 00:00:00 2001 From: Calcitem Date: Tue, 17 Nov 2020 01:11:39 +0800 Subject: [PATCH] =?UTF-8?q?flutter:=20=E6=94=B9=E5=86=99=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E8=83=9C=E6=96=B9=E7=9A=84=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/flutter/lib/routes/battle_page.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ui/flutter/lib/routes/battle_page.dart b/src/ui/flutter/lib/routes/battle_page.dart index 909d301d..12972176 100644 --- a/src/ui/flutter/lib/routes/battle_page.dart +++ b/src/ui/flutter/lib/routes/battle_page.dart @@ -248,7 +248,7 @@ class _BattlePageState extends State { engineToGo() async { while (Battle.shared.position.sideToMove() == Color.black) { - changeStatus('对方思考中...'); + changeStatus('电脑思考中...'); final response = await widget.engine.search(Battle.shared.position); @@ -260,19 +260,19 @@ class _BattlePageState extends State { //Battle.shared.move = move; Battle.shared.command(move.move); - final result = Battle.shared.scanBattleResult(); + final winner = Battle.shared.position.winner; - switch (result) { - case GameResult.pending: - changeStatus('请走棋...'); + switch (winner) { + case Color.nobody: + changeStatus('请走棋'); break; - case GameResult.win: + case Color.white: // TODO gotWin(); break; - case GameResult.lose: + case Color.black: gotLose(); break; - case GameResult.draw: + case Color.draw: gotDraw(); break; }