diff --git a/src/ui/flutter/lib/board/board_widget.dart b/src/ui/flutter/lib/board/board_widget.dart index a7195c99..71f11e5e 100644 --- a/src/ui/flutter/lib/board/board_widget.dart +++ b/src/ui/flutter/lib/board/board_widget.dart @@ -61,9 +61,9 @@ class BoardWidget extends StatelessWidget { final row = (dy - padding - digitsHeight) ~/ squareWidth; final column = (dx - padding) ~/ squareWidth; - final index = row * 6 + column; + final index = row * 7 + column; - print("Tap on ($row, $column) => $index\n"); + print("Tap on ($row, $column) <$index>"); if (row < 0 || row > 6) return; diff --git a/src/ui/flutter/lib/mill/position.dart b/src/ui/flutter/lib/mill/position.dart index 2fd05a0c..c114fd78 100644 --- a/src/ui/flutter/lib/mill/position.dart +++ b/src/ui/flutter/lib/mill/position.dart @@ -53,7 +53,7 @@ class Position { } // Debugging - _board[sqToLoc[8]] = Piece.whiteStone; + _board[sqToLoc[8]] = Piece.blackStone; //_board[7] = Piece.ban; //_board[8] = Piece.whiteStone; diff --git a/src/ui/flutter/lib/routes/battle_page.dart b/src/ui/flutter/lib/routes/battle_page.dart index 72ea3f8b..380422a6 100644 --- a/src/ui/flutter/lib/routes/battle_page.dart +++ b/src/ui/flutter/lib/routes/battle_page.dart @@ -46,13 +46,14 @@ class _BattlePageState extends State { final position = Battle.shared.position; // 仅 Position 中的 side 指示一方能动棋 - if (position.side != Side.white) return; + if (position.side != Side.black) return; final tapedPiece = position.pieceAt(index); + print("Tap piece $tapedPiece at <$index>"); // 之前已经有棋子被选中了 if (Battle.shared.focusIndex != Move.invalidIndex && - Side.of(position.pieceAt(Battle.shared.focusIndex)) == Side.white) { + Side.of(position.pieceAt(Battle.shared.focusIndex)) == Side.black) { // // 当前点击的棋子和之前已经选择的是同一个位置 if (Battle.shared.focusIndex == index) return;