pub struct Setup {
pub board: Board,
pub promoted: Bitboard,
pub pockets: Option<ByColor<ByRole<u8>>>,
pub turn: Color,
pub castling_rights: Bitboard,
pub ep_square: Option<Square>,
pub remaining_checks: Option<ByColor<RemainingChecks>>,
pub halfmoves: u32,
pub fullmoves: NonZeroU32,
}
Expand description
A not necessarily legal position.
Fields
board: Board
Piece positions on the board.
promoted: Bitboard
Positions of tracked promoted pieces. Used only for Crazyhouse.
pockets: Option<ByColor<ByRole<u8>>>
Pockets in chess variants like Crazyhouse.
turn: Color
Side to move.
castling_rights: Bitboard
Castling rights in terms of corresponding rook positions.
Examples
use shakmaty::{Bitboard, Setup};
let setup = Setup::default();
let rooks = setup.castling_rights;
// 1 . . . . . . 1
// . . . . . . . .
// . . . . . . . .
// . . . . . . . .
// . . . . . . . .
// . . . . . . . .
// . . . . . . . .
// 1 . . . . . . 1
assert_eq!(rooks, Bitboard::CORNERS);
ep_square: Option<Square>
En passant target square. Valid target squares are on the third or sixth rank.
remaining_checks: Option<ByColor<RemainingChecks>>
Remaining checks in chess variants like Three-Check.
halfmoves: u32
Number of half-moves since the last capture or pawn move.
Examples
use shakmaty::Setup;
let setup = Setup::default();
assert_eq!(setup.halfmoves, 0);
fullmoves: NonZeroU32
Current move number.
Starts at 1 and is increased after every black move.
Examples
use shakmaty::Setup;
let setup = Setup::default();
assert_eq!(setup.fullmoves.get(), 1);
Implementations
Trait Implementations
sourceimpl PartialEq<Setup> for Setup
impl PartialEq<Setup> for Setup
impl Eq for Setup
impl StructuralEq for Setup
impl StructuralPartialEq for Setup
Auto Trait Implementations
impl RefUnwindSafe for Setup
impl Send for Setup
impl Sync for Setup
impl Unpin for Setup
impl UnwindSafe for Setup
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more