[board] Define two new types for the Clock properties of Board
Helpful for other parts of the code.
This commit is contained in:
parent
d5c0330fbe
commit
ddd14e8999
2 changed files with 7 additions and 3 deletions
|
@ -9,14 +9,17 @@ use crate::{
|
|||
use chessfriend_bitboard::BitBoard;
|
||||
use chessfriend_core::{Color, Piece, Shape, Square, Wing};
|
||||
|
||||
pub type HalfMoveClock = u32;
|
||||
pub type FullMoveClock = u32;
|
||||
|
||||
#[derive(Clone, Debug, Default, Eq, PartialEq)]
|
||||
pub struct Board {
|
||||
pub active_color: Color,
|
||||
pub pieces: PieceSet,
|
||||
pub castling_rights: castle::Rights,
|
||||
pub en_passant_target: Option<Square>,
|
||||
pub half_move_clock: u32,
|
||||
pub full_move_number: u32,
|
||||
pub half_move_clock: HalfMoveClock,
|
||||
pub full_move_number: FullMoveClock,
|
||||
}
|
||||
|
||||
impl Board {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
// Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
pub mod board;
|
||||
pub mod castle;
|
||||
pub mod display;
|
||||
pub mod en_passant;
|
||||
|
@ -8,11 +9,11 @@ pub mod macros;
|
|||
pub mod movement;
|
||||
pub mod sight;
|
||||
|
||||
mod board;
|
||||
mod piece_sets;
|
||||
|
||||
pub use board::Board;
|
||||
pub use castle::Parameters as CastleParameters;
|
||||
pub use castle::Rights as CastleRights;
|
||||
pub use piece_sets::{PlacePieceError, PlacePieceStrategy};
|
||||
|
||||
use piece_sets::PieceSet;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue