Enum shakmaty::Move [] [src]

pub enum Move {
    Normal {
        role: Role,
        from: Square,
        capture: Option<Role>,
        to: Square,
        promotion: Option<Role>,
    },
    EnPassant {
        from: Square,
        to: Square,
    },
    Castle {
        king: Square,
        rook: Square,
    },
    Put {
        role: Role,
        to: Square,
    },
}

Information about a move.

Variants

Fields of Normal

Fields of EnPassant

Fields of Castle

Fields of Put

Methods

impl Move
[src]

[src]

Gets the role of the moved piece.

[src]

Gets the origin square or None for drops.

[src]

Gets the target square. For castling moves this is the corresponding rook square.

[src]

Gets the role of the captured piece or None.

[src]

Checks if the move is a capture.

[src]

Checks if the move is en passant.

[src]

Gets the castling side.

[src]

Checks if the move is a castling move.

[src]

Gets the promotion role.

[src]

Checks if the move is a promotion.

Trait Implementations

impl Clone for Move
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for Move
[src]

impl PartialEq for Move
[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 Debug for Move
[src]

[src]

Formats the value using the given formatter.

impl Display for Move
[src]

[src]

Formats the value using the given formatter. Read more