Struct fen4::Extra[][src]

pub struct Extra {
    pub royal: [Option<Position>; 4],
    pub lives: Option<[usize; 4]>,
    pub resigned: [bool; 4],
    pub flagged: [bool; 4],
    pub stalemated: [bool; 4],
    pub game_over: String,
    pub zombie_immune: [bool; 4],
    pub zombie_type: [String; 4],
    pub enpassant: [Option<(Position, Position)>; 4],
    pub pawnbaserank: usize,
    pub uniquify: usize,
    pub std2pc: bool,
}
Expand description

Additional options in the FEN4 format stored as a list of key value pairs.

In addition to the always present options in a FEN4, there are also options that are only present if rule variants are enabled. Notable examples would be “en passant” (because its not considered standard) and “N-Check”

The format uses a series of labeled elements separated by commas. The highlevel structure looks like {'label':value,'label2':value2}.

Values seem to be able to take several types. But the ones that are confirmed are:

  • Strings 'string_value'
  • Numbers 65900
  • Booleans true and false
  • Arrays (valueRed, valueBlue, valueYellow, valueGreen)

Examples of known labels used are:

  • 'enPassant':('j3:j4','','','')
    • The first position is where a pawn can capture and the second is where the passing pawn should be removed in the event of a capture.
    • This is neccessary notation because some types of fairy pawns move diagonally. Without the extra information it could be ambiguous.
  • 'lives':(9,6,4,0)
    • Indicates number of lives left for the N-check variant
  • 'pawnsBaseRank':8
    • The rank on which pawns can jump forward 2 square (default:2)
    • a value of 0 indicates pawns never move more than 1
  • 'royal':('a4','b5','c6','d7')
    • Used to indicate which piece should be considered the king for purposes of checks
    • Neccessary in cases of multiple kings (of the same color) or for making a different piece act as the leader
    • This seems to have previously been called ‘kingSquares’
  • 'uniquify':94403
    • It is not clear what this actually does
  • 'resigned':(true,true,false,false) and 'flagged':(false,true,false,false)
    • Both seem to be neccesssary for the “DeadKingWalking” feature.
  • 'stalemated':(true,true,false,false)
    • It is not clear this has any effect, but it might affect the “DeadKingWalking” feature.
  • 'zombieImmune':(true,false,false,true)
    • Makes zombie pieces impossible to capture
  • 'zombieType':('','','','muncher')
    • Used to change the behaviour of zombies
    • Possible types include muncher, comfuter, checker, ranter, and possibly more

The labels have a preferred order. The preferred order is the order of the fields of the struct.

gameOver is an additional option, but only seems to appear in internal messages. It would fit somwhere between flagged and enPassant in terms of preferred order and stores the message that shows up at the end of the game.

This will also use gameOver to represent final messages, but will not specifically try to be compatable with chess.com’s internal messages.

Fields

royal: [Option<Position>; 4]lives: Option<[usize; 4]>resigned: [bool; 4]flagged: [bool; 4]stalemated: [bool; 4]game_over: Stringzombie_immune: [bool; 4]zombie_type: [String; 4]enpassant: [Option<(Position, Position)>; 4]pawnbaserank: usizeuniquify: usizestd2pc: bool

Trait Implementations

impl Clone for Extra[src]

fn clone(&self) -> Extra[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 Debug for Extra[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for Extra[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl Display for Extra[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl FromStr for Extra[src]

type Err = MetaDataParseError

The associated error which can be returned from parsing.

fn from_str(tagged: &str) -> Result<Self, Self::Err>[src]

Parses a string s to return a value of this type. Read more

impl Hash for Extra[src]

fn hash<__H: Hasher>(&self, state: &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]

Feeds a slice of this type into the given Hasher. Read more

impl PartialEq<Extra> for Extra[src]

fn eq(&self, other: &Extra) -> bool[src]

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

fn ne(&self, other: &Extra) -> bool[src]

This method tests for !=.

impl Eq for Extra[src]

impl StructuralEq for Extra[src]

impl StructuralPartialEq for Extra[src]

Auto Trait Implementations

impl RefUnwindSafe for Extra

impl Send for Extra

impl Sync for Extra

impl Unpin for Extra

impl UnwindSafe for Extra

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.