Struct shogi::bitboard::Factory[][src]

pub struct Factory {}
Expand description

Creates various bitboard instances.

init method needs to be called first for pre-calculation.

Examples

use shogi::bitboard::Factory;
use shogi::square::consts::*;

// init() shold be called before other method calls.
Factory::init();
let bb = Factory::between(SQ_1A, SQ_9I);
assert_eq!(7, bb.count());

Implementations

Pre-calculate complex bitboards for faster table lookup. This method needs to be called once before other methods in Factory get called.

Returns a bitboard in which squares attacked by the given piece are filled.

Returns a bitboard in which squares attacked by Rook at the given square are filled.

Returns a bitboard in which squares attacked by Bishop at the given square are filled.

Returns a bitboard in which squares attacked by Lance at the given square are filled.

Returns a bitboard in which squares in opposite player’s area are filled.

Returns a bitboard in which squares between the given two squares are filled.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.