Enum shogi::piece_type::PieceType [] [src]

pub enum PieceType {
    King,
    Rook,
    Bishop,
    Gold,
    Silver,
    Knight,
    Lance,
    Pawn,
    ProRook,
    ProBishop,
    ProSilver,
    ProKnight,
    ProLance,
    ProPawn,
}

Represents a kind of pieces.

Variants

Methods

impl PieceType
[src]

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.

Converts the instance into the unique number for array indexing purpose.

Trait Implementations

impl Debug for PieceType
[src]

Formats the value using the given formatter.

impl PartialEq for PieceType
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for PieceType
[src]

impl Clone for PieceType
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for PieceType
[src]

impl Display for PieceType
[src]

Formats the value using the given formatter. Read more