Skip to content

Commit e0511df

Browse files
committed
refactor: game state
1 parent 4a31559 commit e0511df

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/board/move_generation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ impl Board {
77
let mut moves = Vec::new();
88

99
// 50 moves draw
10-
if self.halfmove_clock >= 100 {
10+
if self.game_state.fifty_move_ply_count >= 100 {
1111
return moves;
1212
}
1313

@@ -77,7 +77,7 @@ impl Board {
7777
}
7878

7979
// EN PASSANT
80-
if let Some(ep) = self.en_passant_square {
80+
if let Some(ep) = self.game_state.en_passant_square {
8181
if left == ep {
8282
moves.push(Move {
8383
from,

src/board/zobrist.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ impl Zobrist {
5656
}
5757

5858
for i in 0..4 {
59-
if board.castling_rights & (1 << i) != 0 {
59+
if board.game_state.castling_rights & (1 << i) != 0 {
6060
hash ^= self.castling_rights[i];
6161
}
6262
}
6363

64-
if let Some(en_passant) = board.en_passant_square {
64+
if let Some(en_passant) = board.game_state.en_passant_square {
6565
hash ^= self.en_passant[en_passant % 8];
6666
}
6767

0 commit comments

Comments
 (0)