Struct pleco::core::piece_move::BitMove [] [src]

pub struct BitMove { /* fields omitted */ }

Represents a singular move.

A BitMove consists of 16 bits, all of which to include a source square, destination square, and special move-flags to differentiate types of moves.

A BitMove should never be created directly, but rather instigated with a PreMoveInfo. This is because the bits are in a special order, and manually creating moves risks creating an invalid move.

Methods

impl BitMove
[src]

FLAG_QUIET: u16 = 0

FLAG_DOUBLE_PAWN: u16 = 1

FLAG_KING_CASTLE: u16 = 2

FLAG_QUEEN_CASTLE: u16 = 3

FLAG_CAPTURE: u16 = 4

FLAG_EP: u16 = 5

ILLEGAL_FLAG_1: u16 = 6

ILLEGAL_FLAG_2: u16 = 7

FLAG_PROMO_N: u16 = 8

FLAG_PROMO_B: u16 = 9

FLAG_PROMO_R: u16 = 10

FLAG_PROMO_Q: u16 = 11

FLAG_PROMO_CAP_N: u16 = 12

FLAG_PROMO_CAP_B: u16 = 13

FLAG_PROMO_CAP_R: u16 = 14

FLAG_PROMO_CAP_Q: u16 = 15

[src]

Creates a new BitMove from raw bits.

Safety

Using this method cannot guarantee that the move is legal. The input bits must be encoding a legal move, or else there is Undefined Behavior if the resulting BitMove is used.

[src]

Makes a quiet BitMove from a source and destination square.

[src]

Makes a pawn-push BitMove from a source and destination square.

[src]

Makes a non-enpassant capturing BitMove from a source and destination square.

[src]

Makes an enpassant BitMove from a source and destination square.

[src]

Creates a BitMove from a source and destination square, as well as the current flag.

[src]

Creates a BitMove from a PreMoveInfo.

[src]

Creates a Null Move.

Safety

A Null move is never a valid move to play. Using a Null move should onl be used for search and evaluation purposes.

[src]

Returns if a BitMove is a Null Move.

See BitMove::null() for more information on Null moves.

[src]

Returns if a BitMove captures an opponent's piece.

[src]

Returns if a BitMove is a Quiet Move, meaning it is not any of the following: a capture, promotion, castle, or double pawn push.

[src]

Returns if a BitMove is a promotion.

[src]

Returns the destination of a BitMove.

[src]

Returns the destination of a BitMove.

[src]

Returns the source square of a BitMove.

[src]

Returns the source square of a BitMove.

[src]

Returns if a BitMove is a castle.

[src]

Returns if a BitMove is a Castle && it is a KingSide Castle.

[src]

Returns if a BitMove is a Castle && it is a QueenSide Castle.

[src]

Returns if a BitMove is an enpassant capture.

[src]

Returns if a BitMove is a double push, and if so returns the Destination square as well.

[src]

Returns the Rank (otherwise known as row) that the destination square of a BitMove lies on.

[src]

Returns the File (otherwise known as column) that the destination square of a BitMove lies on.

[src]

Returns the Rank (otherwise known as row) that the from-square of a BitMove lies on.

[src]

Returns the File (otherwise known as column) that the from-square of a BitMove lies on.

[src]

Returns the Promotion Piece of a BitMove.

Safety

Method should only be used if the BitMove is a promotion. Otherwise, Undefined Behavior may result.

[src]

Returns the MoveType of a BitMove.

[src]

Returns a String representation of a BitMove.

Format goes "Source Square, Destination Square, (Promo Piece)". Moving a Queen from A1 to B8 will stringify to "a1b8". If there is a pawn promotion involved, the piece promoted to will be appended to the end of the string, alike "a7a8q" in the case of a queen promotion.

[src]

Returns the raw number representation of the move.

[src]

Returns if the move has an incorrect flag inside, and therefore is invalid.

[src]

Trait Implementations

impl Copy for BitMove
[src]

impl Clone for BitMove
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for BitMove
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for BitMove
[src]

impl Debug for BitMove
[src]

[src]

Formats the value using the given formatter. Read more

impl Display for BitMove
[src]

[src]

Formats the value using the given formatter. Read more

impl FromIterator<BitMove> for MoveList
[src]

[src]

Creates a value from an iterator. Read more

impl FromIterator<BitMove> for ScoringMoveList
[src]

[src]

Creates a value from an iterator. Read more

Auto Trait Implementations

impl Send for BitMove

impl Sync for BitMove