[][src]Struct chess_engine::Board

pub struct Board { /* fields omitted */ }

Implementations

impl Board[src]

pub fn horde() -> Self[src]

Create the default board for the Horde variant

pub fn empty() -> Self[src]

pub fn rating_bar(&self, len: usize) -> String[src]

pub fn get_turn_color(&self) -> Color[src]

Get the color of the current player

pub fn get_en_passant(&self) -> Option<Position>[src]

Get the position of the En-Passant square

pub fn remove_all(&self, color: Color) -> Self[src]

Remove all of the pieces for a given player

pub fn queen_all(&self, color: Color) -> Self[src]

Convert all of a given players pieces to queens

pub fn set_turn(&self, color: Color) -> Self[src]

Make the game a certain player's turn

pub fn get_material_advantage(&self, color: Color) -> i32[src]

Get the value of the material advantage of a certain player

pub fn get_piece(&self, pos: Position) -> Option<Piece>[src]

Does a square have any piece?

pub fn has_ally_piece(&self, pos: Position, ally_color: Color) -> bool[src]

Does a square have an ally piece?

pub fn has_enemy_piece(&self, pos: Position, ally_color: Color) -> bool[src]

If a square at a given position has an enemy piece from a given ally color, return true. Otherwise, return false.

For example, if a square has a black piece, and this method is called upon it with an ally_color of Color::White, then it will return true. If called with Color::Black upon the same square, however, it will return false.

pub fn has_piece(&self, pos: Position) -> bool[src]

If a square at a given position has any piece, return true. Otherwise, return false.

pub fn has_no_piece(&self, pos: Position) -> bool[src]

If a square at a given position has no piece, return true. Otherwise, return false.

pub fn get_king_pos(&self, color: Color) -> Option<Position>[src]

If there is a king on the board, return the position that it sits on.

pub fn is_threatened(&self, pos: Position, ally_color: Color) -> bool[src]

Is a square threatened by an enemy piece?

pub fn is_in_check(&self, color: Color) -> bool[src]

Get whether or not the king of a given color is in check.

pub fn can_kingside_castle(&self, color: Color) -> bool[src]

Can a given player castle kingside?

pub fn can_queenside_castle(&self, color: Color) -> bool[src]

Can a given player castle queenside?

pub fn has_sufficient_material(&self, color: Color) -> bool[src]

Does the respective player have sufficient material?

pub fn has_insufficient_material(&self, color: Color) -> bool[src]

Does the respective player have insufficient material?

pub fn is_stalemate(&self) -> bool[src]

Is the current player in stalemate?

pub fn is_checkmate(&self) -> bool[src]

Is the current player in checkmate?

pub fn change_turn(mut self: Self) -> Self[src]

Change the current turn to the next player.

pub fn play_move(&self, m: Move) -> GameResult[src]

Play a move and confirm it is legal.

Trait Implementations

impl Clone for Board[src]

impl Copy for Board[src]

impl Debug for Board[src]

impl Default for Board[src]

impl Display for Board[src]

impl Eq for Board[src]

impl Evaluate for Board[src]

impl From<Board> for BoardBuilder[src]

impl Ord for Board[src]

impl PartialEq<Board> for Board[src]

impl PartialOrd<Board> for Board[src]

impl StructuralEq for Board[src]

impl StructuralPartialEq for Board[src]

Auto Trait Implementations

impl Send for Board[src]

impl Sync for Board[src]

impl Unpin for Board[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.