Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ChessMove.ChessMoveType ExecuteWithoutClearingUndoHistories(ChessMove uncheckedMove, ChessPiece.ChessPieceType promotion = ChessPiece.ChessPieceType.Queen)
- {
- ChessMove.ChessMoveType moveType = _Execute(uncheckedMove, promotion);
- ChessPiece piece = (ChessPiece)_board.SubscriptGet(uncheckedMove.End);
- if (piece.IsPawn && Mathf.Abs(uncheckedMove.RowChanged) == 2)
- {
- _enPassantTarget = new ChessSquare(uncheckedMove.Start.Column, piece.Color.IsWhite ? new ChessRow(true, 3) : new ChessRow(true, 6));
- }
- else
- {
- _enPassantTarget = null;
- }
- _attackersToKing = _board.AttackersToKing(_playerTurn);
- fullMoves = 1 + ((uint)MoveCount / 2);
- // Do not clear undoHistories here
- UpdateEPDHistory();
- return moveType;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement