use super::history::StatsEntry;
pub struct TTMoveHistory {
table: [StatsEntry<7183>; 256], }
impl TTMoveHistory {
pub fn new() -> Self {
Self {
table: [StatsEntry::default(); 256],
}
}
pub fn get(&self, ply: usize) -> i16 {
self.table[ply].get()
}
pub fn update(&mut self, ply: usize, bonus: i32) {
if ply < self.table.len() {
self.table[ply].update(bonus);
}
}
pub fn clear(&mut self) {
for entry in self.table.iter_mut() {
entry.set(0);
}
}
}
impl Default for TTMoveHistory {
fn default() -> Self {
Self::new()
}
}