diff --git a/src/ui/flutter/lib/engine/engine.dart b/src/ui/flutter/lib/engine/engine.dart index bad829a3..3ca138fb 100644 --- a/src/ui/flutter/lib/engine/engine.dart +++ b/src/ui/flutter/lib/engine/engine.dart @@ -19,7 +19,7 @@ import 'package:sanmill/mill/position.dart'; -enum EngineType { Cloud, Native } +enum EngineType { humanVsCloud, humanVsAi, humanVsHuman, aiVsAi } class EngineResponse { final String type; diff --git a/src/ui/flutter/lib/widgets/game_page.dart b/src/ui/flutter/lib/widgets/game_page.dart index be2e4189..978b695b 100644 --- a/src/ui/flutter/lib/widgets/game_page.dart +++ b/src/ui/flutter/lib/widgets/game_page.dart @@ -361,7 +361,7 @@ class _GamePageState extends State { }, ); - if (widget.engineType == EngineType.Cloud) + if (widget.engineType == EngineType.humanVsCloud) Player.shared.increaseWinCloudEngine(); else Player.shared.increaseWinAi(); @@ -448,7 +448,10 @@ class _GamePageState extends State { Expanded(child: SizedBox()), Hero(tag: 'logo', child: Image.asset('images/logo-mini.png')), SizedBox(width: 10), - Text(widget.engineType == EngineType.Cloud ? '挑战云主机' : '人机对战', + Text( + widget.engineType == EngineType.humanVsCloud + ? '挑战云主机' + : '人机对战', style: titleStyle), Expanded(child: SizedBox()), IconButton( diff --git a/src/ui/flutter/lib/widgets/main_menu.dart b/src/ui/flutter/lib/widgets/main_menu.dart index db1485cf..72e19514 100644 --- a/src/ui/flutter/lib/widgets/main_menu.dart +++ b/src/ui/flutter/lib/widgets/main_menu.dart @@ -120,10 +120,28 @@ class _MainMenuState extends State with TickerProviderStateMixin { Expanded(child: SizedBox()), FlatButton( child: Text('人机对战', style: menuItemStyle), - onPressed: () => navigateTo(GamePage(EngineType.Native)), + onPressed: () => navigateTo(GamePage(EngineType.humanVsAi)), ), Expanded(child: SizedBox()), - Text('Calcitem', + FlatButton( + child: Text('双人对战', style: menuItemStyle), + onPressed: () => navigateTo(GamePage(EngineType.humanVsHuman)), + ), + Expanded(child: SizedBox()), + FlatButton( + child: Text('机器对战', style: menuItemStyle), + onPressed: () => navigateTo(GamePage(EngineType.aiVsAi)), + ), + Expanded(child: SizedBox()), + Text( + ' 健康游戏忠告\n' + '抵制不良游戏,拒绝盗版游戏。\n' + '注意自我保护,谨防受骗上当。\n' + '适度游戏益脑,沉迷游戏伤身。\n' + '合理安排时间,享受健康生活。', + style: TextStyle(color: Colors.black54, fontSize: 16)), + Expanded(child: SizedBox()), + Text('Copyright © 2019-2020 The Sanmill Authors', style: TextStyle(color: Colors.black54, fontSize: 16)), Expanded(child: SizedBox()), ],