From b1ce6c61e85da2adbbef1956e8421008b0d713cb Mon Sep 17 00:00:00 2001 From: Calcitem Date: Sun, 16 May 2021 11:18:34 +0800 Subject: [PATCH] flutter: Ignore board tapping when engineType is aiVsAi --- src/ui/flutter_app/lib/widgets/game_page.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ui/flutter_app/lib/widgets/game_page.dart b/src/ui/flutter_app/lib/widgets/game_page.dart index 4f6205e5..ed639a34 100644 --- a/src/ui/flutter_app/lib/widgets/game_page.dart +++ b/src/ui/flutter_app/lib/widgets/game_page.dart @@ -125,7 +125,9 @@ class _GamePageState extends State with RouteAware { return false; } - if (Game.instance.engineType == EngineType.testViaLAN) { + if (Game.instance.engineType == EngineType.aiVsAi || + Game.instance.engineType == EngineType.testViaLAN) { + print("Engine type is no human, ignore tapping."); return false; } @@ -373,7 +375,7 @@ class _GamePageState extends State with RouteAware { } // TODO - print("Engine to go"); + print("Engine to go, engine type is ${widget.engineType}"); while ((Config.isAutoRestart == true || Game.instance.position.winner == PieceColor.nobody) && @@ -394,7 +396,7 @@ class _GamePageState extends State with RouteAware { } } - print("Waiting for engine's response..."); + print("Searching..."); final response = await widget.engine.search(Game.instance.position); print("Engine response type: ${response.type}");