1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:27:43 +00:00

Chess: Added ability to copy board state as FEN

You can now copy the board state as Forsyth-Edwards Notation. You can
then paste this into other chess programs/games, or into ours when
it gets implemented.
This commit is contained in:
AnicJov 2020-12-10 16:44:38 +01:00 committed by Andreas Kling
parent b000a884c8
commit cf8fce368a
5 changed files with 85 additions and 0 deletions

View file

@ -292,6 +292,11 @@ void ChessWidget::maybe_input_engine_move()
});
}
String ChessWidget::get_fen() const
{
return m_board.to_fen();
}
bool ChessWidget::export_pgn(const StringView& export_path) const
{
auto file_or_error = Core::File::open(export_path, Core::File::WriteOnly);