Struct chess::magic::Magic [] [src]

pub struct Magic {
    // some fields omitted
}

Methods

impl Magic
[src]

fn construct()

Initialize all the magic numbers and lookup tables. Note: You want to call construct::construct() instead. It's easier, and you must call BitBoard::construct() before calling this, so just rely on the other one.

fn get_bishop_rays(sq: Square) -> BitBoard

Get the rays for a bishop on a particular square.

fn get_rook_rays(sq: Square) -> BitBoard

Get the rays for a rook on a particular square.

fn get_rook_moves(sq: Square, blockers: BitBoard) -> BitBoard

Get the moves for a rook on a particular square, given blockers blocking my movement.

fn get_bishop_moves(sq: Square, blockers: BitBoard) -> BitBoard

Get the moves for a bishop on a particular square, given blockers blocking my movement.

fn get_king_moves(sq: Square) -> BitBoard

Get the king moves for a particular square.

fn get_knight_moves(sq: Square) -> BitBoard

Get the knight moves for a particular square.

fn get_pawn_attacks(sq: Square, color: Color, blockers: BitBoard) -> BitBoard

Get the pawn capture move for a particular square, given the pawn's color and the potential victims

fn get_pawn_quiets(sq: Square, color: Color, blockers: BitBoard) -> BitBoard

Get the quiet pawn moves (non-captures) for a particular square, given the pawn's color and the potential blocking pieces.

fn get_pawn_moves(sq: Square, color: Color, blockers: BitBoard) -> BitBoard

Get all the pawn moves for a particular square, given the pawn's color and the potential blocking pieces and victims.

fn line(sq1: Square, sq2: Square) -> BitBoard

Get a line (extending to infinity, which in chess is 8 squares), given two squares. This line does extend past the squares.

fn between(sq1: Square, sq2: Square) -> BitBoard

Get a line between these two squares, not including the squares themselves.

Trait Implementations

impl Clone for Magic
[src]

fn clone(&self) -> Magic

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl Copy for Magic
[src]