Struct shakmaty::Board
[−]
[src]
pub struct Board { /* fields omitted */ }
Piece positions on a board.
Examples
let board = Board::new(); // r n b q k b n r // p p p p p p p p // . . . . . . . . // . . . . . . . . // . . . . . . . . // . . . . . . . . // P P P P P P P P // R N B Q K B N R assert_eq!(board.piece_at(square::E8), Some(Black.king()));
Methods
impl Board
[src]
fn new() -> Board
fn empty() -> Board
fn occupied(&self) -> Bitboard
fn pawns(&self) -> Bitboard
fn knights(&self) -> Bitboard
fn bishops(&self) -> Bitboard
fn rooks(&self) -> Bitboard
fn queens(&self) -> Bitboard
fn kings(&self) -> Bitboard
fn white(&self) -> Bitboard
fn black(&self) -> Bitboard
fn promoted(&self) -> Bitboard
fn sliders(&self) -> Bitboard
Bishops, rooks and queens.
fn rooks_and_queens(&self) -> Bitboard
fn bishops_and_queens(&self) -> Bitboard
fn king_of(&self, color: Color) -> Option<Square>
The (unique, unpromoted) king of the given side.
fn color_at(&self, sq: Square) -> Option<Color>
fn role_at(&self, sq: Square) -> Option<Role>
fn piece_at(&self, sq: Square) -> Option<Piece>
fn remove_piece_at(&mut self, sq: Square) -> Option<Piece>
fn set_piece_at(
&mut self,
sq: Square,
Piece { color: color, role: role }: Piece,
promoted: bool
)
&mut self,
sq: Square,
Piece { color: color, role: role }: Piece,
promoted: bool
)
fn by_color(&self, color: Color) -> Bitboard
fn by_role(&self, role: Role) -> Bitboard
fn by_piece(&self, piece: Piece) -> Bitboard
fn attacks_from(&self, sq: Square) -> Bitboard
fn attacks_to(
&self,
sq: Square,
attacker: Color,
occupied: Bitboard
) -> Bitboard
&self,
sq: Square,
attacker: Color,
occupied: Bitboard
) -> Bitboard
fn pieces(&self) -> Pieces
Trait Implementations
impl Clone for Board
[src]
fn clone(&self) -> Board
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Eq for Board
[src]
impl PartialEq for Board
[src]
fn eq(&self, __arg_0: &Board) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Board) -> bool
This method tests for !=
.
impl Default for Board
[src]
impl Debug for Board
[src]
impl FromStr for Board
[src]
type Err = FenError
The associated error which can be returned from parsing.
fn from_str(board_fen: &str) -> Result<Board, FenError>
Parses a string s
to return a value of this type. Read more