[][src]Struct pleco::helper::Helper

pub struct Helper {}

Helper structure for accessing statically-initialized tables and other constants.

Guarantees that the tables will be initialized upon access through a Helper.

Methods

impl Helper[src]

pub fn new() -> Self[src]

Creates a new Helper Object, automatically initializing all the needed tables.

Calling this method multiple times does not waste time computing the static variables if already initialized. init_statics also does the same thing as well.

Important traits for BitBoard
pub fn bishop_moves(self, occupied: BitBoard, sq: SQ) -> BitBoard[src]

Generate Bishop Moves BitBoard from a bishop square and all occupied squares on the board. This function will return captures to pieces on both sides. The resulting BitBoard must be AND'd with the inverse of the intending moving player's pieces.

Important traits for BitBoard
pub fn rook_moves(self, occupied: BitBoard, sq: SQ) -> BitBoard[src]

Generate Rook Moves BitBoard from a bishop square and all occupied squares on the board. This function will return captures to pieces on both sides. The resulting BitBoard must be AND'd with the inverse of the intending moving player's pieces.

Important traits for BitBoard
pub fn queen_moves(self, occupied: BitBoard, sq: SQ) -> BitBoard[src]

Generate Queen Moves BitBoard from a bishop square and all occupied squares on the board. This function will return captures to pieces on both sides. The resulting BitBoard must be AND'd with the inverse of the intending moving player's pieces.

Important traits for BitBoard
pub fn knight_moves(self, sq: SQ) -> BitBoard[src]

Generate Knight Moves BitBoard from a source square.

Important traits for BitBoard
pub fn king_moves(self, sq: SQ) -> BitBoard[src]

Generate King moves BitBoard from a source square.

pub fn distance_of_sqs(self, sq_one: SQ, sq_two: SQ) -> u8[src]

Get the distance of two squares.

Important traits for BitBoard
pub fn line_bb(self, sq_one: SQ, sq_two: SQ) -> BitBoard[src]

Get the line (diagonal / file / rank) BitBoard that two squares both exist on, if it exists.

Important traits for BitBoard
pub fn between_bb(self, sq_one: SQ, sq_two: SQ) -> BitBoard[src]

Get the line (diagonal / file / rank) BitBoard between two squares, not including the squares, if it exists.

Important traits for BitBoard
pub fn adjacent_sq_file(self, sq: SQ) -> BitBoard[src]

Gets the adjacent files BitBoard of the square

Important traits for BitBoard
pub fn adjacent_file(self, f: File) -> BitBoard[src]

Gets the adjacent files BitBoard of the file

Important traits for BitBoard
pub fn pawn_attacks_from(self, sq: SQ, player: Player) -> BitBoard[src]

Pawn attacks BitBoard from a given square, per player. Basically, given square x, returns the BitBoard of squares a pawn on x attacks.

pub fn aligned(self, s1: SQ, s2: SQ, s3: SQ) -> bool[src]

Returns if three Squares are in the same diagonal, file, or rank.

Important traits for BitBoard
pub fn ring_distance(self, sq: SQ, distance: u8) -> BitBoard[src]

Returns the ring of bits surrounding the square sq at a specified distance.

Safety

distance must be less than 8, or else a panic will occur.

Important traits for BitBoard
pub fn forward_rank_bb(self, player: Player, rank: Rank) -> BitBoard[src]

Returns the BitBoard of all squares in the rank in front of the given one.

Important traits for BitBoard
pub fn pawn_attacks_span(self, player: Player, sq: SQ) -> BitBoard[src]

Returns the BitBoard of all squares that can be attacked by a pawn of the same color when it moves along its file, starting from the given square. Basically, if the pawn progresses along the same file for the entire game, this bitboard would contain all possible forward squares it could attack

Safety

The Square must be within normal bounds, or else a panic or undefined behvaior may occur.

Important traits for BitBoard
pub fn forward_file_bb(self, player: Player, sq: SQ) -> BitBoard[src]

Returns the BitBoard of all squares in the file in front of the given one.

Safety

The Square must be within normal bounds, or else a panic or undefined behvaior may occur.

Important traits for BitBoard
pub fn passed_pawn_mask(self, player: Player, sq: SQ) -> BitBoard[src]

Returns a BitBoard allowing for testing of the a pawn being a "passed pawn".

Safety

The Square must be within normal bounds, or else a panic or undefined behvaior may occur.

pub fn z_square(self, sq: SQ, piece: Piece) -> u64[src]

Returns the zobrist hash of a specific player's piece being at a particular square.

pub fn z_ep(self, sq: SQ) -> u64[src]

Returns the zobrist hash of a given file having an en-passant square.

pub fn z_castle(self, castle: u8) -> u64[src]

Returns a zobrist hash of the castling rights, as defined by the Board.

pub fn z_side(self) -> u64[src]

Returns Zobrist Hash of flipping sides.

pub fn psq(self, piece: Piece, sq: SQ) -> Score[src]

Returns the score for a player's piece being at a particular square.

pub fn piece_value(self, piece: Piece, eg: bool) -> Value[src]

Returns the value of a piece for a player. If eg is true, it returns the end game value. Otherwise, it'll return the midgame value.

Trait Implementations

impl Send for Helper[src]

impl Sync for Helper[src]

impl Copy for Helper[src]

impl Default for Helper[src]

impl Clone for Helper[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Blanket Implementations

impl<T, U> Into 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> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.