fen property

String get fen

Gets the FEN string of this position.

Contrary to the FEN given by Setup, this should always be a legal position.

Implementation

String get fen {
  return Setup(
    board: board,
    pockets: pockets,
    turn: turn,
    castlingRights: castles.castlingRights,
    epSquare: _legalEpSquare(),
    halfmoves: halfmoves,
    fullmoves: fullmoves,
  ).fen;
}