pub struct BoardMap { /* private fields */ }Implementations§
Source§impl BoardMap
impl BoardMap
pub fn empty() -> Self
Sourcepub fn starting() -> Self
pub fn starting() -> Self
starting position: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
pub fn from_fen(fen: impl Into<String>) -> Self
pub fn get_fen(&self) -> String
pub fn parse_uci_to_move(&mut self, uci: &str) -> Result<UciMove>
pub fn get_piece(&self, pos: Position) -> Piece
pub fn find_piece( &self, piece_color: PieceColor, piece_type: PieceType, ) -> Vec<Position> ⓘ
pub fn get_piece_mut(&mut self, pos: Position) -> &mut Piece
pub fn get_active_color(&self) -> &PieceColor
pub fn get_active_pieces(&self) -> Vec<Position> ⓘ
pub fn set_piece(&mut self, on: Position, value: u32)
Sourcepub fn uci_move_turn(&mut self, uci_move: UciMove) -> Result<()>
pub fn uci_move_turn(&mut self, uci_move: UciMove) -> Result<()>
makes a move with uci info
returns true if move was successful
Sourcepub fn single_move_turn(&mut self, position_move: PositionMove) -> Result<()>
pub fn single_move_turn(&mut self, position_move: PositionMove) -> Result<()>
makes a single move with check
returns true if move was successful
Sourcepub fn is_valid_move(&self, piece_move: PositionMove) -> Result<()>
pub fn is_valid_move(&self, piece_move: PositionMove) -> Result<()>
check if move is valid
pub fn is_hit(&self, pos: Position) -> bool
Sourcepub fn gen_legal_positions(&self, from: Position) -> Vec<Position> ⓘ
pub fn gen_legal_positions(&self, from: Position) -> Vec<Position> ⓘ
generate only legal move positions for piece
Sourcepub fn gen_to_positions(&self, from: Position) -> Vec<Position> ⓘ
pub fn gen_to_positions(&self, from: Position) -> Vec<Position> ⓘ
generate all possible move position for piece
pub fn gen_sliding( &self, from: Position, piece_type: PieceType, ) -> Vec<Position> ⓘ
pub fn gen_king(&self, from: Position) -> Vec<Position> ⓘ
pub fn gen_pawn(&self, from: Position) -> Vec<Position> ⓘ
pub fn gen_knight(&self, from: Position) -> Vec<Position> ⓘ
Sourcepub fn make_move(&mut self, position_move: PositionMove)
pub fn make_move(&mut self, position_move: PositionMove)
make a move (without check)
pub fn undo_move(&mut self, piece_move: PositionMove, last_piece: u32)
Sourcepub fn gen_all_legal_moves(&self) -> Vec<PositionMove>
pub fn gen_all_legal_moves(&self) -> Vec<PositionMove>
generates all moves based on active color.
pub fn gen_all_opponent_positions(&self) -> Vec<Position> ⓘ
pub fn is_en_passant(&self, from: Position, to: Position) -> bool
pub fn is_promotion(&self, from: Position, to: Position) -> bool
pub fn get_material_weight(&self) -> i32
pub fn get_num_white_pieces(&self) -> i32
pub fn get_num_black_pieces(&self) -> i32
pub fn switch_active_color(&mut self)
Trait Implementations§
impl Copy for BoardMap
Auto Trait Implementations§
impl Freeze for BoardMap
impl RefUnwindSafe for BoardMap
impl Send for BoardMap
impl Sync for BoardMap
impl Unpin for BoardMap
impl UnwindSafe for BoardMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more