[board] Clean up interfaces of pieces and square structs
This commit is contained in:
parent
301fe1a4f4
commit
41421dddbb
5 changed files with 57 additions and 31 deletions
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue