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
trueandfalse - 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
0indicates 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