Struct alcibiades::stock::StdMoveGenerator
[−]
[src]
pub struct StdMoveGenerator<T: Evaluator> { /* fields omitted */ }
Implements the MoveGenerator
trait.
Trait Implementations
impl<T: Clone + Evaluator> Clone for StdMoveGenerator<T>
[src]
fn clone(&self) -> StdMoveGenerator<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Evaluator> MoveGenerator for StdMoveGenerator<T>
[src]
type Evaluator = T
The type of static evaluator that the implementation works with. Read more
fn from_board(board: Board) -> Result<Self, IllegalBoard>
Creates a new instance, consuming the supplied Board
instance. Read more
fn hash(&self) -> u64
Returns the Zobrist hash value for the underlying Board
instance. Read more
fn board(&self) -> &Board
Returns a reference to the underlying Board
instance.
fn attacks_to(&self, square: Square) -> Bitboard
Returns a bitboard with all pieces that attack square
.
fn checkers(&self) -> Bitboard
Returns a bitboard with all enemy pieces that attack the king. Read more
fn evaluator(&self) -> &Self::Evaluator
Returns a reference to a static evaluator bound to the current position. Read more
fn generate_all<U: AddMove>(&self, moves: &mut U)
Generates all legal moves, possibly including some pseudo-legal moves too.
The moves are added to moves
. All generated moves with
pieces other than the king will be legal. Some of the
generated king's moves may be illegal because the destination
square is under attack.
The initial move score for all generated moves is 0
.
Note: A pseudo-legal move is a move that is otherwise legal, except it might leave the king in check.
fn generate_forcing<U: AddMove>(&self, generate_checks: bool, moves: &mut U)
Generates moves for the quiescence search.
The moves are added to moves
. This method always generates a
subset of the moves generated by generate_all
:
If the king is in check, all legal moves are included.
Captures and pawn promotions to queen are always included.
If
generate_checks
istrue
, moves that give check are included too. Discovered checks and checks given by castling are omitted for speed.
fn try_move_digest(&self, move_digest: MoveDigest) -> Option<Move>
Checks if move_digest
represents a pseudo-legal move. Read more
fn null_move(&self) -> Move
Returns a null move. Read more
fn do_move(&mut self, m: Move) -> Option<u64>
Plays a move on the board. Read more
fn undo_move(&mut self, m: Move)
Takes back last played move. Read more
fn evaluate_move(&self, m: Move) -> Value
Returns the likely evaluation change (material) to be lost or gained as a result of a given move. Read more