Extra

Struct Extra 

Source
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: String§zombie_immune: [bool; 4]§zombie_type: [String; 4]§enpassant: [Option<(Position, Position)>; 4]§pawnbaserank: usize§uniquify: usize§std2pc: bool

Trait Implementations§

Source§

impl Clone for Extra

Source§

fn clone(&self) -> Extra

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Extra

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Extra

Source§

fn default() -> Self

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

impl Display for Extra

Source§

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

Formats the value using the given formatter. Read more
Source§

impl FromStr for Extra

Source§

type Err = MetaDataParseError

The associated error which can be returned from parsing.
Source§

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

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

impl Hash for Extra

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

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

impl PartialEq for Extra

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Extra

Source§

impl StructuralPartialEq for Extra

Auto Trait Implementations§

§

impl Freeze for Extra

§

impl RefUnwindSafe for Extra

§

impl Send for Extra

§

impl Sync for Extra

§

impl Unpin for Extra

§

impl UnwindSafe for Extra

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.