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 add_castle_rights(&mut self, color: Color, add: CastleRights)

Add castle rights for a particular side.

fn remove_castle_rights(&mut self, color: Color, remove: CastleRights)

Remove castle rights 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 add_my_castle_rights(&mut self, add: CastleRights)

Add to my CastleRights.

fn remove_my_castle_rights(&mut self, remove: CastleRights)

Remove some of my CastleRights.

fn their_castle_rights(&self) -> CastleRights

My opponents CastleRights.

fn add_their_castle_rights(&mut self, add: CastleRights)

Ad to my opponents CastleRights

fn set_piece(&self, piece: Piece, color: Color, square: Square) -> Option<Board>

For a chess UI: set a piece on a particular square

fn clear_square(&self, square: Square) -> Option<Board>

For a chess UI: clear a particular square

fn null_move(&self) -> Option<Board>

Switch the color of the player without actually making a move

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 make_move(&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

impl Copy for Board
[src]

impl Display for Board
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.