Struct chess_move_gen::MoveCounter [−][src]
pub struct MoveCounter { pub moves: u8, pub captures: u8, pub castles: u8, pub promotions: u8, pub ep_captures: u8, }
MoveCounter implements MoveList and keeps a count of different types of moves added to it. It can count at most 256 moves since it uses u8
internally
Fields
moves: u8
captures: u8
castles: u8
promotions: u8
ep_captures: u8
Methods
impl MoveCounter
[src]
impl MoveCounter
pub fn new() -> MoveCounter
[src]
pub fn new() -> MoveCounter
Trait Implementations
impl Debug for MoveCounter
[src]
impl Debug for MoveCounter
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 Clone for MoveCounter
[src]
impl Clone for MoveCounter
fn clone(&self) -> MoveCounter
[src]
fn clone(&self) -> MoveCounter
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)
Performs copy-assignment from source
. Read more
impl Copy for MoveCounter
[src]
impl Copy for MoveCounter
impl PartialEq for MoveCounter
[src]
impl PartialEq for MoveCounter
fn eq(&self, other: &MoveCounter) -> bool
[src]
fn eq(&self, other: &MoveCounter) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &MoveCounter) -> bool
[src]
fn ne(&self, other: &MoveCounter) -> bool
This method tests for !=
.
impl MoveList for MoveCounter
[src]
impl MoveList for MoveCounter
fn add_moves(&mut self, _: Square, targets: BB, enemy: BB)
[src]
fn add_moves(&mut self, _: Square, targets: BB, enemy: BB)
Adds moves from the from-square. Targets is a bitboard of valid to-squares. Enemy is a bitboard of enemy pieces (ie pieces that can be captured)
fn add_castle(&mut self, _: Castle)
[src]
fn add_castle(&mut self, _: Castle)
Adds the castle to the move list
fn add_pawn_ep_capture(&mut self, _: Square, _: Square)
[src]
fn add_pawn_ep_capture(&mut self, _: Square, _: Square)
Adds pawn en-passant capture to list. From and to are the squares the moving pieces moves from and to, respectively
fn add_pawn_pushes(&mut self, _: usize, targets: BB)
[src]
fn add_pawn_pushes(&mut self, _: usize, targets: BB)
Adds pawn non-captures to the list. Targets is a bitboard of valid to-squares. Shift is the distance the pawn moved to get to the target square, mod 64. For example, for a white piece moving forward one row this is '8'. For a black piece moving forward one row this is 56 (-8 % 64).
fn add_pawn_captures(&mut self, _: usize, targets: BB)
[src]
fn add_pawn_captures(&mut self, _: usize, targets: BB)
Adds pawn captures to list. Targets and shift are same as for add_pawn_pushes
. Do not use this for en-passant captures (use add_pawn_ep_capture
)
Auto Trait Implementations
impl Send for MoveCounter
impl Send for MoveCounter
impl Sync for MoveCounter
impl Sync for MoveCounter