build_move method
Implementation
Move build_move(List<Piece?> board, from, to, flags, [PieceType? promotion]) {
if (promotion != null) {
flags |= BITS_PROMOTION;
}
PieceType? captured;
final toPiece = board[to];
if (toPiece != null) {
captured = toPiece.type;
} else if ((flags & BITS_EP_CAPTURE) != 0) {
captured = PAWN;
}
return Move(turn, from, to, flags, board[from]!.type, captured, promotion);
}