aboutsummaryrefslogtreecommitdiff
path: root/src/board/zobrist.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/board/zobrist.rs')
-rw-r--r--src/board/zobrist.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/board/zobrist.rs b/src/board/zobrist.rs
index 8ea0038..5286a73 100644
--- a/src/board/zobrist.rs
+++ b/src/board/zobrist.rs
@@ -2,7 +2,7 @@ use rand::{rngs::StdRng,SeedableRng,Rng};
use crate::{square::Square, bitboard::BitboardFns};
-use super::{Board, Color, PieceType, CastlingSide};
+use super::{Board, Color, Piece, CastlingSide};
const TOTAL_PIECES: usize = 12;
@@ -20,7 +20,7 @@ pub trait Zobrist {
/// https://www.chessprogramming.org/Zobrist_Hashing
fn compute_hash(&mut self) -> ();
- fn zobrist_toggle_piece(&mut self, piece_type: PieceType, square: Square) -> ();
+ fn zobrist_toggle_piece(&mut self, piece_type: Piece, square: Square) -> ();
fn zobrist_toggle_castling_right(&mut self, color: Color, side: CastlingSide) -> ();
fn zobrist_toggle_ep_square(&mut self, ep_square: Square) -> ();
fn zobrist_toggle_color(&mut self) -> ();
@@ -37,7 +37,7 @@ impl Zobrist for Board {
for piece_id in 0..self.piece_sets.len() {
for square in self.piece_sets[piece_id].serialize() {
- self.zobrist_toggle_piece(PieceType::from(piece_id), square);
+ self.zobrist_toggle_piece(Piece::from(piece_id), square);
}
}
for color in [Color::White, Color::Black] {
@@ -58,7 +58,7 @@ impl Zobrist for Board {
}
}
- fn zobrist_toggle_piece(&mut self, piece_type: PieceType, square: Square) -> () {
+ fn zobrist_toggle_piece(&mut self, piece_type: Piece, square: Square) -> () {
self.hash ^= self.zobrist_seed[piece_type as usize * TOTAL_SQUARES + square as usize];
}