pub struct State {
pub turn: Color,
pub move_buff: Vec<MoveBuffItem>,
/* private fields */
}
Expand description
State records the state of a chess game
Fields§
§turn: Color
§move_buff: Vec<MoveBuffItem>
Implementations§
Source§impl State
State implementation
impl State
State implementation
Sourcepub fn parse_piece_placement(&mut self, fen: &str)
pub fn parse_piece_placement(&mut self, fen: &str)
parses piece placement
Sourcepub fn set_from_fen(&mut self, fen: &str)
pub fn set_from_fen(&mut self, fen: &str)
sets state from fen
pub fn put(&mut self, sq: Square, p: Piece)
pub fn remove(&mut self, sq: Square)
Sourcepub fn piece_at_square(&self, sq: Square) -> Piece
pub fn piece_at_square(&self, sq: Square) -> Piece
returns the piece at a square
Sourcepub fn report_fen(&self) -> String
pub fn report_fen(&self) -> String
reports the state as fen
Sourcepub fn print_bitboards(&self)
pub fn print_bitboards(&self)
prints bitboards
Sourcepub fn color_figure_mobility_at_square(
&self,
sq: Square,
gen_mode: MoveGenMode,
col: Color,
fig: Figure,
) -> Bitboard
pub fn color_figure_mobility_at_square( &self, sq: Square, gen_mode: MoveGenMode, col: Color, fig: Figure, ) -> Bitboard
returns mobility of color figure at square
Sourcepub fn generate_pseudo_legal_moves(
&mut self,
gen_mode: MoveGenMode,
) -> Vec<Move> ⓘ
pub fn generate_pseudo_legal_moves( &mut self, gen_mode: MoveGenMode, ) -> Vec<Move> ⓘ
generates pseudo legal moves for turn
Sourcepub fn generate_pseudo_legal_moves_for_color(
&self,
gen_mode: MoveGenMode,
col: Color,
) -> Vec<Move> ⓘ
pub fn generate_pseudo_legal_moves_for_color( &self, gen_mode: MoveGenMode, col: Color, ) -> Vec<Move> ⓘ
generates pseudo legal moves for color
Sourcepub fn pretty_print_string(&mut self) -> String
pub fn pretty_print_string(&mut self) -> String
returns the state as pretty printable string
Sourcepub fn gen_move_buff(&mut self) -> String
pub fn gen_move_buff(&mut self) -> String
generates moves with meta information
Sourcepub fn init_variant(&self)
pub fn init_variant(&self)
initialize from variant
Sourcepub fn variant_start_fen(&self) -> &str
pub fn variant_start_fen(&self) -> &str
returns the start fen for the variant of the state
Trait Implementations§
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
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