flutter: 避免棋局结束后弹框进入死循环必须杀死才行

This commit is contained in:
Calcitem 2020-11-23 01:19:34 +08:00
parent ffa1d494cb
commit 5cca309fa4
1 changed files with 2 additions and 1 deletions

View File

@ -205,7 +205,8 @@ class _GamePageState extends State<GamePage> {
engineToGo() async {
// TODO
while (Game.shared.position.sideToMove() == Color.white) {
while (Game.shared.position.winner == Color.nobody &&
Game.shared.position.sideToMove() == Color.white) {
changeStatus('对方思考中...');
final response = await widget.engine.search(Game.shared.position);