Struct chess_move_gen::Position
[−]
[src]
pub struct Position { /* fields omitted */ }
Position encodes all positional information and non-positional game state
Methods
impl Position
[src]
pub fn make(&mut self, mv: Move) -> Option<(Piece, Square)>
[src]
Returns piece captured and square if any
pub fn unmake(
&mut self,
mv: Move,
capture: Option<(Piece, Square)>,
original_state: &State,
original_hash_key: u64
)
[src]
&mut self,
mv: Move,
capture: Option<(Piece, Square)>,
original_state: &State,
original_hash_key: u64
)
impl Position
[src]
pub fn new(grid: [Piece; 64], state: State) -> Position
[src]
pub fn from_fen(fen: &str) -> Result<Position, String>
[src]
Construct a new position from a FEN string
pub fn to_fen(&self) -> String
[src]
pub fn hash_key(&self) -> u64
[src]
pub fn state(&self) -> &State
[src]
Get position non-positional state
pub fn grid(&self) -> &[Piece; 64]
[src]
Get position position
pub fn at(&self, sq: Square) -> Piece
[src]
Get piece at square
pub fn to_string(&self) -> String
[src]
pub fn bb_side(&self, side: Side) -> BB
[src]
Get bitboard of pieces for a particular side
pub fn bb_pc(&self, pc: Piece) -> BB
[src]
Get bitboard of pieces for a particular piece
pub fn bb_sliders(&self, side: Side) -> (BB, BB)
[src]
Get bitboard of sliding pieces for a particular side
pub fn bb_occupied(&self) -> BB
[src]
Get bitboard of all occupied squares
pub fn bb_empty(&self) -> BB
[src]
Get bitboard of all empty squares
Trait Implementations
impl Clone for Position
[src]
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Position
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more