Struct timecat::Board

source ·
pub struct Board { /* private fields */ }

Implementations§

source§

impl Board

source

pub fn new() -> Self

source

pub fn set_fen(&mut self, fen: &str) -> Result<()>

source

pub fn from_fen(fen: &str) -> Result<Self>

source

pub fn get_sub_board(&self) -> &SubBoard

source

pub fn get_evaluator(&self) -> &Evaluator

source

pub fn get_evaluator_mut(&mut self) -> &mut Evaluator

source

pub fn is_good_fen(fen: &str) -> bool

source

pub fn reset(&mut self)

source

pub fn clear(&mut self)

source

pub fn flip_vertical(&mut self)

source

pub fn flip_vertical_and_flip_turn(&mut self)

source

pub fn flip_horizontal(&mut self)

source

pub fn to_board_string(&self, use_unicode: bool) -> String

source

pub fn to_unicode_string(&self) -> String

source

pub fn result(&self) -> GameResult

source

pub fn get_num_moves(&self) -> NumMoves

source

pub fn get_num_repetitions(&self) -> u8

source

pub fn is_repetition(&self, n_times: usize) -> bool

source

pub fn is_threefold_repetition(&self) -> bool

source

pub fn is_other_draw(&self) -> bool

source

pub fn is_draw(&self) -> bool

source

pub fn is_game_over(&self) -> bool

source

pub fn pop(&mut self) -> ValidOrNullMove

source

pub fn get_all_moves(&self) -> Vec<ValidOrNullMove>

source

pub fn get_last_move(&self) -> Option<ValidOrNullMove>

source

pub fn contains_null_move(&self) -> bool

source

pub fn get_ply(&self) -> usize

source

pub fn has_empty_stack(&self) -> bool

source

pub fn push_san(&mut self, san: &str) -> Result<ValidOrNullMove>

source

pub fn push_sans(&mut self, sans: &str) -> Result<Vec<ValidOrNullMove>>

source

pub fn push_uci(&mut self, uci: &str) -> Result<ValidOrNullMove>

source

pub fn push_str(&mut self, s: &str)

source

pub fn push_uci_moves( &mut self, uci_moves: &str, ) -> Result<Vec<ValidOrNullMove>>

source

pub fn algebraic_and_push( &mut self, valid_or_null_move: ValidOrNullMove, long: bool, ) -> Result<String>

source

pub fn san_and_push( &mut self, valid_or_null_move: ValidOrNullMove, ) -> Result<String>

source

pub fn lan_and_push( &mut self, valid_or_null_move: ValidOrNullMove, ) -> Result<String>

source

pub fn variation_san(board: &Board, variation: Vec<ValidOrNullMove>) -> String

source

pub fn get_pgn(&self) -> String

source

pub fn perft(&mut self, depth: Depth) -> usize

source

pub fn evaluate(&mut self) -> Score

source

pub fn evaluate_flipped(&mut self) -> Score

Methods from Deref<Target = SubBoard>§

source

pub fn transposition_key_components( &self, ) -> ([BitBoard; 6], [BitBoard; 2], Color, [CastleRights; 2], Option<Square>)

source

pub fn status(&self) -> BoardStatus

source

pub fn occupied(&self) -> BitBoard

source

pub fn get_num_pieces(&self) -> u32

source

pub fn occupied_co(&self, color: Color) -> BitBoard

source

pub fn get_black_occupied(&self) -> BitBoard

source

pub fn get_white_occupied(&self) -> BitBoard

source

pub fn get_king_square(&self, color: Color) -> Square

source

pub fn get_piece_masks(&self) -> &[BitBoard]

source

pub fn get_piece_mask(&self, piece_type: PieceType) -> BitBoard

source

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

source

pub fn has_non_pawn_material(&self) -> bool

source

pub fn get_non_king_pieces_mask(&self) -> BitBoard

source

pub fn has_only_same_colored_bishop(&self) -> bool

source

pub fn is_insufficient_material(&self) -> bool

source

pub fn castle_rights(&self, color: Color) -> CastleRights

source

pub fn clean_castling_rights(&self) -> BitBoard

source

pub fn turn(&self) -> Color

source

pub fn my_castle_rights(&self) -> CastleRights

source

pub fn their_castle_rights(&self) -> CastleRights

source

pub fn get_white_material_score(&self) -> Score

source

pub fn get_black_material_score(&self) -> Score

source

pub fn gives_check(&self, move_: Move) -> bool

source

pub fn gives_checkmate(&self, move_: Move) -> bool

source

pub fn null_move(&self) -> Result<Self>

source

pub fn is_sane(&self) -> bool

source

pub fn get_hash(&self) -> u64

source

pub fn get_pawn_hash(&self) -> u64

source

pub fn piece_type_at(&self, square: Square) -> Option<PieceType>

source

pub fn color_at(&self, square: Square) -> Option<Color>

