[board, explorer, position] Clean up naming of sight and movement methods

These methods have a prefix, either `sight` or `movement`, and then follow the conventions
for other "trio" clusters where there's an un-suffixed method that takes an
Option<Color>, a _active method that uses the active color, and a _unwrapped
method that takes a bare Color.
This commit is contained in:
Eryn Wells 2025-06-29 09:23:20 -07:00
parent e7fd65672d
commit a30553503f
4 changed files with 42 additions and 25 deletions

View file

@ -86,12 +86,14 @@ impl Position {
}
impl Position {
pub fn sight(&self, square: Square) -> BitBoard {
self.board.sight(square)
/// Calculate sight of a piece on the provided [`Square`].
pub fn sight_piece(&self, square: Square) -> BitBoard {
self.board.sight_piece(square)
}
pub fn movement(&self, square: Square) -> BitBoard {
self.board.movement(square)
/// Calculate movement of a piece on the provided [`Square`].
pub fn movement_piece(&self, square: Square) -> BitBoard {
self.board.movement_piece(square)
}
}
@ -163,8 +165,8 @@ impl Position {
}
impl Position {
pub fn active_sight(&self) -> BitBoard {
self.board.active_sight()
pub fn sight_active(&self) -> BitBoard {
self.board.sight_active()
}
/// A [`BitBoard`] of all squares the given color can see.
@ -285,7 +287,7 @@ impl Position {
}
let target_bitboard: BitBoard = target.into();
if !(self.movement(origin) & target_bitboard).is_populated() {
if !(self.movement_piece(origin) & target_bitboard).is_populated() {
return None;
}