[board] Clean up interfaces of pieces and square structs

This commit is contained in:
Eryn Wells 2023-12-29 09:17:33 -08:00
parent 301fe1a4f4
commit 41421dddbb
5 changed files with 57 additions and 31 deletions

View file

@ -26,15 +26,15 @@ impl BitBoard {
}
pub fn has_piece_at(&self, sq: &Square) -> bool {
(self.0 & (1 << sq.index)) > 0
(self.0 & (1 << sq.index())) > 0
}
pub fn place_piece_at(&mut self, sq: &Square) {
self.0 |= 1 << sq.index
self.0 |= 1 << sq.index()
}
fn remove_piece_at(&mut self, sq: &Square) {
self.0 &= !(1 << sq.index)
self.0 &= !(1 << sq.index())
}
}