From b8f45aaecec61ac6c2a0167db394bf4d3bfa67c8 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 31 May 2025 14:28:27 -0700 Subject: [PATCH] [position] Add some documentation to MoveRecord --- position/src/move_record.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/position/src/move_record.rs b/position/src/move_record.rs index 5fbfe27..fa80aa3 100644 --- a/position/src/move_record.rs +++ b/position/src/move_record.rs @@ -4,13 +4,27 @@ use chessfriend_board::{board::HalfMoveClock, Board, CastleRights}; use chessfriend_core::{Color, Piece, Square}; use chessfriend_moves::Move; +/// A record of a move made on a board. This struct contains all the information +/// necessary to restore the board position to its state immediately before the +/// move was made. #[derive(Clone, Debug, Eq, PartialEq)] pub(crate) struct MoveRecord { + /// The color of the player who made the move pub color: Color, + + /// The move played pub ply: Move, + + /// The en passant square when the move was made pub en_passant_target: Option, + + /// Castling rights for all players when the move was made pub castling_rights: CastleRights, + + /// The half move clock when the move was made pub half_move_clock: HalfMoveClock, + + /// The piece captured by the move, if any pub captured_piece: Option, }