Enum shuuro::piece_type::PieceType [−][src]
pub enum PieceType {
King,
Queen,
Rook,
Bishop,
Knight,
Pawn,
Plinth,
}
Expand description
Represents a kind of pieces.
Variants
King
Queen
Rook
Bishop
Knight
Pawn
Plinth
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 shuuro::PieceType;
assert_eq!(Some(PieceType::Queen), PieceType::Pawn.promote());
Returns an instance of PieceType
before promotion.
Examples
use shuuro::PieceType;
assert_eq!(Some(PieceType::Pawn), PieceType::Queen.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