Struct chess_move_gen::Move [−][src]
pub struct Move { /* fields omitted */ }
Represents a move on the chess position. Uses a compact 16 bit representation
Methods
impl Move
[src]
impl Move
pub fn from(&self) -> Square
[src]
pub fn from(&self) -> Square
pub fn to(&self) -> Square
[src]
pub fn to(&self) -> Square
pub fn promote_to(&self) -> Kind
[src]
pub fn promote_to(&self) -> Kind
pub fn distance(&self) -> i32
[src]
pub fn distance(&self) -> i32
Returns the absolute distance moved. Eg for a push from square 8 to square 24: |24 - 8| = 16
pub fn is_castle(&self) -> bool
[src]
pub fn is_castle(&self) -> bool
pub fn is_capture(&self) -> bool
[src]
pub fn is_capture(&self) -> bool
pub fn is_ep_capture(&self) -> bool
[src]
pub fn is_ep_capture(&self) -> bool
pub fn is_promotion(&self) -> bool
[src]
pub fn is_promotion(&self) -> bool
pub fn castle(&self) -> Castle
[src]
pub fn castle(&self) -> Castle
pub fn to_string(&self) -> String
[src]
pub fn to_string(&self) -> String
pub fn new_move(from: Square, to: Square, is_capture: bool) -> Move
[src]
pub fn new_move(from: Square, to: Square, is_capture: bool) -> Move
pub const fn new_push(from: Square, to: Square) -> Move
[src]
pub const fn new_push(from: Square, to: Square) -> Move
pub const fn new_capture(from: Square, to: Square) -> Move
[src]
pub const fn new_capture(from: Square, to: Square) -> Move
pub const fn new_castle(castle: Castle) -> Move
[src]
pub const fn new_castle(castle: Castle) -> Move
pub const fn new_promotion(from: Square, to: Square, promote_to: Kind) -> Move
[src]
pub const fn new_promotion(from: Square, to: Square, promote_to: Kind) -> Move
pub const fn new_capture_promotion(
from: Square,
to: Square,
promote_to: Kind
) -> Move
[src]
pub const fn new_capture_promotion(
from: Square,
to: Square,
promote_to: Kind
) -> Move
pub const fn new_ep_capture(from: Square, to: Square) -> Move
[src]
pub const fn new_ep_capture(from: Square, to: Square) -> Move
Trait Implementations
impl Copy for Move
[src]
impl Copy for Move
impl Clone for Move
[src]
impl Clone for Move
fn clone(&self) -> Move
[src]
fn clone(&self) -> Move
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl PartialEq for Move
[src]
impl PartialEq for Move
fn eq(&self, other: &Move) -> bool
[src]
fn eq(&self, other: &Move) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Move) -> bool
[src]
fn ne(&self, other: &Move) -> bool
This method tests for !=
.
impl Display for Move
[src]
impl Display for Move
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Debug for Move
[src]
impl Debug for Move