Struct pleco::helper::Helper [−][src]
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]
impl Helper
pub fn new() -> Self
[src]
pub fn new() -> Self
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 BitBoardpub fn bishop_moves(&self, occupied: BitBoard, sq: SQ) -> BitBoard
[src]
pub fn bishop_moves(&self, occupied: BitBoard, sq: SQ) -> BitBoard
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 BitBoardpub fn rook_moves(&self, occupied: BitBoard, sq: SQ) -> BitBoard
[src]
pub fn rook_moves(&self, occupied: BitBoard, sq: SQ) -> BitBoard
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 BitBoardpub fn queen_moves(&self, occupied: BitBoard, sq: SQ) -> BitBoard
[src]
pub fn queen_moves(&self, occupied: BitBoard, sq: SQ) -> BitBoard
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 BitBoardpub fn knight_moves(&self, sq: SQ) -> BitBoard
[src]
pub fn knight_moves(&self, sq: SQ) -> BitBoard
Generate Knight Moves BitBoard
from a source square.
ⓘImportant traits for BitBoardpub fn king_moves(&self, sq: SQ) -> BitBoard
[src]
pub fn king_moves(&self, sq: SQ) -> BitBoard
Generate King moves BitBoard
from a source square.
pub fn distance_of_sqs(&self, sq_one: SQ, sq_two: SQ) -> u8
[src]
pub fn distance_of_sqs(&self, sq_one: SQ, sq_two: SQ) -> u8
Get the distance of two squares.
ⓘImportant traits for BitBoardpub fn line_bb(&self, sq_one: SQ, sq_two: SQ) -> BitBoard
[src]
pub fn line_bb(&self, sq_one: SQ, sq_two: SQ) -> BitBoard
Get the line (diagonal / file / rank) BitBoard
that two squares both exist on, if it exists.
ⓘImportant traits for BitBoardpub fn between_bb(&self, sq_one: SQ, sq_two: SQ) -> BitBoard
[src]
pub fn between_bb(&self, sq_one: SQ, sq_two: SQ) -> BitBoard
Get the line (diagonal / file / rank) BitBoard
between two squares, not including the squares, if it exists.
ⓘImportant traits for BitBoardpub fn adjacent_sq_file(&self, sq: SQ) -> BitBoard
[src]
pub fn adjacent_sq_file(&self, sq: SQ) -> BitBoard
Gets the adjacent files BitBoard
of the square
ⓘImportant traits for BitBoardpub fn adjacent_file(&self, f: File) -> BitBoard
[src]
pub fn adjacent_file(&self, f: File) -> BitBoard
Gets the adjacent files BitBoard
of the file
ⓘImportant traits for BitBoardpub fn pawn_attacks_from(&self, sq: SQ, player: Player) -> BitBoard
[src]
pub fn pawn_attacks_from(&self, sq: SQ, player: Player) -> BitBoard
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]
pub fn aligned(&self, s1: SQ, s2: SQ, s3: SQ) -> bool
Returns if three Squares are in the same diagonal, file, or rank.
ⓘImportant traits for BitBoardpub fn ring_distance(&self, sq: SQ, distance: u8) -> BitBoard
[src]
pub fn ring_distance(&self, sq: SQ, distance: u8) -> BitBoard
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 BitBoardpub fn forward_rank_bb(&self, player: Player, rank: Rank) -> BitBoard
[src]
pub fn forward_rank_bb(&self, player: Player, rank: Rank) -> BitBoard
Returns the BitBoard of all squares in the rank in front of the given one.
ⓘImportant traits for BitBoardpub fn pawn_attacks_span(&self, player: Player, sq: SQ) -> BitBoard
[src]
pub fn pawn_attacks_span(&self, player: Player, sq: SQ) -> BitBoard
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 BitBoardpub fn forward_file_bb(&self, player: Player, sq: SQ) -> BitBoard
[src]
pub fn forward_file_bb(&self, player: Player, sq: SQ) -> BitBoard
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 BitBoardpub fn passed_pawn_mask(&self, player: Player, sq: SQ) -> BitBoard
[src]
pub fn passed_pawn_mask(&self, player: Player, sq: SQ) -> BitBoard
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]
pub fn z_square(&self, sq: SQ, piece: Piece) -> u64
Returns the zobrist hash of a specific player's piece being at a particular square.
pub fn z_ep(&self, sq: SQ) -> u64
[src]
pub fn z_ep(&self, sq: SQ) -> u64
Returns the zobrist hash of a given file having an en-passant square.
pub fn z_castle(&self, castle: u8) -> u64
[src]
pub fn z_castle(&self, castle: u8) -> u64
Returns a zobrast hash of the castling rights, as defined by the Board.
pub fn z_side(&self) -> u64
[src]
pub fn z_side(&self) -> u64
Returns Zobrist Hash of flipping sides.
pub fn psq(&self, piece: Piece, sq: SQ) -> Score
[src]
pub fn psq(&self, piece: Piece, sq: SQ) -> Score
Returns the score for a player's piece being at a particular square.
pub fn piece_value(&self, piece: Piece, eg: bool) -> Value
[src]
pub fn piece_value(&self, piece: Piece, eg: bool) -> Value
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.