Struct bughouse::BughouseMove [−][src]
pub struct BughouseMove { /* fields omitted */ }
Expand description
Represent a ChessMove in memory
Implementations
Create a new chess move, given a source Square
, a destination Square
, and an optional
promotion Piece
Get the source square (square the piece is currently on).
Convert a “BAN”, Bughouse-extended (Standard) Algebraic Notation move
into a BughouseMove
. e.g. drops: “p@f7”
use bughouse::{BughouseBoard, BughouseMove, Square}; let board = BughouseBoard::default(); assert_eq!( BughouseMove::from_ban(&board, "e4").expect("e4 is valid in the initial position"), BughouseMove::new(Some(Square::E2), Square::E4, None) );
Convert drop algebraic notation to BughouseMove e.g. drops: “p@f7”
Trait Implementations
Returns the “default value” for a type. Read more
Convert a BUCI, Bughouse-enabled UCI, move
use bughouse::{BughouseMove, Square, Piece}; use std::str::FromStr; let mv = BughouseMove::new(Some(Square::E7), Square::E8, Some(Piece::Queen)); assert_eq!(BughouseMove::from_str("e7e8q").expect("Valid Move"), mv);
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for BughouseMove
impl Send for BughouseMove
impl Sync for BughouseMove
impl Unpin for BughouseMove
impl UnwindSafe for BughouseMove
Blanket Implementations
Mutably borrows from an owned value. Read more