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.