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