Enum shogi::piece_type::PieceType [−][src]
pub enum PieceType {
Show 14 variants
King,
Rook,
Bishop,
Gold,
Silver,
Knight,
Lance,
Pawn,
ProRook,
ProBishop,
ProSilver,
ProKnight,
ProLance,
ProPawn,
}
Expand description
Represents a kind of pieces.
Variants
Implementations
pub fn iter() -> PieceTypeIterⓘNotable traits for PieceTypeIterimpl Iterator for PieceTypeIter type Item = PieceType;
pub fn iter() -> PieceTypeIterⓘNotable traits for PieceTypeIterimpl Iterator for PieceTypeIter type Item = PieceType;
Notable traits for PieceTypeIter
impl Iterator for PieceTypeIter type Item = PieceType;
Returns an iterator over all variants.
Creates a new instance of PieceType
from SFEN formatted string.
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());
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());
Checks if this piece type can be a part of hand pieces.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for PieceType
impl UnwindSafe for PieceType
Blanket Implementations
Mutably borrows from an owned value. Read more