mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 09:28:13 +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:
parent
b000a884c8
commit
cf8fce368a
5 changed files with 85 additions and 0 deletions
|
@ -139,6 +139,8 @@ public:
|
|||
bool apply_move(const Move&, Colour colour = Colour::None);
|
||||
const Optional<Move>& last_move() const { return m_last_move; }
|
||||
|
||||
String to_fen() const;
|
||||
|
||||
enum class Result {
|
||||
CheckMate,
|
||||
StaleMate,
|
||||
|
@ -180,6 +182,7 @@ private:
|
|||
Colour m_resigned { Colour::None };
|
||||
Optional<Move> m_last_move;
|
||||
int m_moves_since_capture { 0 };
|
||||
int m_moves_since_pawn_advance { 0 };
|
||||
|
||||
bool m_white_can_castle_kingside { true };
|
||||
bool m_white_can_castle_queenside { true };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue