mod magic;
mod boards;
mod zobrist;
mod psqt;
pub mod prelude;
use {SQ,BitBoard,Player,File,Rank,Piece};
use core::score::{Score,Value};
#[derive(Copy, Clone)]
pub struct Helper {}
unsafe impl Send for Helper {}
unsafe impl Sync for Helper {}
impl Default for Helper {
fn default() -> Self {
Helper::new()
}
}
impl Helper {
pub fn new() -> Self {
prelude::init_statics();
Helper {}
}
#[inline(always)]
pub fn bishop_moves(self, occupied: BitBoard, sq: SQ) -> BitBoard {
prelude::bishop_moves(occupied,sq)
}
#[inline(always)]
pub fn rook_moves(self, occupied: BitBoard, sq: SQ) -> BitBoard {
prelude::rook_moves(occupied,sq)
}
#[inline(always)]
pub fn queen_moves(self, occupied: BitBoard, sq: SQ) -> BitBoard {
prelude::queen_moves(occupied,sq)
}
#[inline(always)]
pub fn knight_moves(self, sq: SQ) -> BitBoard {
prelude::knight_moves(sq)
}
#[inline(always)]
pub fn king_moves(self, sq: SQ) -> BitBoard {
prelude::king_moves(sq)
}
#[inline(always)]
pub fn distance_of_sqs(self, sq_one: SQ, sq_two: SQ) -> u8 {
prelude::distance_of_sqs(sq_one, sq_two)
}
#[inline(always)]
pub fn line_bb(self, sq_one: SQ, sq_two: SQ) -> BitBoard {
prelude::line_bb(sq_one, sq_two)
}
#[inline(always)]
pub fn between_bb(self, sq_one: SQ, sq_two: SQ) -> BitBoard {
prelude::between_bb(sq_one, sq_two)
}
#[inline(always)]
pub fn adjacent_sq_file(self, sq: SQ) -> BitBoard {
prelude::adjacent_sq_file(sq)
}
#[inline(always)]
pub fn adjacent_file(self, f: File) -> BitBoard {
prelude::adjacent_file(f)
}
#[inline(always)]
pub fn pawn_attacks_from(self, sq: SQ, player: Player) -> BitBoard {
prelude::pawn_attacks_from(sq,player)
}
#[inline(always)]
pub fn aligned(self, s1: SQ, s2: SQ, s3: SQ) -> bool {
prelude::aligned(s1,s2,s3)
}
#[inline(always)]
pub fn ring_distance(self, sq: SQ, distance: u8) -> BitBoard {
prelude::ring_distance(sq,distance)
}
#[inline(always)]
pub fn forward_rank_bb(self, player: Player, rank: Rank) -> BitBoard {
prelude::forward_rank_bb(player,rank)
}
#[inline(always)]
pub fn pawn_attacks_span(self, player: Player, sq: SQ) -> BitBoard {
prelude::pawn_attacks_span(player,sq)
}
#[inline(always)]
pub fn forward_file_bb(self, player: Player, sq: SQ) -> BitBoard {
prelude::forward_file_bb(player,sq)
}
#[inline(always)]
pub fn passed_pawn_mask(self, player: Player, sq: SQ) -> BitBoard {
prelude::passed_pawn_mask(player, sq)
}
#[inline(always)]
pub fn z_square(self, sq: SQ, piece: Piece) -> u64 {
prelude::z_square(sq, piece)
}
#[inline(always)]
pub fn z_ep(self, sq: SQ) -> u64 {
prelude::z_ep(sq)
}
#[inline(always)]
pub fn z_castle(self, castle: u8) -> u64 {
prelude::z_castle(castle)
}
#[inline(always)]
pub fn z_side(self) -> u64 {
prelude::z_side()
}
#[inline(always)]
pub fn psq(self, piece: Piece, sq: SQ) -> Score {
prelude::psq(piece, sq)
}
#[inline(always)]
pub fn piece_value(self, piece: Piece, eg: bool) -> Value {
prelude::piece_value(piece, eg)
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn init_helper() {
Helper::new();
}
}