Creates the engine to manage chess game

includes movement, ai moves, castling, en passant, and game finished

Hierarchy

  • ChessEngine

Constructors

Properties

chess: Chess

Accessors

Methods

  • Returns true if a move is a promotion, and false otherwise. Assumes that chess hasn't been updated yet

    Parameters

    • from: Square
    • to: Square

    Returns boolean

  • gets ALL legal moves from the provided square

    Returns

    • possible to squares

    Parameters

    • Optional square: Square

      from square

    Returns Move[]

  • returns a square's legal moves as a map

    Returns

    • possible to squares

    Parameters

    • Optional square: Square

      from square

    Returns Square[]

  • Takes in a Square argument and returns the side of the piece on the square or undefined

    Returns

    The current side of the piece on the square or undefined if there is no piece on the square

    Parameters

    • square: Square

    Returns undefined | Side

  • Takes in a Square argument and returns the piece on the square or undefined

    Returns

    The current piece on the square as a PieceType enum or undefined if there is no piece

    Parameters

    • square: Square

    Returns undefined | PieceType

  • Takes in a Square argument and returns if the square has a piece on it.

    Returns

    true if the square has a piece on it.

    Parameters

    • square: Square

    Returns boolean

  • Takes a move argument and determines if the move results in a capture Assumes that chess hasn't been updated yet

    Returns

    true if the move is a Capture

    Parameters

    Returns boolean

  • Takes a move argument and determines if the move is an En Passant Capture. Assumes that chess hasn't been updated yet

    Returns

    true if the move is an En Passant Capture

    Parameters

    Returns boolean

  • Takes a move argument and determines if the move is a King Side Castle. Assumes that chess hasn't been updated yet

    Returns

    true if the move is a King Side Castle

    Parameters

    Returns boolean

  • Takes a move argument and determines if the move is a Queen Side Castle. Assumes that chess hasn't been updated yet

    Returns

    true if the move is a Queen Side Castle

    Parameters

    Returns boolean

Generated using TypeDoc