From 8e7ac2814c4a92eba79f9c626ad14ac0b7bfef3f Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 26 Feb 2023 23:26:51 +0300 Subject: feat: add clock and time management to UCI --- src/board/io.rs | 3 ++- src/board/mod.rs | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/board') diff --git a/src/board/io.rs b/src/board/io.rs index 67aa096..d27b856 100644 --- a/src/board/io.rs +++ b/src/board/io.rs @@ -1,4 +1,4 @@ -use crate::{bitboard::Bitboard, attacks::Attacks, moves::Move}; +use crate::{bitboard::Bitboard, attacks::Attacks, moves::Move, clock::Clock}; use super::{Board, Piece, zobrist::Zobrist}; const PIECE_CHARS: [&str; 12] = [ @@ -96,6 +96,7 @@ impl IO for Board { attacks: Attacks::new(), castling_rights: [[true; 2]; 2], // TODO: actualy parse from FEN ep_target: None, // TODO: parse from FEN + clock: Clock::default(), hash: 0, zobrist_seed: Board::seed(), }; diff --git a/src/board/mod.rs b/src/board/mod.rs index 6fb8b93..95d470a 100644 --- a/src/board/mod.rs +++ b/src/board/mod.rs @@ -1,4 +1,4 @@ -use crate::{bitboard::{Bitboard, BitboardFns}, moves::{Move, MoveKind}, attacks::Attacks, square::Square, board::io::IO}; +use crate::{bitboard::{Bitboard, BitboardFns}, moves::{Move, MoveKind}, attacks::Attacks, square::Square, board::io::IO, clock::Clock}; use self::{zobrist::{ZobristSeed, Zobrist}, piece::Piece, color::Color}; pub mod io; @@ -24,6 +24,8 @@ pub struct Board { /// En passsant target square pub ep_target: Option, + pub clock: Clock, + // Computed values pub occupancy: Bitboard, /// Zobrist hash of the current position -- cgit v1.2.3