Struct chess::board::Board
[−]
[src]
pub struct Board { // some fields omitted }
A representation of a chess board. That's why you're here, right?
Methods
impl Board
[src]
fn new() -> Board
Construct a new Board
that is completely empty.
Note: This does NOT give you the initial position. Just a blank slate.
fn from_fen(fen: String) -> Board
Construct a board from a FEN string.
fn combined(&self) -> BitBoard
Grab the "combined" BitBoard
. This is a BitBoard
with every piece
fn color_combined(&self, color: Color) -> BitBoard
Grab the "color combined" BitBoard
. This is a BitBoard
with every piece of a particular
color.
fn pieces(&self, piece: Piece) -> BitBoard
Grab the "pieces" BitBoard
. This is a BitBoard
with every piece of a particular type.
fn castle_rights(&self, color: Color) -> CastleRights
Grab the CastleRights
for a particular side.
fn side_to_move(&self) -> Color
Who's turn is it?
fn my_castle_rights(&self) -> CastleRights
Grab my CastleRights
.
fn their_castle_rights(&self) -> CastleRights
My opponents CastleRights
.
fn is_sane(&self) -> bool
Does this board "make sense"? Do all the pieces make sense, do the bitboards combine correctly, etc? This is for sanity checking.
fn piece_on(&self, square: Square) -> Option<Piece>
What piece is on a particular Square
? Is there even one?
fn enumerate_moves(&self, moves: &mut [ChessMove; 256]) -> usize
Give me all the legal moves for this board.
fn next(&self, m: ChessMove) -> Board
Make a chess move
fn perft(&self, depth: u64) -> u64
Run a perft-test.
fn perft_test(fen: String, depth: u64, result: u64)
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