Enum shogi::PieceType
[−]
[src]
pub enum PieceType {
Pawn,
Lance,
Knight,
Silver,
Gold,
Rook,
Bishop,
King,
ProPawn,
ProLance,
ProKnight,
ProSilver,
ProRook,
ProBishop,
}Represents a kind of pieces.
Variants
PawnLanceKnightSilverGoldRookBishopKingProPawnProLanceProKnightProSilverProRookProBishopMethods
impl PieceType[src]
fn from_sfen(c: char) -> Option<PieceType>
Creates a new instance of PieceType from SFEN formatted string.
fn promote(&self) -> Option<PieceType>
Returns an instance of PieceType after promotion.
Examples
use shogi::PieceType; assert_eq!(Some(PieceType::ProPawn), PieceType::Pawn.promote()); assert_eq!(None, PieceType::ProPawn.promote());
fn unpromote(&self) -> Option<PieceType>
Returns an instance of PieceType before promotion.
Examples
use shogi::PieceType; assert_eq!(Some(PieceType::Pawn), PieceType::ProPawn.unpromote()); assert_eq!(None, PieceType::Pawn.unpromote());
Trait Implementations
impl Debug for PieceType[src]
impl PartialEq for PieceType[src]
fn eq(&self, __arg_0: &PieceType) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0
This method tests for !=.
impl Eq for PieceType[src]
impl Clone for PieceType[src]
fn clone(&self) -> PieceType
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more