[][src]Struct chess_move_gen::Position

pub struct Position { /* fields omitted */ }

Position encodes all positional information and non-positional game state

Implementations

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]

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 piece_iter(&self, pc: Piece) -> BBIterator

Notable traits for BBIterator

impl Iterator for BBIterator type Item = (Square, BB);
[src]

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]

impl Debug for Position[src]

impl Display for Position[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> FromCast<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,