Skip to content

Commit

Permalink
implement
Browse files Browse the repository at this point in the history
  • Loading branch information
sensuikan1973 committed Nov 4, 2023
1 parent bae34dc commit e6653ed
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/engine/api/count_bestpath.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,14 @@ Stream<CountBestpathResponse> executeCountBestpath(
final bookMoveListWithPosition = edax.edaxGetBookMoveWithPositionByMoves(moves);
final board = bookMoveListWithPosition.position.board;

// check opponent player should pass to get position player.
final swappedBoard = Board(board.opponent, board.player);
final isPassOnSwappedBoard = edax.edaxBoardIsPass(swappedBoard);
final positionPlayerColor = isPassOnSwappedBoard ? edax.edaxGetCurrentPlayer() : edax.edaxGetOpponentPlayer();
final symetryMoveX = symetryMove(move.x, bookMoveListWithPosition.symetry);
final lastMoveSquarePlayer = edax.edaxBoardGetSquareColor(board, symetryMoveX);
int positionPlayerColor = -1; // empty.
if (lastMoveSquarePlayer == 0) {
positionPlayerColor = edax.edaxGetCurrentPlayer();
} else if (lastMoveSquarePlayer == 1) {
positionPlayerColor = edax.edaxGetOpponentPlayer();
}

final result = edax.edaxBookCountBoardBestpath(
board,
Expand Down

0 comments on commit e6653ed

Please sign in to comment.