source

pub fn piece_at(&self, square: Square) -> Option<Piece>

source

pub fn ep_square(&self) -> Option<Square>

source

pub fn get_halfmove_clock(&self) -> u8

source

pub fn get_fullmove_number(&self) -> NumMoves

source

pub fn get_fen(&self) -> String

source

pub fn is_en_passant(&self, move_: Move) -> bool

source

pub fn is_passed_pawn(&self, square: Square) -> bool

source

pub fn is_capture(&self, move_: Move) -> bool

source

pub fn is_castling(&self, move_: Move) -> bool

source

pub fn is_zeroing(&self, move_: Move) -> bool

source

pub fn pinned(&self) -> BitBoard

source

pub fn get_checkers(&self) -> BitBoard

source

pub fn is_check(&self) -> bool

source

pub fn is_checkmate(&self) -> bool

source

pub fn piece_symbol_at(&self, square: Square) -> String

source

pub fn piece_unicode_symbol_at( &self, square: Square, flip_color: bool, ) -> String

source

pub fn to_board_string( &self, last_move: ValidOrNullMove, use_unicode: bool, ) -> String

source

pub fn to_unicode_string(&self, last_move: ValidOrNullMove) -> String

source

pub fn is_fifty_moves(&self) -> bool

source

pub fn is_stalemate(&self) -> bool

source

pub fn is_double_pawn_push(&self, move_: Move) -> bool

source

pub fn is_quiet(&self, move_: Move) -> bool

source

pub fn reduces_castling_rights(&self, move_: Move) -> bool

source

pub fn is_irreversible(&self, move_: Move) -> bool

source

pub fn is_endgame(&self) -> bool

source

pub fn parse_move(&self, move_text: &str) -> Result<ValidOrNullMove>

source

pub fn score_flipped(&self, score: Score) -> Score

source

pub fn get_material_score(&self) -> Score

source

pub fn get_winning_side(&self) -> Option<Color>

source

pub fn get_material_score_flipped(&self) -> Score

source

pub fn get_masked_material_score_abs(&self, mask: BitBoard) -> Score

source

pub fn get_material_score_abs(&self) -> Score

source

pub fn get_non_pawn_material_score_abs(&self) -> Score

source

pub fn slow_evaluate(&self) -> Score

source

pub fn slow_evaluate_flipped(&self) -> Score

source

pub fn custom_iter<'a>( &'a self, piece_types: &'a [PieceType], colors: &'a [Color], mask: BitBoard, ) -> impl Iterator<Item = (Piece, Square)> + 'a

source

pub fn iter(&self) -> impl Iterator<Item = (Piece, Square)> + '_

Trait Implementations§

source§

impl BoardMethodOverload<Move> for Board

source§

fn push_unchecked(&mut self, move_: Move)

source§

fn push(&mut self, move_: Move) -> Result<()>

source§

fn gives_repetition(&self, move_: Move) -> bool

source§

fn gives_threefold_repetition(&self, move_: Move) -> bool

source§

fn gives_claimable_threefold_repetition(&self, move_: Move) -> bool

source§

impl BoardMethodOverload<ValidOrNullMove> for Board

source§

fn push_unchecked(&mut self, valid_or_null_move: ValidOrNullMove)

source§

fn push(&mut self, valid_or_null_move: ValidOrNullMove) -> Result<()>

source§

fn gives_repetition(&self, valid_or_null_move: ValidOrNullMove) -> bool

source§

fn gives_threefold_repetition( &self, valid_or_null_move: ValidOrNullMove, ) -> bool

source§

fn gives_claimable_threefold_repetition( &self, valid_or_null_move: ValidOrNullMove, ) -> bool

source§

impl Clone for Board

source§

fn clone(&self) -> Board

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Board

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for Board

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Board

§

type Target = SubBoard

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Display for Board

source§

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

Formats the value using the given formatter. Read more
source§

impl From<&SubBoard> for Board

source§

fn from(sub_board: &SubBoard) -> Self

Converts to this type from the input type.
source§

impl From<&str> for Board

source§

fn from(fen: &str) -> Self

Converts to this type from the input type.
source§

impl From<SubBoard> for Board

source§

fn from(sub_board: SubBoard) -> Self

Converts to this type from the input type.
source§

impl FromStr for Board

§

type Err = TimecatError

The associated error which can be returned from parsing.
source§

fn from_str(fen: &str) -> Result<Self>

Parses a string s to return a value of this type. Read more

Auto Trait Implementations§

§

impl Freeze for Board

§

impl RefUnwindSafe for Board

§

impl Send for Board

§

impl Sync for Board

§

impl Unpin for Board

§

impl UnwindSafe for Board

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CustomColorize for T
where T: ToString,

source§

fn colorize( &self, style_functions: &[fn(_: ColoredString) -> ColoredString], ) -> String

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.