prevented illegal castling
This commit is contained in:
parent
2a100c8b50
commit
2aca5ed841
4 changed files with 99 additions and 11 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue