Struct pleco::board::BoardState [] [src]

pub struct BoardState {
    pub castling: Castling,
    pub rule_50: i16,
    pub ply: u16,
    pub ep_square: SQ,
    pub zobrast: u64,
    pub captured_piece: Option<Piece>,
    pub checkers_bb: BitBoard,
    pub blockers_king: [BitBoard; 2],
    pub pinners_king: [BitBoard; 2],
    pub check_sqs: [BitBoard; 6],
    pub prev_move: BitMove,
    pub prev: Option<Arc<BoardState>>,
}

Holds useful information concerning the current state of the board.

This is information that is computed upon making a move, and requires expensive computation to do so as well. It is stored in the Heap by 'Board' as an Arc, as cloning the board can lead to multiple references to the same BoardState.

Allows for easy undo-ing of moves as these keep track of their previous board state, forming a Tree-like persistent Stack

Fields

Methods

impl BoardState
[src]

[src]

Constructs a board state for the starting position.

[src]

Constructs a blank board state.

[src]

Constructs a partial clone of a BoardState.

Castling, rule_50, ply, and ep_square are copied. The copied fields need to be modified accordingly, and the remaining fields need to be generated.

[src]

Return the previous BoardState from one move ago.

[src]

[src]

Trait Implementations

impl Clone for BoardState
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more