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);