use crate::board::zobrist::ZobristKey;
use crate::types::Move;
pub type BookKey = ZobristKey;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct BookMove {
mv: Move,
score: i16,
depth: u16,
}
impl BookMove {
#[must_use]
pub const fn new(mv: Move, score: i16, depth: u16) -> Self {
Self { mv, score, depth }
}
#[must_use]
pub const fn mv(self) -> Move {
self.mv
}
#[must_use]
pub const fn score(self) -> i16 {
self.score
}
#[must_use]
pub const fn depth(self) -> u16 {
self.depth
}
}
#[derive(Clone, Copy, Debug)]
pub struct BookEntry<'a> {
key: BookKey,
moves: &'a [BookMove],
}
impl<'a> BookEntry<'a> {
#[must_use]
pub const fn new(key: BookKey, moves: &'a [BookMove]) -> Self {
Self { key, moves }
}
#[must_use]
pub const fn key(self) -> BookKey {
self.key
}
#[must_use]
pub const fn moves(self) -> &'a [BookMove] {
self.moves
}
}