prevented illegal castling

This commit is contained in:
Moritz 2025-11-14 12:16:55 +01:00
parent 2a100c8b50
commit 2aca5ed841
4 changed files with 99 additions and 11 deletions

View file

@ -80,7 +80,6 @@ impl MoveList {
}
}
#[inline(always)]
pub fn push(&mut self, mv: Move) {
debug_assert!(self.count < 256, "Move list overflow!");
@ -88,20 +87,21 @@ impl MoveList {
self.count += 1;
}
#[inline(always)]
pub fn len(&self) -> usize {
self.count
}
#[inline(always)]
pub fn is_empty(&self) -> bool {
self.count == 0
}
#[inline(always)]
pub fn iter(&self) -> slice::Iter<'_, Move> {
self.moves[..self.count].iter()
}
pub fn contains(&self, mv: &Move) -> bool {
self.moves.contains(mv)
}
}
pub struct UndoMove {