From 891b3ddbb9a098b4050cf7c34a234078d7d0456b Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 5 Feb 2024 14:00:23 -0800 Subject: [PATCH] [position] Remove the sight data from Position --- position/src/position/position.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/position/src/position/position.rs b/position/src/position/position.rs index 1785c04..ab5a71a 100644 --- a/position/src/position/position.rs +++ b/position/src/position/position.rs @@ -18,7 +18,6 @@ pub struct Position { flags: Flags, pieces: PieceBitBoards, en_passant_square: Option, - sight: [OnceCell; 2], moves: OnceCell, half_move_counter: u16, full_move_number: u16, @@ -187,13 +186,6 @@ impl Position { self.en_passant_square } - /// A bitboard representing the squares the pieces of the given color can - /// see. This is synonymous with the squares attacked by the player's - /// pieces. - pub(crate) fn sight_of_player(&self, color: Color) -> BitBoard { - *self.sight[color as usize].get_or_init(|| self._sight_of_player(color, &self.pieces)) - } - fn _sight_of_player(&self, player: Color, pieces: &PieceBitBoards) -> BitBoard { let en_passant_square = self.en_passant_square; @@ -308,10 +300,9 @@ impl Position { flags, en_passant_square, pieces, - sight: [OnceCell::new(), OnceCell::new()], - moves: OnceCell::new(), half_move_counter, full_move_number, + ..Default::default() } } @@ -349,7 +340,6 @@ impl Default for Position { flags: Flags::default(), pieces: PieceBitBoards::default(), en_passant_square: None, - sight: [OnceCell::new(), OnceCell::new()], moves: OnceCell::new(), half_move_counter: 0, full_move_number: 1,