Class MoveDescriptorAbstract

Describe a legal chess move, with its characteristics.

Hierarchy

  • MoveDescriptor

Methods

  • Color and type of the captured piece.

    Throws

    IllegalArgument if the current move is not a capture, i.e. if isCapture returns false.

    Returns "br" | "bb" | "bp" | "bq" | "bk" | "bn" | "wb" | "wp" | "wq" | "wk" | "wr" | "wn"

  • Color of the moving piece.

    Returns Color

  • Color and type of the promoted piece, in case of a promotion.

    Throws

    IllegalArgument if the current move is not a promotion, i.e. if isPromotion returns false.

    Returns "br" | "bb" | "bp" | "bq" | "bk" | "bn" | "wb" | "wp" | "wq" | "wk" | "wr" | "wn"

  • Square containing the captured pawn, in case of a en-passant capture.

    Throws

    IllegalArgument if the current move is not a en-passant capture, i.e. if isEnPassant returns false.

    Returns "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "a1" | "a2" | "a3" | "a4" | "a5" | "a6" | "a7" | "a8" | "b1" | "b2" | "b3" | "b4" | "b5" | "b6" | "b7" | "b8" | "g1" | "g2" | "g3" | "g4" | "g5" | "g6" | "g7" | "g8" | "c1" | "c2" | "c3" | "c4" | "c5" | "c6" | "c7" | "c8" | "d1" | "d2" | "d3" | "d4" | "d5" | "d6" | "d7" | "d8" | "e1" | "e2" | "e3" | "e4" | "e5" | "e6" | "e7" | "e8" | "f1" | "f2" | "f3" | "f4" | "f5" | "f6" | "f7" | "f8" | "h7" | "h8"

  • Origin square of the moving piece. In case of castling, this is the origin square of the king.

    Returns "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "a1" | "a2" | "a3" | "a4" | "a5" | "a6" | "a7" | "a8" | "b1" | "b2" | "b3" | "b4" | "b5" | "b6" | "b7" | "b8" | "g1" | "g2" | "g3" | "g4" | "g5" | "g6" | "g7" | "g8" | "c1" | "c2" | "c3" | "c4" | "c5" | "c6" | "c7" | "c8" | "d1" | "d2" | "d3" | "d4" | "d5" | "d6" | "d7" | "d8" | "e1" | "e2" | "e3" | "e4" | "e5" | "e6" | "e7" | "e8" | "f1" | "f2" | "f3" | "f4" | "f5" | "f6" | "f7" | "f8" | "h7" | "h8"

  • Whether the current move is a capture (either a regular capture or a en-passant capture) or not.

    Returns boolean

  • Whether the current move is a castling move or not.

    Returns boolean

  • Whether the current move is a en-passant capture or not.

    Returns boolean

  • Whether the current move is a promotion or not.

    Returns boolean

  • Color and type of the moving piece. In case of castling, the moving piece is considered to be the king.

    Returns "br" | "bb" | "bp" | "bq" | "bk" | "bn" | "wb" | "wp" | "wq" | "wk" | "wr" | "wn"

  • Type of the moving piece. In case of castling, the moving piece is considered to be the king.

    Returns Piece

  • Type of the promoted piece, in case of a promotion.

    Throws

    IllegalArgument if the current move is not a promotion, i.e. if isPromotion returns false.

    Returns Piece

  • Origin square of the rook, in case of a castling move.

    Throws

    IllegalArgument if the current move is not a castling move, i.e. if isCastling returns false.

    Returns "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "a1" | "a2" | "a3" | "a4" | "a5" | "a6" | "a7" | "a8" | "b1" | "b2" | "b3" | "b4" | "b5" | "b6" | "b7" | "b8" | "g1" | "g2" | "g3" | "g4" | "g5" | "g6" | "g7" | "g8" | "c1" | "c2" | "c3" | "c4" | "c5" | "c6" | "c7" | "c8" | "d1" | "d2" | "d3" | "d4" | "d5" | "d6" | "d7" | "d8" | "e1" | "e2" | "e3" | "e4" | "e5" | "e6" | "e7" | "e8" | "f1" | "f2" | "f3" | "f4" | "f5" | "f6" | "f7" | "f8" | "h7" | "h8"

  • Destination square of the rook, in case of a castling move.

    Throws

    IllegalArgument if the current move is not a castling move, i.e. if isCastling returns false.

    Returns "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "a1" | "a2" | "a3" | "a4" | "a5" | "a6" | "a7" | "a8" | "b1" | "b2" | "b3" | "b4" | "b5" | "b6" | "b7" | "b8" | "g1" | "g2" | "g3" | "g4" | "g5" | "g6" | "g7" | "g8" | "c1" | "c2" | "c3" | "c4" | "c5" | "c6" | "c7" | "c8" | "d1" | "d2" | "d3" | "d4" | "d5" | "d6" | "d7" | "d8" | "e1" | "e2" | "e3" | "e4" | "e5" | "e6" | "e7" | "e8" | "f1" | "f2" | "f3" | "f4" | "f5" | "f6" | "f7" | "f8" | "h7" | "h8"

  • Destination square of the moving piece. In case of castling, this is the destination square of the king.

    Returns "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "a1" | "a2" | "a3" | "a4" | "a5" | "a6" | "a7" | "a8" | "b1" | "b2" | "b3" | "b4" | "b5" | "b6" | "b7" | "b8" | "g1" | "g2" | "g3" | "g4" | "g5" | "g6" | "g7" | "g8" | "c1" | "c2" | "c3" | "c4" | "c5" | "c6" | "c7" | "c8" | "d1" | "d2" | "d3" | "d4" | "d5" | "d6" | "d7" | "d8" | "e1" | "e2" | "e3" | "e4" | "e5" | "e6" | "e7" | "e8" | "f1" | "f2" | "f3" | "f4" | "f5" | "f6" | "f7" | "f8" | "h7" | "h8"

Generated using TypeDoc
Feb 25, 2024