Advertisement
Learning000001

Untitled

Oct 19th, 2024
9
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. public ChessMove.ChessMoveType ExecuteWithoutClearingUndoHistories(ChessMove uncheckedMove, ChessPiece.ChessPieceType promotion = ChessPiece.ChessPieceType.Queen)
  2. {
  3. ChessMove.ChessMoveType moveType = _Execute(uncheckedMove, promotion);
  4. ChessPiece piece = (ChessPiece)_board.SubscriptGet(uncheckedMove.End);
  5. if (piece.IsPawn && Mathf.Abs(uncheckedMove.RowChanged) == 2)
  6. {
  7. _enPassantTarget = new ChessSquare(uncheckedMove.Start.Column, piece.Color.IsWhite ? new ChessRow(true, 3) : new ChessRow(true, 6));
  8. }
  9. else
  10. {
  11. _enPassantTarget = null;
  12. }
  13.  
  14. _attackersToKing = _board.AttackersToKing(_playerTurn);
  15. fullMoves = 1 + ((uint)MoveCount / 2);
  16. // Do not clear undoHistories here
  17. UpdateEPDHistory();
  18.  
  19. return moveType;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement