[board] Copy edit and add new documentation to Board
This commit is contained in:
parent
c297e4cbfa
commit
d221de700d
1 changed files with 9 additions and 6 deletions
|
@ -90,10 +90,12 @@ impl Board {
|
|||
&self.flags
|
||||
}
|
||||
|
||||
/// Returns `true` if the player has the right to castle on the given side of the board.
|
||||
/// Returns `true` if the player has the right to castle on the given side
|
||||
/// of the board.
|
||||
///
|
||||
/// The right to castle on a particular side of the board is retained as long as the player has
|
||||
/// not moved their king, or the rook on that side of the board.
|
||||
/// A player retains the right to castle on a particular side of the board
|
||||
/// as long as they have not moved their king, or the rook on that side of
|
||||
/// the board.
|
||||
#[must_use]
|
||||
pub fn player_has_right_to_castle(&self, color: Color, castle: Castle) -> bool {
|
||||
self.flags.player_has_right_to_castle(color, castle)
|
||||
|
@ -106,7 +108,8 @@ impl Board {
|
|||
self.piece_on_square(square)
|
||||
}
|
||||
|
||||
/// A [`BitBoard`] representing the set of squares containing a piece.
|
||||
/// A [`BitBoard`] representing the set of squares containing a piece. This
|
||||
/// set is the inverse of [`Board::empty_squares`].
|
||||
#[must_use]
|
||||
pub fn occupied_squares(&self) -> &BitBoard {
|
||||
self.pieces.all_pieces()
|
||||
|
@ -127,8 +130,8 @@ impl Board {
|
|||
(self.friendly_pieces(), self.opposing_pieces())
|
||||
}
|
||||
|
||||
/// A [`BitBoard`] representing the set of squares containing a piece. This set is the inverse of
|
||||
/// `Board::occupied_squares`.
|
||||
/// A [BitBoard] representing the set of squares containing a piece. This
|
||||
/// set is the inverse of [`Board::occupied_squares`].
|
||||
#[must_use]
|
||||
pub fn empty_squares(&self) -> BitBoard {
|
||||
!self.occupied_squares()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue