Struct hexe::zobrist::Zobrist
[−]
[src]
#[repr(C)]pub struct Zobrist { pub pieces: [[u64; 64]; 6], pub castle: [u64; 16], pub en_passant: [u64; 8], pub color: u64, }
Keys for Zobrist hashing.
Fields
pieces: [[u64; 64]; 6]
Keys for each piece at each square.
castle: [u64; 16]
Keys for each possible set of castle rights.
en_passant: [u64; 8]
Keys for each en passant file.
color: u64
Key for the playing color.
Methods
impl Zobrist
[src]
pub fn piece(&self, role: Role, square: Square) -> u64
[src]
Returns the key for the piece role at a square.
pub fn castle(&self, rights: Rights) -> u64
[src]
Returns the key for the castle rights.
pub fn en_passant(&self, file: File) -> u64
[src]
Returns the en passant key for the file.
pub fn clear(&mut self)
[src]
Clear all hashes by setting them to zero.
pub fn as_slice(&self) -> &[u64]
[src]
Returns the zobrist keys as a contiguous slice.
pub fn as_mut_slice(&mut self) -> &mut [u64]
[src]
Returns the zobrist keys as a contiguous mutable slice.
pub fn as_bytes(&self) -> &[u8]
[src]
Returns the zobrist keys as a contiguous slice of bytes.
pub fn as_bytes_mut(&mut self) -> &mut [u8]
[src]
Returns the zobrist keys as a contiguous mutable slice of bytes.
Trait Implementations
impl Clone for Zobrist
[src]
fn clone(&self) -> Zobrist
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Zobrist
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Hash for Zobrist
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Default for Zobrist
[src]
impl PartialEq for Zobrist
[src]
fn eq(&self, other: &Zobrist) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.