[board] Implement placing a piece in a mutable position

This commit is contained in:
Eryn Wells 2023-12-23 09:31:41 -07:00
parent 153e21b693
commit 366f15ca12
2 changed files with 72 additions and 3 deletions

View file

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