Enum hexe_core::piece::Piece
[−]
[src]
#[repr(u8)]pub enum Piece { WhitePawn, BlackPawn, WhiteKnight, BlackKnight, WhiteBishop, BlackBishop, WhiteRook, BlackRook, WhiteQueen, BlackQueen, WhiteKing, BlackKing, }
A chess piece with a role and color.
Variants
WhitePawn
BlackPawn
WhiteKnight
BlackKnight
WhiteBishop
BlackBishop
WhiteRook
BlackRook
WhiteQueen
BlackQueen
WhiteKing
BlackKing
Methods
impl Piece
[src]
pub fn new(role: Role, color: Color) -> Piece
[src]
Creates a new Piece
with a Role
and Color
.
pub fn from_char(ch: char) -> Option<Piece>
[src]
Returns a piece from the parsed character.
pub fn role(self) -> Role
[src]
Returns the Role
for the Piece
.
pub fn color(self) -> Color
[src]
Returns the Color
for the Piece
.
pub fn into_char(self) -> char
[src]
Converts self
into a character.
Trait Implementations
impl Index for Piece
[src]
ⓘImportant traits for Bitboardfn bitboard(self, board: &MultiBoard) -> Bitboard
[src]
Returns the bitboard for self
in board
.
fn remove<T: Into<Bitboard>>(self, bits: T, board: &mut MultiBoard)
[src]
Removes the bits
of self
from board
.
fn remove_unchecked<T: Into<Bitboard>>(self, bits: T, board: &mut MultiBoard)
[src]
Performs a blind removal of self
at bits
in board
.
impl<'a> Contained<&'a PieceMap> for Piece
[src]
fn contained_in(self, map: &PieceMap) -> bool
[src]
Returns whether self
is contained in other
.
impl From<Right> for Piece
[src]
impl<T> Extract<[T; 12]> for Piece
[src]
type Output = T
The output type.
fn extract<'a>(self, buf: &'a [T; 12]) -> &'a T
[src]
Extracts a reference to the value for self
within buf
.
fn extract_mut<'a>(self, buf: &'a mut [T; 12]) -> &'a mut T
[src]
Extracts a mutable reference to the value for self
within buf
.
impl Copy for Piece
[src]
impl Clone for Piece
[src]
fn clone(&self) -> Piece
[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 Hash for Piece
[src]
fn hash<__H: Hasher>(&self, __arg_0: &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 PartialEq for Piece
[src]
fn eq(&self, __arg_0: &Piece) -> 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 !=
.
impl Eq for Piece
[src]
impl FromUnchecked<u8> for Piece
[src]
unsafe fn from_unchecked(inner: u8) -> Self
[src]
Performs the unchecked conversion.
impl From<u8> for Piece
[src]
impl FromUnchecked<u16> for Piece
[src]
unsafe fn from_unchecked(inner: u16) -> Self
[src]
Performs the unchecked conversion.
impl From<u16> for Piece
[src]
impl FromUnchecked<u32> for Piece
[src]
unsafe fn from_unchecked(inner: u32) -> Self
[src]
Performs the unchecked conversion.
impl From<u32> for Piece
[src]
impl FromUnchecked<u64> for Piece
[src]
unsafe fn from_unchecked(inner: u64) -> Self
[src]
Performs the unchecked conversion.
impl From<u64> for Piece
[src]
impl FromUnchecked<usize> for Piece
[src]
unsafe fn from_unchecked(inner: usize) -> Self
[src]
Performs the unchecked conversion.