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