makeMoveWithoutCallback method

bool makeMoveWithoutCallback(
  1. String move
)

make move without calling the controller callbacks. Others make move methods, call refreshBoard at the end, triggering callbacks

Implementation

bool makeMoveWithoutCallback(String move) {
  chessjs.Move? moveObj;
  final moves = _logic.generateMoves();
  for (int i = 0; i < moves.length; i++) {
    if (move == _logic.moveToSan(moves[i])) {
      moveObj = moves[i];
      break;
    }
  }
  if (moveObj != null) {
    _makeMove(moveObj);
    _updateBoardAfterMove(moveObj);
    return true;
  } else {
    return false;
  }
}